Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
New option in Auth to preset a login, providing a password-only prote…
Browse files Browse the repository at this point in the history
…ction for minisites
  • Loading branch information
cdujeu committed Apr 23, 2014
1 parent 4d4155e commit 8bcbc69
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/src/plugins/core.auth/class.AbstractAuthDriver.php
Expand Up @@ -54,6 +54,9 @@ public function switchAction($action, $httpVars, $fileVars)
$loggingResult = -4;
} else {
$userId = (isSet($httpVars["userid"])?trim($httpVars["userid"]):null);
if($userId == 'PRESET_LOGIN' && isSet($_SESSION["PENDING_LOGIN"])){
$userId = $_SESSION["PENDING_LOGIN"];
}
$userPass = (isSet($httpVars["password"])?trim($httpVars["password"]):null);
$rememberMe = ((isSet($httpVars["remember_me"]) && $httpVars["remember_me"] == "true")?true:false);
$cookieLogin = (isSet($httpVars["cookie_login"])?true:false);
Expand Down
16 changes: 15 additions & 1 deletion core/src/plugins/core.auth/standard_auth_actions.xml
Expand Up @@ -25,7 +25,22 @@
top:$("progressBox").getStyle('top'),
left:$("progressBox").getStyle('left')
});
var authConfs = ajaxplorer.getPluginConfigs("auth");
if(!authConfs) authConfs = $H();
if(!Modernizr.input.placeholder) oForm.addClassName('no_placeholder');
if(window.ajxpBootstrap.parameters.get('PRESET_LOGIN')){
oForm.addClassName('ajxp_preset_login');
oForm.down('input[name="userid"]').setValue(window.ajxpBootstrap.parameters.get('PRESET_LOGIN'));
}
if(window.ajxpBootstrap.parameters.get('PRESET_PASSWORD')){
oForm.addClassName('ajxp_preset_password');
oForm.down('input[name="password"]').setValue(window.ajxpBootstrap.parameters.get('PRESET_PASSWORD'));
}
if(window.ajxpBootstrap.parameters.get('PASSWORD_AUTH_ONLY')){
oForm.addClassName('ajxp_password_auth');
authConfs.set('SECURE_LOGIN_FORM', true);
authConfs.set('ENABLE_FORGOT_PASSWORD', false);
}
$("generic_dialog_box").down(".titleString").hide();
$("generic_dialog_box").down("#modalCloseBtn").hide();
$("generic_dialog_box").down(".dialogTitle").setAttribute("style", $("progressBox").down(".dialogTitle").getAttribute("style"));
Expand All @@ -50,7 +65,6 @@
oForm.down('input[type="text"]').key_enter_attached = true;
}
var authConfs = ajaxplorer.getPluginConfigs("auth");
if(authConfs && authConfs.get("SECURE_LOGIN_FORM")){
try{
oForm.down('input[name="remember_me"]').up("div.SF_element").remove();
Expand Down

0 comments on commit 8bcbc69

Please sign in to comment.