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

Commit

Permalink
Throw error to prevent dialog closing on force password change action.
Browse files Browse the repository at this point in the history
…Close #900
  • Loading branch information
cdujeu committed Mar 18, 2016
1 parent c310e6d commit 86f3f0f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions core/src/plugins/core.auth/standard_auth_actions.xml
Expand Up @@ -14,7 +14,7 @@
<processing>
<clientCallback prepareModal="true" dialogOpenForm="pass_change_form" dialogOkButtonOnly="false" dialogSkipButtons="false">
<dialogOnOpen><![CDATA[
if(ajaxplorer.user.lock){
if(pydio.user.lock){
modal.getForm().insert({top:new Element("div", {className:"dialogLegend"}).update(MessageHash[444])});
}
$('user_change_ownpass_old').value = $('user_change_ownpass1').value = $('user_change_ownpass2').value = '';
Expand All @@ -36,7 +36,7 @@
var passSeed = null;
if($('user_change_ownpass1') && $('user_change_ownpass1').value && $('user_change_ownpass2').value)
{
if($('user_change_ownpass1').value.length < parseInt(window.ajaxplorer.getPluginConfigs("core.auth").get("PASSWORD_MINLENGTH"))){
if($('user_change_ownpass1').value.length < parseInt(window.pydio.getPluginConfigs("core.auth").get("PASSWORD_MINLENGTH"))){
alert(MessageHash[378]);
return false;
}
Expand All @@ -59,19 +59,19 @@
var onComplete = function(transport){
var addition = '';
var logout = false;
if(ajaxplorer.user.lock){
if(pydio.user.lock){
addition = '\n ' + MessageHash[445];
}
if(userPass != null){
if(transport.responseText == 'PASS_ERROR'){
alert(MessageHash[240]);
}else if(transport.responseText == 'SUCCESS'){
ajaxplorer.displayMessage('SUCCESS', MessageHash[197] + addition);
pydio.displayMessage('SUCCESS', MessageHash[197] + addition);
if(addition) logout = true;
hideLightBox(true);
}
}else{
ajaxplorer.displayMessage('SUCCESS', MessageHash[241] + addition);
pydio.displayMessage('SUCCESS', MessageHash[241] + addition);
if(addition) logout = true;
hideLightBox(true);
}
Expand All @@ -89,7 +89,11 @@
conn.sendAsync();
}
]]></dialogOnComplete>
<dialogOnCancel><![CDATA[]]></dialogOnCancel>
<dialogOnCancel><![CDATA[
if(pydio.user.lock){
throw new Error();
}
]]></dialogOnCancel>
</clientCallback>
<clientForm id="pass_change_form"><![CDATA[
<div id="pass_change_form" action="pass_change_form" box_width="260">
Expand Down

0 comments on commit 86f3f0f

Please sign in to comment.