Răsfoiți Sursa

#2967 2 new options to disable join/login form

RomanL 6 ani în urmă
părinte
comite
9d8047728a

+ 3 - 1
install/sql/system.sql

@@ -526,8 +526,10 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 (@iCategoryId, 'sys_account_reset_password_key_lifetime', '_adm_stg_cpt_option_sys_account_reset_password_key_lifetime', '259200', 'digit', '', '', '', 30),
 (@iCategoryId, 'sys_account_reset_password_redirect', '_adm_stg_cpt_option_sys_account_reset_password_redirect', 'home', 'select', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:35:"get_options_reset_password_redirect";s:5:"class";s:18:"BaseServiceAccount";}', '', '', 31),
-(@iCategoryId, 'sys_account_reset_password_redirect_custom', '_adm_stg_cpt_option_sys_account_reset_password_redirect_custom', '', 'digit', '', '', '', 32);
+(@iCategoryId, 'sys_account_reset_password_redirect_custom', '_adm_stg_cpt_option_sys_account_reset_password_redirect_custom', '', 'digit', '', '', '', 32),
 
+(@iCategoryId, 'sys_account_disable_login_form', '_adm_stg_cpt_option_sys_account_disable_login_form', '', 'checkbox', '', '', '', 34),
+(@iCategoryId, 'sys_account_disable_join_form', '_adm_stg_cpt_option_sys_account_disable_join_form', '', 'checkbox', '', '', '', 35);
 --
 -- CATEGORY: ACL
 --

+ 2 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -1395,6 +1395,8 @@
     <string name="_adm_stg_cpt_option_sys_account_limit_incorrect_login_attempts"><![CDATA[Max number of logins attempts (0 - no limit)]]></string>
     <string name="_adm_stg_cpt_option_sys_account_reset_password_key_lifetime"><![CDATA[Reset password key lifetime (in seconds)]]></string>
     <string name="_adm_stg_cpt_option_sys_account_reset_password_redirect"><![CDATA[Redirect after reset password to]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_disable_login_form"><![CDATA[Disable login form]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_disable_join_form"><![CDATA[Disable join form]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_reset_password_redirect_home"><![CDATA[Home page]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_reset_password_redirect_profile"><![CDATA[View profile page]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_reset_password_redirect_profile_edit"><![CDATA[Edit profile page]]></string>

+ 3 - 0
modules/boonex/russian/data/langs/system/ru.xml

@@ -1383,6 +1383,9 @@
     <string name="_adm_stg_cpt_option_value_sys_account_reset_password_redirect_profile_edit"><![CDATA[Страница редактирования профиля]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_reset_password_redirect_custom"><![CDATA[Пользовательская страница]]></string>
     <string name="_adm_stg_cpt_option_sys_account_reset_password_redirect_custom"><![CDATA[URL для перенаправления 'Пользовательская страница']]></string>
+    <string name="_adm_stg_cpt_option_sys_account_disable_login_form"><![CDATA[Скрыть форму авторизации]]></string>
+    <string name="_adm_stg_cpt_option_sys_account_disable_join_form"><![CDATA[Скрыть форму регистрации]]></string>
+  
 	<string name="_adm_stg_cpt_option_sys_acl_expire_notification_days"><![CDATA[За сколько дней до окончания членства оповестить пользователя об окончании (-1 = после окончания)]]></string>
 	<string name="_adm_stg_cpt_option_sys_acl_expire_notify_once"><![CDATA[Оповещать пользователей об окончании членства только одинажды (каждый день в противном случае)]]></string>
 	<string name="_adm_stg_cpt_option_sys_add_nofollow"><![CDATA[Добавить атрибут "nofollow" для внешних ссылок]]></string>

+ 5 - 1
template/scripts/BxBaseServiceAccount.php

@@ -72,7 +72,11 @@ class BxBaseServiceAccount extends BxDol
         if (!isset($aParams['no_auth_buttons']) || false === (bool)$aParams['no_auth_buttons'])
             $sAuth = BxDolService::call('system', 'member_auth_code', array(), 'TemplServiceLogin');
 
-        return $sAuth . $this->_oAccountForms->createAccountForm($aParams) . $sLoginText;
+        $sFormCode = '';
+        if (!(bool)getParam('sys_account_disable_join_form'))
+            $sFormCode = $this->_oAccountForms->createAccountForm($aParams);
+        
+        return $sAuth . $sFormCode . $sLoginText;
     }
 
     public function serviceAccountSettingsEmail ($iAccountId = false)

+ 3 - 1
template/scripts/BxBaseServiceLogin.php

@@ -162,7 +162,9 @@ class BxBaseServiceLogin extends BxDol
                 $oForm->aInputs['relocate']['value'] = BX_DOL_URL_ROOT;
         }
         
-        $sFormCode = $oForm->getCode();
+        $sFormCode = '';
+        if (!(bool)getParam('sys_account_disable_login_form'))
+            $sFormCode = $oForm->getCode();
 
         BxDolTemplate::getInstance()->addJs(array('jquery.form.min.js'));