Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2011-11-16 09:47:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,720
Website GitHub

Re: smd_user_manager: keep large user bases under control

georgeM wrote:

restrict a user to seeing ONLY their articles/files/images/etc. in the list view

Sadly Txp doesn’t support this action natively; it requires a rethink of the way we do things. The main problem is that the content counts/pagination are done first and then the list is produced so it’s not possible to filter the list without screwing up the numbers.

If the count was done afterwards or we checked a preference first so we could influence the initial query we could maybe introduce such a ‘view’ priv/pref (shifting the counts later may have other consequences, I’m not sure — there’s probably a reason it’s done this way round so it makes sense to consider a preference value instead).

Ruud wrote a plugin ages ago that faked such a system. Whether it still works, or whether it’s such a hot idea in 4.4.1 I don’t know. I believe there’s also a plugin somewhere that does it via jQuery, just hiding the rows that don’t match the current logged-in author. Again, the counts will be wrong (e.g. if viewing 25 per page you might only see 8 on-screen) but if you can live with that it’s an option. Other than that you’ll have to just make do with the .edit.own privs so at least other people can’t get their mitts on other people’s content.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#38 2011-11-16 12:28:26

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: smd_user_manager: keep large user bases under control

Hi,
you can give asv_auth_articles a try. Untill some time ago it worked perfectly

Offline

#39 2011-11-16 12:40:02

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,720
Website GitHub

Re: smd_user_manager: keep large user bases under control

redbot wrote:

asv_auth_articles

Yes it will work, thanks for the link. That plugin’s essentially a clone of the Txp articles list page but with a different query — a real shame that Amit had to go so far as having to duplicate tonnes of core code for something so (apparently) simple.

There are a few downsides to the plugin though:

  1. it’s only for articles, not the other content types (I wouldn’t fancy writing and maintaining a plugin that did it for all content types as it’s a lot of duplicate code!)
  2. since it predates Txp 4.3.0 the markup it produces is that of an old Txp version. Hence it won’t have the newer layout and DOM/id/class hooks in it, so some themes won’t work properly on the List page without modification.
  3. since it uses a hard-coded <form> tag it also won’t employ the security features built into Txp in 4.4.1

By all means install it, but bear those points in mind if you do.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#40 2011-11-16 13:06:40

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: smd_user_manager: keep large user bases under control

Bloke wrote:

…There are a few downsides to the plugin though…

Thanks for the useful infos, actually last time I used the plugin it was some txp versions ago and I didn’t take into account the intervened markup changes.

Offline

#41 2011-11-17 17:17:40

georgeM
Member
From: Toronto, Canada
Registered: 2006-02-27
Posts: 43
Website

Re: smd_user_manager: keep large user bases under control

Yes, thank you Stef. You’re a true TXP legend. I’ve been using TXP for 6+ years, and it’s great to see how much you’ve contributed to the community, even to this day.

Anyways, I think i will wait on installing asv_auth_articles due to the points that you mentioned. I have updated to 4.4.1 and would rather make sure everything is running proper on the new code.

I’ll keep an eye out in the future though, maybe it will make it into the main branch :)

Thanks again and cheers!

Offline

#42 2012-04-26 09:07:36

[Axel]
Member
From: Switzerland/Denmark
Registered: 2007-07-26
Posts: 65
Website

Re: smd_user_manager: keep large user bases under control

It was asked earlier in this thread, but I could not find an answer. I need to restrict authors only to add new articles to a section or category. You have any tips how to archive this?


Greetz [Axel]

Offline

#43 2012-04-27 15:54:29

moon blake
Member
From: near Hannover, Germany
Registered: 2009-07-16
Posts: 75

Re: smd_user_manager: keep large user bases under control

Hi Axel,

the answer you miss is here and AFAIK what sacripant wrote is still fact. I think we all hope hat there wil be a possibility in the future to restrict users to specific sections.

Dirk

Last edited by moon blake (2012-04-27 19:20:15)

Offline

#44 2012-04-28 12:05:40

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,268

Re: smd_user_manager: keep large user bases under control


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#45 2012-05-02 19:50:40

moon blake
Member
From: near Hannover, Germany
Registered: 2009-07-16
Posts: 75

Re: smd_user_manager: keep large user bases under control

Wow! Didn’t knew about that stuff. Thanks Uli.

I will play around a little with this possibilities and I think I can achieve what I want.
Still one question: why has obviously no one made a plugin out of Bloke’s code snippet? Or why hasn’t Bloke himself not integrated this in smd_user? Unfortunately I myself don’t know any PHP

Offline

#46 2012-05-02 20:16:37

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,268

Re: smd_user_manager: keep large user bases under control

moon blake wrote:

why has obviously no one made a plugin out of Bloke’s code snippet?

It’s not rocket science, just paste the code into a new plugin panel in ied_plugin_composer, name it, set some prefs (I’d say: admin side plugin, load order 5) and hit Save.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#47 2012-05-02 20:18:59

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,720
Website GitHub

Re: smd_user_manager: keep large user bases under control

moon blake wrote:

why hasn’t Bloke himself not integrated this in smd_user?

smd_user_manager is a tool to allow you to administer users and groups. What you do with the users and groups is outside the scope of the plugin. If I was to put that functionality into the plugin then, as I outlined in that thread, someone would want to play it differently and I’d be forever tweaking / expanding the plugin to suit people’s ideas of what it means to restrict users to sections.

As Uli says, with a copy of ied_plugin_composer and those 10 lines of PHP you can copy that code to create a plugin. After that, you can control who can edit what with smd_user_manager by creating a section.your-section-name priv and assigning rights to it.

I’ve used that code (or a variation) on sites before and it works1, but I don’t use the functionality enough to warrant making and maintaining a separate plugin because each site has different ideas about what constitutes ‘admin’. To do it properly would require a configuration interface and a shedload more code. The simplest solution for me is to copy the code and alter the rights in the first line to suit the site.

1 It probably won’t work when 4.5.0 is released because the new constraints system might block its use. The plugin will likely have to be altered to take that into account (but it might still work, I’m not sure right now)

Last edited by Bloke (2012-05-02 20:21:45)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#48 2012-05-03 18:15:16

[Axel]
Member
From: Switzerland/Denmark
Registered: 2007-07-26
Posts: 65
Website

Re: smd_user_manager: keep large user bases under control

I installed it on the latest Textpattern (Revision 3769: /development/4.x) and it works fine. No Idea how far away from the real 4.5 this is, I hope it will be compatible.

As this User restriction to certain sections is necessary for the site I’m working on, and the ability to upgrade without the troubles as in drupal/wordpress etc. is one of the “sales features” the client needs!

The time frame for this project is tied to the release of Textpattern 4.5 I hope I’m not wasting time right now.


Greetz [Axel]

Offline

Board footer

Powered by FluxBB