Skip to content

Commit

Permalink
FEATURE #396 - Allow god users to switch to other users.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgob committed Dec 13, 2010
1 parent cdd4fdf commit 03c4344
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Binary file added images/switch_user.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion users.php
Expand Up @@ -29,6 +29,11 @@
verify_permission('is_ueberuser') ? $perm_is_godlike = "1" : $perm_is_godlike = "0" ;
verify_permission('user_add_new') ? $perm_add_new = "1" : $perm_add_new = "0" ;

if(isset($_GET['action']) && $_GET['action'] === "switchuser" && $perm_is_godlike === "1"){
$_SESSION["userlogin"] = $_GET['username'];
echo '<meta http-equiv="refresh" content="1"/>';
}

unset($commit_button);

if (isset($_POST['commit'])) {
Expand Down Expand Up @@ -66,7 +71,8 @@

// do not allow to delete him- or herself, available to superusers only
if($user['uid'] != $_SESSION["userid"] || $perm_is_godlike == "1"){
echo " <a href=\"delete_user.php?id=" . $user['uid'] . "\"><img src=\"images/delete.gif\" alt=\"[ " . _('Delete user') . " ]\"></a>\n";
echo " <a href=\"delete_user.php?id=" . $user['uid'] . "\"><img src=\"images/delete.gif\" alt=\"[ " . _('Delete user') . " ]\"></a>";
echo " <a href=\"users.php?action=switchuser&username=" . $user['username'] . "\"><img src=\"images/switch_user.png\" alt=\"[ " . _('Switch user') . " ]\"></a>\n";
}

echo " </td>\n";
Expand Down

0 comments on commit 03c4344

Please sign in to comment.