mirror of
https://github.com/dducret/kopano-webapp-passwd
synced 2026-08-04 22:45:45 +02:00
At least destroy session to force user relogin
This commit is contained in:
parent
b1322106ee
commit
d5bbcd4625
1 changed files with 2 additions and 16 deletions
|
|
@ -139,28 +139,14 @@ class PasswdModule extends Module
|
||||||
if ($msg === "passwordchanged") {
|
if ($msg === "passwordchanged") {
|
||||||
// password changed successfully
|
// password changed successfully
|
||||||
|
|
||||||
// write new password to session because we don't want user to re-authenticate
|
|
||||||
session_start();
|
|
||||||
// if user has openssl module installed
|
|
||||||
if(function_exists("openssl_encrypt")) {
|
|
||||||
// In PHP 5.3.3 the iv parameter was added
|
|
||||||
if(version_compare(phpversion(), "5.3.3", "<")) {
|
|
||||||
$_SESSION['password'] = openssl_encrypt($passwd,"des-ede3-cbc",PASSWORD_KEY,0);
|
|
||||||
} else {
|
|
||||||
$_SESSION['password'] = openssl_encrypt($passwd,"des-ede3-cbc",PASSWORD_KEY,0,PASSWORD_IV);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$_SESSION['password'] = $passwd;
|
|
||||||
}
|
|
||||||
session_write_close();
|
|
||||||
|
|
||||||
// send feedback to client
|
// send feedback to client
|
||||||
$this->sendFeedback(true, array(
|
$this->sendFeedback(true, array(
|
||||||
'info' => array(
|
'info' => array(
|
||||||
'display_message' => dgettext("plugin_passwd", 'Password is changed successfully.')
|
'display_message' => dgettext("plugin_passwd", 'Password is changed successfully.')
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
WebAppSession::getInstance()->destroy();
|
||||||
|
header("Location: /");
|
||||||
} else {
|
} else {
|
||||||
$errorMessage = dgettext("plugin_passwd", 'Password is not changed. Error: ' . $msg);
|
$errorMessage = dgettext("plugin_passwd", 'Password is not changed. Error: ' . $msg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue