Permalink
Browse files

Fixes to Granting system and password request

  • Loading branch information...
tvannini committed Nov 19, 2018
1 parent 645b2f5 commit 5e3038146dc4e502e7d9bf806ed297b42db14acd
Showing with 21 additions and 8 deletions.
  1. +1 −1 lib/prgs/jxgranting.prf
  2. +19 −7 lib/prgs/jxgranting_pwd.prf
  3. +1 −0 lib/prgs/jxgranting_pwd.prg
@@ -1011,7 +1011,7 @@ function jxgranting
function jxgranting��password_edit_act(&$o2exe) {
// $o2exe->s(1) && True && o2act::remark("Preserve flag throw password set") && $o2exe->e();
$o2exe->s(2) && True && o2act::set("prg�_�var", "force_pwd_change_save", jxgranting_exp_113()) && $o2exe->e();
$o2exe->s(3) && True && o2act::call(jxgranting_exp_36(), False, jxgranting_exp_7()) && $o2exe->e();
$o2exe->s(3) && True && o2act::call(jxgranting_exp_36(), False, jxgranting_exp_7(), jxgranting_exp_9999(), jxgranting_exp_5()) && $o2exe->e();
$o2exe->s(4) && True && o2act::view("users", "0", "") && $o2exe->e();
$o2exe->s(5) && True && o2act::set("users", "force_pwd_change", jxgranting_exp_114()) && $o2exe->e();
$o2exe->s(6) && True && o2act::exe("user_write", True, "") && $o2exe->e();
@@ -123,12 +123,14 @@ function jxgranting_pwd
$ctrl_o2htmlarea3->y(60);
$ctrl_o2htmlarea3->larghezza(250);
$ctrl_o2htmlarea3->altezza(40);
$ctrl_o2htmlarea3->visibile(jxgranting_pwd_exp_32());
$ctrl_o2htmlarea3->html(jxgranting_pwd_exp_31());
}
function jxgranting_pwd��cancel_act(&$o2exe) {
$o2exe->s(1) && True && o2act::script(jxgranting_pwd_exp_29()) && $o2exe->e();
$o2exe->s(2) && True && o2act::close()&& $o2exe->e();
$o2exe->s(2) && True && o2act::ret(3, jxgranting_pwd_exp_1()) && $o2exe->e();
$o2exe->s(3) && True && o2act::close()&& $o2exe->e();
} //|o2_fine_act|
function jxgranting_pwd��ok_act(&$o2exe) {
@@ -138,7 +140,8 @@ function jxgranting_pwd
$o2exe->s(4) && True && o2act::set("user", "force_pwd_change", jxgranting_pwd_exp_1()) && $o2exe->e();
$o2exe->s(5) && True && o2act::view("user", "S", "") && $o2exe->e();
$o2exe->s(6) && True && o2act::script(jxgranting_pwd_exp_29()) && $o2exe->e();
$o2exe->s(7) && True && o2act::close()&& $o2exe->e();
$o2exe->s(7) && True && o2act::ret(3, jxgranting_pwd_exp_11()) && $o2exe->e();
$o2exe->s(8) && True && o2act::close()&& $o2exe->e();
} //|o2_fine_act|
function jxgranting_pwd��save_act(&$o2exe) {
@@ -265,7 +268,7 @@ return ($txt);
function jxgranting_pwd_exp_15() {
$s = $_SESSION['o2_app']->password_strength;
$v = $s === 1 || $s === 2;
$v = (o2app_user() != 'root') && ($s === 1 || $s === 2);
return ($v);
} //|o2_fine_exp|
@@ -281,6 +284,7 @@ return (' jxbtn_cancel');
function jxgranting_pwd_exp_18() {
o2js_load_script(o2rnt_alias().'js/md5.js');
$su = (o2app_user() == 'root' ? '!0' : '!1');
$idx = count(o2app_prg());
$btn = '<div class="o2_ctrl_button jxbtn_save" style="width:100%;height:100%;line-height:30px;" '.
'onkeyup="e=o2jse.event.std(event);if(e.keyCode==32||e.keyCode==13||(e.keyCode==83&&e.altKey)){'.
@@ -291,7 +295,7 @@ $btn.= '<script>function jxpwdcheck(event) {'.
'var pwdr = o2jse.infoForm["pwd_repeat'.$idx.'"];'.
'var pwdo = o2jse.infoForm["pwd_old'.$idx.'"];'.
'var re = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^a-zA-Z0-9])(?=.{8,})");'.
'if (!'.($_SESSION['o2_app']->password_strength ? 'true' : 'false').'|| re.test(pwd.value)) {'.
'if ('.$su.' || (!'.($_SESSION['o2_app']->password_strength ? 'true' : 'false').'|| re.test(pwd.value))) {'.
'pwd.value = hex_md5(pwd.value);o2jse.ctrl.c(pwd);'.
'pwdr.value = hex_md5(pwdr.value);o2jse.ctrl.c(pwdr);'.
'pwdo.value = hex_md5(pwdo.value);o2jse.ctrl.c(pwdo);'.
@@ -324,6 +328,8 @@ if ($_SESSION['o2_app']->password_strength === 2) {
$h = o2val('user','pwds_history');
$c = (strpos($h, $p.';') !== false ? 3 : $c);
}
/* No rules for "root" */
$c = (o2app_user() == 'root' ? 0 : $c);
/* Check password repeat */
$c = ($p === $r ? $c : 2);
/* Old password */
@@ -382,9 +388,10 @@ return (o2val('prg
} //|o2_fine_exp|
function jxgranting_pwd_exp_29() {
/* If editing password for current user then relogin with new credentials ___ */
if (!o2par(1) || (o2par(1) == o2app_user())) {
$_SESSION['o2_app']->password = o2val('user','o2password');
/* _____________________ Needed for "Open new session" and Logout/relogin ___ */
$_SESSION['o2_app']->password = o2val('user','o2password');
/* ___________________ Relogin with new credentials only for system calls ___ */
if (!o2par(3)) {
o2app_logout(true);
}
return (true);
@@ -410,4 +417,9 @@ switch ($GLOBALS['jxPwdChangeCode']) {
$msg.= '</center>';
return ($msg);
} //|o2_fine_exp|
function jxgranting_pwd_exp_32() {
return ($GLOBALS['jxPwdChangeCode']);
} //|o2_fine_exp|
?>
@@ -20,5 +20,6 @@ o2def::act("wrong_repeat", "");
o2def::form("password", "", False, "true", false);
o2def::par(1, "user_name", "_o2alpha");
o2def::par(2, "old_password", "_o2logical");
o2def::par(3, "set_get_result", "_o2logical");
?>

0 comments on commit 5e30381

Please sign in to comment.