Commit 57bfcf20 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Clean up target_user code, to all admins to make changes for other users.

parent 4e10fc00
......@@ -39,27 +39,18 @@ if (isset($this_user)) {
#
# Verify page arguments.
#
$optargs = OptionalPageArguments("uid", PAGEARG_STRING);
$optargs = OptionalPageArguments("target_user", PAGEARG_USER);
if (!isset($uid)) {
$uid = $this_user->uid();
if (! isset($target_user)) {
$target_user = $this_user;
}
elseif (!ISADMIN()) {
$uid = $target_user->uid();
if ($target_user->uid() != $this_user->uid() && !ISADMIN()) {
sleep(2);
SPITUSERERROR("Not enough permission");
return;
}
elseif (!TBvalid_uid($uid)) {
SPITUSERERROR("Invalid user");
}
else {
$target_user = User::LookupByUid($uid);
if (!$target_user) {
sleep(2);
SPITUSERERROR("No such user");
return;
}
}
# We use a session. in case we need to do verification
session_start();
......
Supports Markdown
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