diff options
author | M.Gergo | 2018-07-06 11:14:41 +0200 |
---|---|---|
committer | M.Gergo | 2018-07-06 11:14:41 +0200 |
commit | 43de9af71f7f4ca5731b94a06d688ae8412ba427 (patch) | |
tree | 54835de1dfcda504c02da261f0dc26885aed2e89 /mayor-orig/www/policy/private/password | |
parent | 50310b0e4513ee3fcce67351ae61e8fff851130e (diff) | |
download | mayor-43de9af71f7f4ca5731b94a06d688ae8412ba427.tar.gz mayor-43de9af71f7f4ca5731b94a06d688ae8412ba427.zip |
2018/Feb/28 -i állapot hozzáadva, mint a módosítások kiindulási állapota
Diffstat (limited to 'mayor-orig/www/policy/private/password')
-rw-r--r-- | mayor-orig/www/policy/private/password/changePassword-pre.php | 60 | ||||
-rw-r--r-- | mayor-orig/www/policy/private/password/changePassword.php | 9 |
2 files changed, 69 insertions, 0 deletions
diff --git a/mayor-orig/www/policy/private/password/changePassword-pre.php b/mayor-orig/www/policy/private/password/changePassword-pre.php new file mode 100644 index 00000000..08731581 --- /dev/null +++ b/mayor-orig/www/policy/private/password/changePassword-pre.php @@ -0,0 +1,60 @@ +<?php +/* + Module: base/password + + Ez még teljesen kiforratlan! + Csak átmásoltam a public-ból, és elkezdtem átírni... +*/ + + if (_RIGHTS_OK !== true) die(); + + $toPolicy = readVariable($_POST['toPolicy'], 'enum', readVariable($_GET['toPolicy'], 'enum', _POLICY, $POLICIES), $POLICIES); + + // Itt csak a private policy jelszavát lehet módosítani +// $toPolicy = 'private'; + $userAccount = readVariable($_REQUEST['userAccount'], 'emptystringnull'); + + // Ha saját jelszavát szeretné változtatni, akkor átirányítjuk oda + if ($userAccount == _USERACCOUNT) { + header('Location: '.location('index.php?policy=public&page=password&f=changePassword&toPolicy='.$toPolicy,array('lang','skin','sessionID'))); + exit; + } + + // Jogosultság ellenőrzés + if ( + memberOf(_USERACCOUNT, $AUTH[_POLICY]['adminGroup']) or + (memberOf($userAccount,'diák') and memberOf(_USERACCOUNT,'diakadmin')) + ) { + + // Az elküldött név+jelszó ellenőrzése + if ($action == 'changePassword') { + + if (file_exists('include/backend/'.$AUTH[$toPolicy]['backend'].'/password/changePassword.php')) { + require('include/backend/'.$AUTH[$toPolicy]['backend'].'/password/changePassword.php'); + } + + $newPassword = readVariable($_POST['newPassword'], 'emptystringnull'); + $verification = readVariable($_POST['verification'], 'emptystringnull'); + + if ($verification == '' or $newPassword == '') { + $_SESSION['alert'][] = 'message:empty_field'; + } elseif ($verification != $newPassword) { + $_SESSION['alert'][] = 'message:pw_not_match'; + } else { + + if (changePassword($userAccount, $newPassword, $toPolicy)) { + // Módosítsuk a bejelentkezett user eltárolt jelszavát? - hagyjuk inkább... legalább látja, hogy változott valami... + // updateSessionPassword($userAccount, $toPolicy, $verification); + } else { + $_SESSION['alert'][] = 'message:pw_change_failed'; + } + + } + + } // action + + } else { + $_SESSION['alert'][] = 'page:insufficient_access'; + } + +?> diff --git a/mayor-orig/www/policy/private/password/changePassword.php b/mayor-orig/www/policy/private/password/changePassword.php new file mode 100644 index 00000000..f95661e0 --- /dev/null +++ b/mayor-orig/www/policy/private/password/changePassword.php @@ -0,0 +1,9 @@ +<?php + + if (_RIGHTS_OK !== true) die(); + + global $userAccount, $toPolicy; + + putChangePasswordForm($userAccount, $toPolicy, true); // rögzített policy + +?> |