Просмотр исходного кода

#2942 Nexus: option to disable custom login form on mobile

Alex Trofimov 6 лет назад
Родитель
Сommit
dbbced46d3

+ 1 - 1
modules/boonex/nexus/classes/BxNexusAlerts.php

@@ -19,7 +19,7 @@ class BxNexusAlerts extends BxDolAlertsResponse
 
     public function response($o)
     {
-        if ('system' == $o->sUnit && 'page_output' == $o->sAction && 'sys_home' == $o->aExtras['page_name'] && !isLogged() && false !== strpos($_SERVER['HTTP_USER_AGENT'], 'UNAMobileApp')) {
+        if (getParam('bx_nexus_option_custom_homepage') && 'system' == $o->sUnit && 'page_output' == $o->sAction && 'sys_home' == $o->aExtras['page_name'] && !isLogged() && false !== strpos($_SERVER['HTTP_USER_AGENT'], 'UNAMobileApp')) {
 
             // require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
     

+ 1 - 0
modules/boonex/nexus/install/langs/en.xml

@@ -8,6 +8,7 @@
     <string name="_bx_nexus_adm_stg_cpt_category_general"><![CDATA[General]]></string>
     <string name="_bx_nexus_option_styles"><![CDATA[Custom CSS styles for mobile apps]]></string>
     <string name="_bx_nexus_option_guest_pages"><![CDATA[Comma separated list of pages URIs, which are avalilable for guests]]></string>
+    <string name="_bx_nexus_option_custom_homepage"><![CDATA[Display custom homepage with login form only]]></string>
 
 	<string name="_bx_nexus_information"><![CDATA[Information]]></string>
     <string name="_bx_nexus_information_block"><![CDATA[This module adds neccesary styles and functionalty for proper functionality of UNA Nexus apps. Installing this module isn't enough, you need to get source code of mobile apps then modify them for your needs then publish in Google and Apple stores.]]></string>

+ 2 - 1
modules/boonex/nexus/install/sql/enable.sql

@@ -12,7 +12,8 @@ SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
 ('bx_nexus_option_styles', '', @iCategId, '_bx_nexus_option_styles', 'text', '', '', '', 10),
-('bx_nexus_option_guest_pages', 'forgot-password,create-account,terms,privacy,contact,about,home', @iCategId, '_bx_nexus_option_guest_pages', 'text', '', '', '', 20);
+('bx_nexus_option_guest_pages', 'forgot-password,create-account,terms,privacy,contact,about,home', @iCategId, '_bx_nexus_option_guest_pages', 'text', '', '', '', 20),
+('bx_nexus_option_custom_homepage', 'on', @iCategId, '_bx_nexus_option_custom_homepage', 'checkbox', '', '', '', 30);
 
 -- Injections