Commit d9e0e603 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Check permission in admin user search, remove suspension code (bug #771614)



Change-Id: Ic9465c35d79cc663fc172da2ab66225eaeda76ee
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent bc4cc476
...@@ -27,25 +27,12 @@ ...@@ -27,25 +27,12 @@
define('INTERNAL', 1); define('INTERNAL', 1);
define('JSON', 1); define('JSON', 1);
define('INSTITUTIONALADMIN', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php'); require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$action = param_variable('action'); $action = param_variable('action');
if ($action == 'suspend') {
$id = param_integer('id');
$reason = param_variable('reason');
try {
suspend_user($id, $reason);
}
catch (MaharaException $e) {
json_reply('local', get_string('suspendfailed', 'admin') . ': ' . $e->getMessage());
}
json_reply(false, get_string('usersuspended', 'admin'));
}
if ($action == 'search') { if ($action == 'search') {
require_once('searchlib.php'); require_once('searchlib.php');
......
...@@ -142,17 +142,10 @@ function UserSearch() { ...@@ -142,17 +142,10 @@ function UserSearch() {
if ($('searchresults')) { if ($('searchresults')) {
self.rewritePaging(); self.rewritePaging();
self.rewriteSorting(); self.rewriteSorting();
self.rewriteSuspendLinks();
} }
}); });
} }
this.rewriteSuspendLinks = function() {
forEach(getElementsByTagAndClassName('a', 'suspend-user-link', 'searchresults'), function(i) {
connect(i, 'onclick', suspendDisplay);
});
}
addLoadEvent(self.init); addLoadEvent(self.init);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment