mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #60535
[Bug 1899571] [NEW] The only site admin can suspend the account by oneself
Public bug reported:
Now the only site admin can suspend the account by oneself and be locked out from the site.
So I think it's better for us to avoid site admins suspending oneself by changing code as below.
File to modify:
admin/users/bulk.php
Line:
294
[ Before ]
db_begin();
foreach ($users as $user) {
if (!$user->suspendedcusr) {
suspend_user($user->id, $values['reason']);
$suspended++;
}
}
db_commit();
$SESSION->add_ok_msg(get_string('bulksuspenduserssuccess', 'admin', $suspended));
redirect('/admin/users/suspended.php');
[ After ]
db_begin();
foreach ($users as $user) {
if (!$user->suspendedcusr && !get_record('usr', 'id', $user->id, 'admin', '1')) {
suspend_user($user->id, $values['reason']);
$suspended++;
}
}
db_commit();
$SESSION->add_ok_msg(get_string('bulksuspenduserssuccess', 'admin', $suspended));
$SESSION->add_error_msg('You can\'t suspend site admins.');
redirect('/admin/users/suspended.php');
** Affects: mahara
Importance: Undecided
Status: New
** Tags: suspend
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1899571
Title:
The only site admin can suspend the account by oneself
Status in Mahara:
New
Bug description:
Now the only site admin can suspend the account by oneself and be locked out from the site.
So I think it's better for us to avoid site admins suspending oneself by changing code as below.
File to modify:
admin/users/bulk.php
Line:
294
[ Before ]
db_begin();
foreach ($users as $user) {
if (!$user->suspendedcusr) {
suspend_user($user->id, $values['reason']);
$suspended++;
}
}
db_commit();
$SESSION->add_ok_msg(get_string('bulksuspenduserssuccess', 'admin', $suspended));
redirect('/admin/users/suspended.php');
[ After ]
db_begin();
foreach ($users as $user) {
if (!$user->suspendedcusr && !get_record('usr', 'id', $user->id, 'admin', '1')) {
suspend_user($user->id, $values['reason']);
$suspended++;
}
}
db_commit();
$SESSION->add_ok_msg(get_string('bulksuspenduserssuccess', 'admin', $suspended));
$SESSION->add_error_msg('You can\'t suspend site admins.');
redirect('/admin/users/suspended.php');
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1899571/+subscriptions
Follow ups
-
[Bug 1899571] Re: The only site admin can suspend the account by oneself
From: Kristina Hoeppner, 2020-11-08
-
[Bug 1899571] Re: The only site admin can suspend the account by oneself
From: Robert Lyon, 2020-11-01
-
[Bug 1899571] Re: The only site admin can suspend the account by oneself
From: Robert Lyon, 2020-10-22
-
[Bug 1899571] Re: The only site admin can suspend the account by oneself
From: Rangi Daymond, 2020-10-15
-
[Bug 1899571] A change has been merged
From: Mahara Bot, 2020-10-15
-
[Bug 1899571] A patch has been submitted for review
From: Mahara Bot, 2020-10-15
-
[Bug 1899571] A change has been merged
From: Mahara Bot, 2020-10-15
-
[Bug 1899571] Re: The only site admin can suspend the account by oneself
From: Robert Lyon, 2020-10-15
-
[Bug 1899571] Re: The only site admin can suspend the account by oneself
From: Robert Lyon, 2020-10-14
-
[Bug 1899571] Re: The only site admin can suspend the account by oneself
From: Kristina Hoeppner, 2020-10-13
-
[Bug 1899571] A patch has been submitted for review
From: Mahara Bot, 2020-10-13