diff --git a/system/modules/core/classes/FrontendUser.php b/system/modules/core/classes/FrontendUser.php
index 681c9e2a09..d9e75d3e0f 100644
--- a/system/modules/core/classes/FrontendUser.php
+++ b/system/modules/core/classes/FrontendUser.php
@@ -157,6 +157,18 @@ public function authenticate()
// Default authentication
if (parent::authenticate())
{
+ // Check if the user has to change the password
+ if ($this->pwChange)
+ {
+ // we are here because of the login module, do not logout
+ if (\Session::getInstance()->get('PASSWORD_CHANGE_REQUIRED'))
+ {
+ \Session::getInstance()->remove('PASSWORD_CHANGE_REQUIRED');
+ return false;
+ }
+ $this->logout();
+ $this->reload();
+ }
return true;
}
@@ -184,6 +196,7 @@ public function authenticate()
return false;
}
+ /* was called by parent */
$this->setUserFromDb();
// Last login date
diff --git a/system/modules/core/config/autoload.php b/system/modules/core/config/autoload.php
index fb005481bd..dab452ffcc 100644
--- a/system/modules/core/config/autoload.php
+++ b/system/modules/core/config/autoload.php
@@ -324,6 +324,7 @@
'mod_html' => 'system/modules/core/templates/modules',
'mod_login_1cl' => 'system/modules/core/templates/modules',
'mod_login_2cl' => 'system/modules/core/templates/modules',
+ 'mod_pwchange_1cl' => 'system/modules/core/templates/modules',
'mod_logout_1cl' => 'system/modules/core/templates/modules',
'mod_logout_2cl' => 'system/modules/core/templates/modules',
'mod_message' => 'system/modules/core/templates/modules',
diff --git a/system/modules/core/dca/tl_member.php b/system/modules/core/dca/tl_member.php
index 5bd780eac8..e8c3f57306 100644
--- a/system/modules/core/dca/tl_member.php
+++ b/system/modules/core/dca/tl_member.php
@@ -117,7 +117,7 @@
// Subpalettes
'subpalettes' => array
(
- 'login' => 'username,password',
+ 'login' => 'pwChange,username,password',
'assignDir' => 'homeDir'
),
@@ -305,7 +305,7 @@
'exclude' => true,
'filter' => true,
'inputType' => 'checkbox',
- 'eval' => array('submitOnChange'=>true),
+ 'eval' => array('submitOnChange'=>true, 'tl_class'=>'w50 clr'),
'sql' => "char(1) NOT NULL default ''"
),
'username' => array
@@ -316,7 +316,7 @@
'sorting' => true,
'flag' => 1,
'inputType' => 'text',
- 'eval' => array('mandatory'=>true, 'unique'=>true, 'rgxp'=>'extnd', 'nospace'=>true, 'maxlength'=>64, 'feEditable'=>true, 'feViewable'=>true, 'feGroup'=>'login'),
+ 'eval' => array('mandatory'=>true, 'unique'=>true, 'rgxp'=>'extnd', 'nospace'=>true, 'maxlength'=>64, 'feEditable'=>true, 'feViewable'=>true, 'feGroup'=>'login', 'tl_class'=>'w50 clr'),
'sql' => "varchar(64) COLLATE utf8_bin NOT NULL default ''"
),
'password' => array
@@ -331,6 +331,23 @@
),
'sql' => "varchar(128) NOT NULL default ''"
),
+ 'pwChange' => array
+ (
+ 'label' => &$GLOBALS['TL_LANG']['tl_member']['pwChange'],
+ 'exclude' => true,
+ 'inputType' => 'checkbox',
+ 'filter' => true,
+ 'sql' => "char(1) NOT NULL default ''",
+ 'eval' => array('tl_class'=>'w50')
+ ),
+ 'oldPasswords' => array
+ (
+ 'label' => &$GLOBALS['TL_LANG']['MSC']['oldpasswords'],
+ 'exclude' => true,
+ 'inputType' => 'none',
+ 'eval' => array('preserveTags'=>true, 'beEditable' => false, 'feEditable'=>false, 'feGroup'=>'login'),
+ 'sql' => "blob NULL"
+ ),
'assignDir' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_member']['assignDir'],
diff --git a/system/modules/core/dca/tl_module.php b/system/modules/core/dca/tl_module.php
index 0821e5e6de..41eb1aa1fa 100644
--- a/system/modules/core/dca/tl_module.php
+++ b/system/modules/core/dca/tl_module.php
@@ -113,7 +113,7 @@
'login' => '{title_legend},name,headline,type;{config_legend},autologin;{redirect_legend},jumpTo,redirectBack;{template_legend:hide},cols;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space',
'logout' => '{title_legend},name,headline,type;{redirect_legend},jumpTo,redirectBack;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space',
'personalData' => '{title_legend},name,headline,type;{config_legend},editable;{redirect_legend},jumpTo;{template_legend:hide},memberTpl,tableless;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space',
- 'registration' => '{title_legend},name,headline,type;{config_legend},editable,newsletters,disableCaptcha;{account_legend},reg_groups,reg_allowLogin,reg_assignDir;{redirect_legend},jumpTo;{email_legend:hide},reg_activate;{template_legend:hide},memberTpl,tableless;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space',
+ 'registration' => '{title_legend},name,headline,type;{config_legend},editable,newsletters,disableCaptcha;{account_legend},reg_groups,reg_allowLogin,reg_pwChange,reg_assignDir;{redirect_legend},jumpTo;{email_legend:hide},reg_activate;{template_legend:hide},memberTpl,tableless;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space',
'lostPassword' => '{title_legend},name,headline,type;{config_legend},reg_skipName,disableCaptcha;{redirect_legend},jumpTo;{email_legend:hide},reg_jumpTo,reg_password;{template_legend:hide},tableless;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space',
'closeAccount' => '{title_legend},name,headline,type;{config_legend},reg_close;{redirect_legend},jumpTo;{template_legend:hide},tableless;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space',
'form' => '{title_legend},name,headline,type;{include_legend},form;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space',
@@ -632,7 +632,8 @@
'label' => &$GLOBALS['TL_LANG']['tl_module']['reg_allowLogin'],
'exclude' => true,
'inputType' => 'checkbox',
- 'sql' => "char(1) NOT NULL default ''"
+ 'sql' => "char(1) NOT NULL default ''",
+ 'eval' => array('tl_class'=>'w50 clr')
),
'reg_skipName' => array
(
diff --git a/system/modules/core/languages/en/default.xlf b/system/modules/core/languages/en/default.xlf
index 47bc289d09..c663eaa269 100644
--- a/system/modules/core/languages/en/default.xlf
+++ b/system/modules/core/languages/en/default.xlf
@@ -1424,6 +1424,9 @@ This e-mail has been generated by Contao. You can not reply to it directly.
Please enter your username and password!
+
+ Please enter a password!
+
Confirmation
diff --git a/system/modules/core/languages/en/tl_member.xlf b/system/modules/core/languages/en/tl_member.xlf
index 3e402ce9fc..c6cc2a05e6 100644
--- a/system/modules/core/languages/en/tl_member.xlf
+++ b/system/modules/core/languages/en/tl_member.xlf
@@ -215,6 +215,12 @@
Activate/deactivate member ID %s
+
+ Password change required
+
+
+ Make the member change his password upon the next login.
+