1
0
Fork 0
mirror of https://github.com/dducret/kopano-webapp-passwd synced 2026-07-27 18:42:47 +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

@ -9,4 +9,8 @@
## 1.2 (20th May 2015) ## 1.2 (20th May 2015)
- Bug fixes for LDAP plugin - Bug fixes for LDAP plugin
- Improved UI - 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 = ''; $errorMessage = '';
$passwd = $data['new_password']; $passwd = $data['new_password'];
/*
// get current session password // get current session password
$sessionPass = $_SESSION['password']; $sessionPass = $_SESSION['password'];
// if user has openssl module installed // if user has openssl module installed
@ -213,6 +214,10 @@ class PasswdModule extends Module
$sessionPass = $_SESSION['password']; $sessionPass = $_SESSION['password'];
} }
} }
*/
// Get current user password
$encryptionStore = EncryptionStore::getInstance();
$sessionPass = $encryptionStore->get('password');
if($data['current_password'] === $sessionPass) { if($data['current_password'] === $sessionPass) {
if ($this->checkPasswordStrenth($passwd)) { 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'])) { if (mapi_zarafa_setuser($store, $userinfo['userid'], $data['username'], $userinfo['fullname'], $userinfo['emailaddress'], $passwd, 0, $userinfo['admin'])) {
// password changed successfully // 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 // write new password to session because we don't want user to re-authenticate
session_start(); session_start();
// if user has openssl module installed // if user has openssl module installed
@ -244,6 +250,9 @@ class PasswdModule extends Module
'display_message' => dgettext("plugin_passwd", 'Password is changed successfully.') 'display_message' => dgettext("plugin_passwd", 'Password is changed successfully.')
) )
)); ));
*/
// Give the session a new id
session_regenerate_id();
} else { } else {
$errorMessage = dgettext("plugin_passwd", 'Password is not changed.'); $errorMessage = dgettext("plugin_passwd", 'Password is not changed.');
} }