mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-16 14:41:39 +00:00
pass formkey when substituting user
This commit is contained in:
parent
9fee411f3f
commit
0351305995
|
@ -25,14 +25,20 @@ include("../inc/inc.DBInit.php");
|
||||||
include("../inc/inc.ClassUI.php");
|
include("../inc/inc.ClassUI.php");
|
||||||
include("../inc/inc.Authentication.php");
|
include("../inc/inc.Authentication.php");
|
||||||
|
|
||||||
if (!$user->isAdmin()) {
|
/* Check if the form data comes for a trusted request */
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
if(!checkFormKey('substituteuser', 'GET')) {
|
||||||
|
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_request_token"))),getMLText("invalid_request_token"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($_GET["userid"])) {
|
if (!isset($_GET["userid"])) {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
|
UI::exitError(getMLText("admin_tools"),getMLText("unknown_id"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if user is allowed to switch to a different user */
|
||||||
|
if (!$user->isAdmin()) {
|
||||||
|
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||||
|
}
|
||||||
|
|
||||||
$session->setSu($_GET['userid']);
|
$session->setSu($_GET['userid']);
|
||||||
|
|
||||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_substituted_user')));
|
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_substituted_user')));
|
||||||
|
|
|
@ -68,7 +68,7 @@ class SeedDMS_View_SubstituteUser extends SeedDMS_Bootstrap_Style {
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "<td>";
|
echo "<td>";
|
||||||
if($currUser->getID() != $user->getID()) {
|
if($currUser->getID() != $user->getID()) {
|
||||||
echo "<a class=\"btn\" href=\"../op/op.SubstituteUser.php?userid=".$currUser->getID()."\"><i class=\"icon-exchange\"></i> ".getMLText('substitute_user')."</a> ";
|
echo "<a class=\"btn\" href=\"../op/op.SubstituteUser.php?userid=".$currUser->getID()."&formtoken=".createFormKey('substituteuser')."\"><i class=\"icon-exchange\"></i> ".getMLText('substitute_user')."</a> ";
|
||||||
}
|
}
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user