svn path=/Website/trunk/; revision=28611
This commit is contained in:
Jos Groot Lipman
2016-03-24 10:35:18 +00:00
parent 8b0d2efa26
commit d6f092eb1a
2 changed files with 6 additions and 4 deletions

View File

@@ -20,8 +20,9 @@ var JSON_Result = true;
<%
protectRequest.validateToken();
user.auth_required_or_abort(S("prs_allow_impersonate"));
user.checkAutorisation("WEB_PRSSYS");
if (!S("prs_allow_impersonate"))
user.checkAutorisation("WEB_FACTAB");
var prs_key = getFParamInt("prs_key");
var other = new Perslid(prs_key);
@@ -30,7 +31,7 @@ var JSON_Result = true;
Session("org_user_key") = user_key;
Session("org_user_key_ts") = new Date().getTime();
shared.trackaction("PRSLOG", prs_key, ("lcl_impersonated"));
shared.trackaction("PRSLOG", prs_key, L("lcl_impersonated"));
doLogin(prs_key);
result = { success: "true" };

View File

@@ -219,8 +219,9 @@ var prs_user = new Perslid(prs_key);
buttons.push( { title: L("lcl_menu_fac_autorisaties"), icon: "autorisatie.png", action: "prs_gotoautgroup()" });
}
if (S("prs_allow_impersonate") && prsauthparams.writesys && prs_key != user_key && typeof Session("org_user_key") == "undefined") {
buttons.push({ title: L("lcl_prs_impersonate"), icon: "impersonate.png", action: "prs_impersonate()", id: "bimpers" });
var canImpers = prsauthparams.writetab || (S("prs_allow_impersonate") && prsauthparams.writesys)
if (canImpers && prs_key != user_key && typeof Session("org_user_key") == "undefined") {
buttons.push({ title: L("lcl_impersonate"), icon: "impersonate.png", action: "prs_impersonate()", id: "bimpers" });
}
}
IFRAMER_HEADER(L("lcl_prs_persoon_frame"), buttons);