1
0
Fork 0
mirror of https://github.com/dducret/kopano-webapp-passwd synced 2026-07-27 10:32:26 +02:00

Kopano DB only

Adapted to Kopano WebApp 3.3.0 for DB only, not tested/fixed for LDAP
This commit is contained in:
Denis Ducret 2017-02-14 15:54:15 +01:00
commit ded31bd8b7
2 changed files with 14 additions and 1 deletions

View file

@ -10,3 +10,7 @@
- Bug fixes for LDAP plugin
- Improved UI
## 1.3 (14th February 2017)
- Adapted to Kopano WebApp 3.3.0 for DB only, not tested/fixed for LDAP

View file

@ -199,6 +199,7 @@ class PasswdModule extends Module
$errorMessage = '';
$passwd = $data['new_password'];
/*
// get current session password
$sessionPass = $_SESSION['password'];
// if user has openssl module installed
@ -213,6 +214,10 @@ class PasswdModule extends Module
$sessionPass = $_SESSION['password'];
}
}
*/
// Get current user password
$encryptionStore = EncryptionStore::getInstance();
$sessionPass = $encryptionStore->get('password');
if($data['current_password'] === $sessionPass) {
if ($this->checkPasswordStrenth($passwd)) {
@ -223,6 +228,7 @@ class PasswdModule extends Module
if (mapi_zarafa_setuser($store, $userinfo['userid'], $data['username'], $userinfo['fullname'], $userinfo['emailaddress'], $passwd, 0, $userinfo['admin'])) {
// password changed successfully
/* Not able to find a way, session is discarded and user should log in again
// write new password to session because we don't want user to re-authenticate
session_start();
// if user has openssl module installed
@ -244,6 +250,9 @@ class PasswdModule extends Module
'display_message' => dgettext("plugin_passwd", 'Password is changed successfully.')
)
));
*/
// Give the session a new id
session_regenerate_id();
} else {
$errorMessage = dgettext("plugin_passwd", 'Password is not changed.');
}