Page 1 of 1

Possible to deactivate a user?

Posted: Thu Nov 16, 2006 2:27 am
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.

Re: Possible to deactivate a user?

Posted: Thu Nov 16, 2006 9:43 am
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

Posted: Tue Mar 20, 2007 8:39 pm
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?

Posted: Tue Mar 20, 2007 9:07 pm
by stm999999999
what is about a general patch: Do not list users/authors with zero articles?

Posted: Wed Mar 21, 2007 10:50 am
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

Posted: Wed Mar 21, 2007 1:30 pm
by stm999999999
ah, I overread the "a while" in "We have some authors who haven't written for us in a while"