Index: install/english.lang
===================================================================
--- install/english.lang (revision 14318)
+++ install/english.lang (working copy)
@@ -65,7 +65,7 @@
<PHRASE Label="la_col_AdditionalPermissions" Module="Core" Type="1">QWRkaXRpb25hbA==</PHRASE>
<PHRASE Label="la_col_AdminInterfaceLang" Module="Core" Type="1">QWRtaW4gUHJpbWFyeQ==</PHRASE>
<PHRASE Label="la_col_AffectedItems" Module="Core" Type="1">QWZmZWN0ZWQgSXRlbXM=</PHRASE>
- <PHRASE Label="la_col_AltName" Module="Core" Type="1">QWx0IFZhbHVl</PHRASE>
+ <PHRASE Label="la_col_AltName" Module="Core" Type="1">QWx0IFZhbHVl</PHRASE>
<PHRASE Label="la_col_Bcc" Module="Core" Type="1">QmNj</PHRASE>
<PHRASE Label="la_col_BounceDate" Module="Core" Type="1">Qm91bmNlZCBPbg==</PHRASE>
<PHRASE Label="la_col_BounceInfo" Module="Core" Type="1">Qm91bmNlIEluZm8=</PHRASE>
@@ -189,7 +189,7 @@
<PHRASE Label="la_col_RuleType" Module="Core" Type="1">UnVsZSBUeXBl</PHRASE>
<PHRASE Label="la_col_RunInterval" Module="Core" Type="1">UnVuIEludGVydmFs</PHRASE>
<PHRASE Label="la_col_RunMode" Module="Core" Type="1">UnVuIE1vZGU=</PHRASE>
- <PHRASE Label="la_col_SearchTerm" Module="Core" Type="1">U2VhcmNoIFRlcm0=</PHRASE>
+ <PHRASE Label="la_col_SearchTerm" Module="Core" Type="1">U2VhcmNoIFRlcm0=</PHRASE>
<PHRASE Label="la_col_SendRetries" Module="Core" Type="1">QXR0ZW1wdHMg</PHRASE>
<PHRASE Label="la_col_SentOn" Module="Core" Type="1">U2VudCBPbg==</PHRASE>
<PHRASE Label="la_col_SentStatus" Module="Core" Type="1">U2VudA==</PHRASE>
@@ -291,6 +291,7 @@
<PHRASE Label="la_config_UseOutputCompression" Module="Core" Type="1">RW5hYmxlIEhUTUwgR1pJUCBjb21wcmVzc2lvbg==</PHRASE>
<PHRASE Label="la_config_UsePageHitCounter" Module="Core" Type="1">VXNlIFBhZ2VIaXQgY291bnRlcg==</PHRASE>
<PHRASE Label="la_config_UsePopups" Module="Core" Type="1">RWRpdGluZyBXaW5kb3cgU3R5bGU=</PHRASE>
+ <PHRASE Label="la_config_UserEmailActivationTimeout" Module="Core" Type="1">RW1haWwgYWN0aXZhdGlvbiBleHBpcmF0aW9uIHRpbWVvdXQgKGluIG1pbnV0ZXMp</PHRASE>
<PHRASE Label="la_config_UseSmallHeader" Module="Core" Type="1">VXNlIFNtYWxsIFNlY3Rpb24gSGVhZGVycw==</PHRASE>
<PHRASE Label="la_config_UseTemplateCompression" Module="Core" Type="1">Q29tcHJlc3MgQ29tcGlsZWQgUEhQIFRlbXBsYXRlcw==</PHRASE>
<PHRASE Label="la_config_UseToolbarLabels" Module="Core" Type="1">VXNlIFRvb2xiYXIgTGFiZWxz</PHRASE>
@@ -643,7 +644,7 @@
<PHRASE Label="la_fld_State" Module="Core" Type="1">U3RhdGU=</PHRASE>
<PHRASE Label="la_fld_StateCountry" Module="Core" Type="1">U3RhdGUgQ291bnRyeQ==</PHRASE>
<PHRASE Label="la_fld_Status" Module="Core" Type="1">U3RhdHVz</PHRASE>
- <PHRASE Label="la_fld_StopWord" Module="Core" Type="1">U3RvcCBXb3Jk</PHRASE>
+ <PHRASE Label="la_fld_StopWord" Module="Core" Type="1">U3RvcCBXb3Jk</PHRASE>
<PHRASE Label="la_fld_Subject" Module="Core" Type="1">U3ViamVjdA==</PHRASE>
<PHRASE Label="la_fld_SubmissionTime" Module="Core" Type="1">U3VibWl0dGVkIE9u</PHRASE>
<PHRASE Label="la_fld_SuggestedCorrection" Module="Core" Type="1">U3VnZ2VzdGVkIENvcnJlY3Rpb24=</PHRASE>
@@ -1013,7 +1014,7 @@
<PHRASE Label="la_prompt_socket_blocking_mode" Module="Core" Type="1">VXNlIG5vbi1ibG9ja2luZyBzb2NrZXQgbW9kZQ==</PHRASE>
<PHRASE Label="la_prompt_sqlquery" Module="Core" Type="1">U1FMIFF1ZXJ5Og==</PHRASE>
<PHRASE Label="la_prompt_sqlquery_header" Module="Core" Type="1">UGVyZm9ybSBTUUwgUXVlcnk=</PHRASE>
- <PHRASE Label="la_Prompt_Step_One" Module="Core" Type="1">U3RlcCBPbmU=</PHRASE>
+ <PHRASE Label="la_Prompt_Step_One" Module="Core" Type="1">U3RlcCBPbmU=</PHRASE>
<PHRASE Label="la_prompt_SumbissionTime" Module="Core" Type="1">U3VibWl0dGVkIE9u</PHRASE>
<PHRASE Label="la_prompt_syscache_enable" Module="Core" Type="1">RW5hYmxlIFRhZyBDYWNoaW5n</PHRASE>
<PHRASE Label="la_prompt_SystemFileSize" Module="Core" Type="1">VG90YWwgU2l6ZSBvZiBTeXN0ZW0gRmlsZXM=</PHRASE>
@@ -1168,7 +1169,7 @@
<PHRASE Label="la_tab_ShowAll" Module="Core" Type="1">U2hvdyBBbGw=</PHRASE>
<PHRASE Label="la_tab_ShowStructure" Module="Core" Type="1">U2hvdyBTdHJ1Y3R1cmU=</PHRASE>
<PHRASE Label="la_tab_Site_Structure" Module="Core" Type="1">V2Vic2l0ZSAmIENvbnRlbnQ=</PHRASE>
- <PHRASE Label="la_tab_Skins" Module="Core" Type="1">QWRtaW4gU2tpbnM=</PHRASE>
+ <PHRASE Label="la_tab_Skins" Module="Core" Type="1">QWRtaW4gU2tpbnM=</PHRASE>
<PHRASE Label="la_tab_Summary" Module="Core" Type="1">U3VtbWFyeQ==</PHRASE>
<PHRASE Label="la_tab_Sys_Config" Module="Core" Type="1">Q29uZmlndXJhdGlvbg==</PHRASE>
<PHRASE Label="la_tab_taglibrary" Module="Core" Type="1">VGFnIGxpYnJhcnk=</PHRASE>
@@ -1273,7 +1274,7 @@
<PHRASE Label="la_title_Adding_Phrase" Module="Core" Type="1">QWRkaW5nIFBocmFzZQ==</PHRASE>
<PHRASE Label="la_title_Adding_RelatedSearch_Keyword" Module="Core" Type="1">QWRkaW5nIEtleXdvcmQ=</PHRASE>
<PHRASE Label="la_title_Adding_Relationship" Module="Core" Type="1">QWRkaW5nIFJlbGF0aW9uc2hpcA==</PHRASE>
- <PHRASE Label="la_title_Adding_Review" Module="Core" Type="1">QWRkaW5nIENvbW1lbnQ=</PHRASE>
+ <PHRASE Label="la_title_Adding_Review" Module="Core" Type="1">QWRkaW5nIENvbW1lbnQ=</PHRASE>
<PHRASE Label="la_title_Adding_Theme" Module="Core" Type="1">QWRkaW5nIFRoZW1l</PHRASE>
<PHRASE Label="la_title_Adding_User" Module="Core" Type="1">QWRkaW5nIFVzZXI=</PHRASE>
<PHRASE Label="la_title_AdditionalPermissions" Module="Core" Type="1">QWRkaXRpb25hbCBQZXJtaXNzaW9ucw==</PHRASE>
@@ -1323,7 +1324,7 @@
<PHRASE Label="la_title_Editing_Phrase" Module="Core" Type="1">RWRpdGluZyBQaHJhc2U=</PHRASE>
<PHRASE Label="la_title_Editing_RelatedSearch_Keyword" Module="Core" Type="1">RWRpdGluZyBLZXl3b3Jk</PHRASE>
<PHRASE Label="la_title_Editing_Relationship" Module="Core" Type="1">RWRpdGluZyBSZWxhdGlvbnNoaXA=</PHRASE>
- <PHRASE Label="la_title_Editing_Review" Module="Core" Type="1">RWRpdGluZyBDb21tZW50</PHRASE>
+ <PHRASE Label="la_title_Editing_Review" Module="Core" Type="1">RWRpdGluZyBDb21tZW50</PHRASE>
<PHRASE Label="la_title_Editing_Theme" Module="Core" Type="1">RWRpdGluZyBUaGVtZQ==</PHRASE>
<PHRASE Label="la_title_Editing_User" Module="Core" Type="1">RWRpdGluZyBVc2Vy</PHRASE>
<PHRASE Label="la_title_EmailCommunication" Module="Core" Type="1">RS1tYWlsIENvbW11bmljYXRpb24=</PHRASE>
@@ -1362,7 +1363,7 @@
<PHRASE Label="la_title_New_ConfigSearch" Module="Core" Type="1">TmV3IEZpZWxk</PHRASE>
<PHRASE Label="la_title_New_Image" Module="Core" Type="1">TmV3IEltYWdl</PHRASE>
<PHRASE Label="la_title_New_Relationship" Module="Core" Type="1">TmV3IFJlbGF0aW9uc2hpcA==</PHRASE>
- <PHRASE Label="la_title_New_Review" Module="Core" Type="1">TmV3IENvbW1lbnQ=</PHRASE>
+ <PHRASE Label="la_title_New_Review" Module="Core" Type="1">TmV3IENvbW1lbnQ=</PHRASE>
<PHRASE Label="la_title_NoPermissions" Module="Core" Type="1">Tm8gUGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_title_Permissions" Module="Core" Type="1">UGVybWlzc2lvbnM=</PHRASE>
<PHRASE Label="la_title_Phrases" Module="Core" Type="1">TGFiZWxzICYgUGhyYXNlcw==</PHRASE>
@@ -1380,7 +1381,7 @@
<PHRASE Label="la_title_SiteDomains" Module="Core" Type="1">U2l0ZSBEb21haW5z</PHRASE>
<PHRASE Label="la_title_SpellingDictionary" Module="Core" Type="1">U3BlbGxpbmcgRGljdGlvbmFyeQ==</PHRASE>
<PHRASE Label="la_title_StopWords" Module="Core" Type="1">U3RvcCBXb3Jkcw==</PHRASE>
- <PHRASE Label="la_title_Structure" Module="Core" Type="1">U3RydWN0dXJlICYgRGF0YQ==</PHRASE>
+ <PHRASE Label="la_title_Structure" Module="Core" Type="1">U3RydWN0dXJlICYgRGF0YQ==</PHRASE>
<PHRASE Label="la_title_SystemTools" Module="Core" Type="1">U3lzdGVtIFRvb2xz</PHRASE>
<PHRASE Label="la_title_SystemToolsClearTemplatesCache" Module="Core" Type="1">Q2xlYXIgVGVtcGxhdGVzIENhY2hl</PHRASE>
<PHRASE Label="la_title_SystemToolsCommonlyUsedKeys" Module="Core" Type="1">Q29tbW9ubHkgVXNlZCBLZXlz</PHRASE>
@@ -1450,7 +1451,7 @@
<PHRASE Label="la_ToolTip_NewReview" Module="Core" Type="1">TmV3IENvbW1lbnQ=</PHRASE>
<PHRASE Label="la_ToolTip_NewSearchConfig" Module="Core" Type="1">TmV3IFNlYXJjaCBGaWVsZA==</PHRASE>
<PHRASE Label="la_ToolTip_NewSiteDomain" Module="Core" Type="1">TmV3IFNpdGUgRG9tYWlu</PHRASE>
- <PHRASE Label="la_ToolTip_NewStopWord" Module="Core" Type="1">TmV3IFN0b3AgV29yZA==</PHRASE>
+ <PHRASE Label="la_ToolTip_NewStopWord" Module="Core" Type="1">TmV3IFN0b3AgV29yZA==</PHRASE>
<PHRASE Label="la_ToolTip_NewTerm" Module="Core" Type="1">TmV3IFRlcm0=</PHRASE>
<PHRASE Label="la_ToolTip_newtheme" Module="Core" Type="1">TmV3IFRoZW1l</PHRASE>
<PHRASE Label="la_ToolTip_NewUser" Module="Core" Type="1">TmV3IFVzZXI=</PHRASE>
Index: install/install_data.sql
===================================================================
--- install/install_data.sql (revision 14318)
+++ install/install_data.sql (working copy)
@@ -103,6 +103,7 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Min_UserName', '3', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_text_min_username', 'text', '', '', 10.03, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Min_Password', '5', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_text_min_password', 'text', '', '', 10.04, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Users_AllowReset', '180', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_prompt_allow_reset', 'text', NULL, NULL, 10.05, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UserEmailActivationTimeout', '', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_config_UserEmailActivationTimeout', 'text', NULL, NULL, 10.051, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_Password_Auto', '0', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_password_auto', 'checkbox', '', '', 10.06, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_MembershipExpirationReminder', '10', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_MembershipExpirationReminder', 'text', NULL, '', 10.07, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'User_NewGroup', '13', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_users_new_group', 'select', NULL, '0=lu_none||<SQL+>SELECT GroupId as OptionValue, Name as OptionName FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>', 10.08, 0, 1, NULL);
Index: install/upgrades.sql
===================================================================
--- install/upgrades.sql (revision 14318)
+++ install/upgrades.sql (working copy)
@@ -2016,4 +2016,7 @@
'LA_FLD_SELECTORNAME'
);
-# ===== v 5.1.2 =====
\ No newline at end of file
+# ===== v 5.1.2 =====
+
+# ===== v 5.1.3-B1 =====
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UserEmailActivationTimeout', '', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_config_UserEmailActivationTimeout', 'text', NULL, NULL, 10.051, 0, 0, NULL);
\ No newline at end of file
Index: units/users/users_tag_processor.php
===================================================================
--- units/users/users_tag_processor.php (revision 14318)
+++ units/users/users_tag_processor.php (working copy)
@@ -104,7 +104,7 @@
$user_current_object =& $this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
/* @var $user_current_object UsersItem */
- $code_type = array_key_exists('code_type', $params) ? $params['code_type'] : 'forgot_password';
+ $code_type = isset($params['code_type']) ? $params['code_type'] : 'forgot_password';
$error_messages = Array (
'forgot_password' => Array (
@@ -120,14 +120,21 @@
if ($code_type == 'custom') {
// custom error messages are given directly in tag
- $error_messages['custom'] = Array (
+ $error_messages[$code_type] = Array (
'code_is_not_valid' => $params['error_invalid'],
'code_expired' => $params['error_expired'],
);
}
+ $expiration_timeouts = Array (
+ 'forgot_password' => 'config:Users_AllowReset',
+ 'activation' => 'config:UserEmailActivationTimeout',
+ 'custom' => '',
+ );
+
if (!$passed_key) {
$user_current_object->SetError('PwResetConfirm', 'code_is_not_valid', $error_messages[$code_type]['code_is_not_valid']);
+
return false;
}
@@ -136,20 +143,27 @@
$user_object->Load($passed_key, 'PwResetConfirm');
- if ($user_object->isLoaded()) {
- $expiration_time = $user_object->GetDBField('PwRequestTime') + 3600;
- if ($expiration_time > adodb_mktime()) {
- return true;
- } else {
- $user_current_object->SetError('PwResetConfirm', 'code_expired', $error_messages[$code_type]['code_expired']);
- return false;
- }
- }
- else {
+ if ( !$user_object->isLoaded() ) {
$user_current_object->SetError('PwResetConfirm', 'code_is_not_valid', $error_messages[$code_type]['code_is_not_valid']);
+
return false;
}
+ else {
+ $expiration_timeout = isset($params['expiration_timeout']) ? $params['expiration_timeout'] : $expiration_timeouts[$code_type];
+ if ( preg_match('/^config:(.*)$/', $expiration_timeout, $regs) ) {
+ $expiration_timeout = $this->Application->ConfigValue( $regs[1] );
+ }
+
+ if ( $expiration_timeout ) {
+ if ( $user_object->GetDBField('PwRequestTime') < strtotime('-' . $expiration_timeout . ' minutes') ) {
+ $user_current_object->SetError('PwResetConfirm', 'code_expired', $error_messages[$code_type]['code_expired']);
+
+ return false;
+ }
+ }
+ }
+
return true;
}