Forums | Mahara Community

Support /
Expired Users - Reactivate


Chris Kenniburg's profile picture
Posts: 34

10 March 2015, 2:07

So I made the mistake awhile back of having a user expiration set for an institution.  Many users had their accounts expire.

Now that the accounts have expired how do I re-activate them in bulk?  Is this even possible?  

I have turned off expiration for the institution but the accounts are already disabled.   Please help and thank you kindly for any response.

Kristina Hoeppner's profile picture
Posts: 4866

10 March 2015, 13:37

Hello Chris,

You can go to Administration -> Users -> Suspended and expired users and re-activate them from there.

Cheers

Kristina

 

Chris Kenniburg's profile picture
Posts: 34

11 March 2015, 6:03

We are talking 150 + pages of users to reactivate.  Do I need to click the checkbox next to each user and then click the reactivate button?  

Just wondering if this could be done in bulk like a "Reactivate All Users".

Tobias Zeuch's profile picture
Posts: 111

11 March 2015, 9:48

Hi Chris,

if you really want to reactivate _all_ deactivated users, you can create a bookmarklet that checks all buttons, hits "reactivate" and reloads the the page (to skip the success message). It's still 150+ clicks, but you don't have to check each user separately. Here is a very quick-and-dirty version (in firefox, create a new bookmark and paste this into the location-field):

javascript:jQuery("input[type=checkbox]").attr('checked',true);jQuery("#buttons_unexpire").click();document.location="suspended.php";

Than go to the "Suspended and expired users" page and click the bookmark, until all users are reactivated.

If you have access to the php-files, you could also (temporarily) change the pagination to show more than 10 elements at a time.

Tobias

Chris Kenniburg's profile picture
Posts: 34

13 March 2015, 0:51

Thank you Tobias.  I will give your solution a shot.  

Kristina Hoeppner's profile picture
Posts: 4866

16 March 2015, 23:37

Hello Tobias,

Thank you for the idea with the bookmarklet. I tried to use it but instead of reactivating users, delete them. The checkboxes were ticked correctly and I did get the confirmation pop-up asking whether I wanted to truly delete users. But then it just reloaded the page instead of deleting the users.

I had put the following into a bookmarklet in Firefox:

javascript:jQuery("input[type=checkbox]").attr('checked',true);jQuery("#buttons_delete").click();document.location="suspended.php";

Do you have an idea what might be going on there?

Thank you

Kristina

 

Tobias Zeuch's profile picture
Posts: 111

17 March 2015, 8:40

Hi Kristina,

the delete-button triggers a JavaScript-Dialog that asks you to confirm the action. As far as I know, you cannot confirm JavaScript-Dialog boxes using JavaScript. That's probably a security feature, that requires at least a bit of user-interaction when doing serious modifications and you wouldn't want some sketchy hidden JavaScript-Code to bypass that ^^

I suggest you cut the last command (starting with "document.location=..."). Then you can click on the bookmarklet and confirm the dialog with enter. It should redirect you to the right side again with the next 10 users ready to delete.

Actually, you don't need the last redirect at all. I just tested with suspended users and got confused because the list was empty after clicking on "reactivate Users" - which redirected me to the list of expired users.

Cheers
Tobias

Kristina Hoeppner's profile picture
Posts: 4866

23 March 2015, 15:28

Hello Tobias,

I get interesting results. :-)

When I leave off the "document.location" bit and want to delete users, there is no confirmation when they are on "Expired users", the default selected item. When I switch to "Suspended users" and click the bookmarklet, it asks me whether I want to leave the page or stay on it. I have to click the "Stay on page" twice and then click the "Delete user" button and then go through the normal process. I guess, it will be easier / better / faster to implement the "Max. number of items to show" select box. :-)

Cheers

Kristina

 

8 results