Possible to deactivate a user?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Shoup
Regular
Posts: 26
Joined: Mon Jul 10, 2006 9:25 pm

Possible to deactivate a user?

Post by Shoup »

Is it possible to deactivate a user, making them invisible in the author list sidebar, without deleting their account? We have some authors who haven't written for us in a while and so we don't want them showing up in our authors sidebar for now. They might be doing some postings in the future, so we'd like to keep their postings in the system and their account in the database.

I guess it's kind of a hiatus setting.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Possible to deactivate a user?

Post by garvinhicking »

Hi!

Sadly this is not possible, s9y does not know a "deactivated" switch. Serendipity also currently does not save timestamps of a "last login", so there is actually no data to see when an author logged out and is removed based on that.

A workaround for that could be to set that user's "Publish entries?" flag to "No". Then you can patch the authors sidebar plugin to only show users where this flag is set?

To do that, patch the include/plugin_internal.inc.php file and search for this:

Code: Select all

        if (is_array($authors) && count($authors)) {
            foreach ($authors as $auth) {
replace it with:

Code: Select all

        if (is_array($authors) && count($authors)) {
            foreach ($authors as $auth) {
                if ($auth['right_publish'] < 1) continue;
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Shoup
Regular
Posts: 26
Joined: Mon Jul 10, 2006 9:25 pm

Post by Shoup »

Could I use the "Forbid Creating Entries" status instead of the publishing rights status?

If so, instead of 'right publish' what would I use for that data field?
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

what is about a general patch: Do not list users/authors with zero articles?
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Shoup: This would then be a 'no_create' privilege, however that value is not in serendipity_authors but in serendipity_config, so it's not available in that foreach-scope. Thus you would also need to patch the SQL query to include the user's specific configuration settings from serendipity_config

stm9x9: This patch is at least present in Serendipity 1.2, where you can define a minimum entry count :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

ah, I overread the "a while" in "We have some authors who haven't written for us in a while"
Ciao, Stephan
Post Reply