Browse Source

Merge branch 'master' of https://github.com/unaio/una

AntonLV 2 years ago
parent
commit
a4c284b3b2

+ 42 - 40
inc/classes/BxDolAccount.php

@@ -858,52 +858,54 @@ class BxDolAccount extends BxDolFactory implements iBxDolSingleton
         $iTime = time() - getParam('sys_account_accounts_pruning_interval') * 86400;
         $oAccountQuery = BxDolAccountQuery::getInstance();
         $aAccounts = [];
+        $aAccountsSuspend = [];
         $bSuspend = false;
-        
-        switch(getParam('sys_account_accounts_pruning')) {
- 
-            case 'no_login_delete':
-                $aAccounts = $oAccountQuery->getAccountsForPruning('no_login', $iTime);   
-                break;
-            
-            case 'no_login_suspend':
-                $bSuspend = true;
-                $aAccounts = $oAccountQuery->getAccountsForPruning('no_login', $iTime);   
-                break;  
-                
-    		case 'no_confirm_delete':
-                $aAccounts = $oAccountQuery->getAccountsForPruning('no_confirm', $iTime);
-                foreach ($aAccounts as $k => $aAccount) {
-                    $oAccount = BxDolAccount::getInstance($aAccount['id']);
-                    if($oAccount->isConfirmed()){
-                        unset($aAccounts[$k]);
+        $aPruning = explode(',', getParam('sys_account_accounts_pruning'));
+        foreach ($aPruning as $sPruning) {
+            switch($sPruning) {
+                 case 'no_login_suspend':
+                    $aAccountsSuspend = $oAccountQuery->getAccountsForPruning('no_login', $iTime);   
+                    break;  
+
+                case 'no_login_delete':
+                    $aAccounts = array_merge($aAccounts, $oAccountQuery->getAccountsForPruning('no_login', $iTime));   
+                    break;
+
+
+
+                case 'no_confirm_delete':
+                    $aAccounts1 = $oAccountQuery->getAccountsForPruning('no_confirm', $iTime);
+                    foreach ($aAccounts1 as $k => $aAccount) {
+                        $oAccount = BxDolAccount::getInstance($aAccount['id']);
+                        if($oAccount->isConfirmed()){
+                            unset($aAccounts1[$k]);
+                        }
                     }
-                }
-                break;
-                
-            case 'no_profile_delete':
-                $aAccounts = $oAccountQuery->getAccountsForPruning('no_profile', $iTime);
-                break;
-        }
+                    $aAccounts = array_merge($aAccounts, $aAccounts1);   
+                    break;
 
-        if ($bSuspend){
-            foreach ($aAccounts as $k => $aAccount) {
-                $oAccount = BxDolAccount::getInstance($aAccount['id']);
-                $oProfile = BxDolProfile::getInstanceAccountProfile($aAccount['id']);
-                $oProfile->suspend(BX_PROFILE_ACTION_AUTO, 0 ,false);
-                $aProfiles = $oAccount->getProfiles();
-                foreach($aProfiles as $aProfile){
-                    BxDolProfile::getInstance($aProfile['id'])->suspend(BX_PROFILE_ACTION_AUTO, 0 ,false);
-                }
-                $iCount++;
+                case 'no_profile_delete':
+                    $aAccounts = array_merge($aAccounts, $aAccounts = $oAccountQuery->getAccountsForPruning('no_profile', $iTime));
+                    break;
             }
         }
-        else{
-            foreach ($aAccounts as $k => $aAccount) {
-                $oAccount = BxDolAccount::getInstance($aAccount['id']);
-                $oAccount->delete(false);
-                $iCount++;
+        
+        foreach ($aAccountsSuspend as $k => $aAccount) {
+            $oAccount = BxDolAccount::getInstance($aAccount['id']);
+            $oProfile = BxDolProfile::getInstanceAccountProfile($aAccount['id']);
+            $oProfile->suspend(BX_PROFILE_ACTION_AUTO, 0 ,false);
+            $aProfiles = $oAccount->getProfiles();
+            foreach($aProfiles as $aProfile){
+                BxDolProfile::getInstance($aProfile['id'])->suspend(BX_PROFILE_ACTION_AUTO, 0 ,false);
             }
+            $iCount++;
+        }
+
+        
+        foreach ($aAccounts as $k => $aAccount) {
+            $oAccount = BxDolAccount::getInstance($aAccount['id']);
+            $oAccount->delete(false);
+            $iCount++;
         }
 
         return $iCount;

+ 2 - 0
inc/classes/BxDolMetatags.php

@@ -240,6 +240,8 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
             }
         }
 
+        $aValues = array_slice($aValues, 0, (int)getParam('sys_profiles_search_limit'));
+        
         return $aValues;
     }
 

+ 1 - 1
inc/classes/BxDolProfile.php

@@ -164,7 +164,7 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
             $oProfile = $mixedProfileId;
 
         $iId = $oProfile->id();
-        $oAccount = $oProfile->getAccountObject();
+        $oAccount = BxDolAccount::getInstance(getLoggedId());
 
         $aMembershipInfo = BxDolAcl::getInstance()->getMemberMembershipInfo($iId);
 

+ 1 - 0
inc/profiles.inc.php

@@ -239,6 +239,7 @@ function bx_check_password($sLogin, $sPassword, $iRole = BX_DOL_ROLE_MEMBER)
 		if (bx_is_api()){
             return [strip_tags(_t("_sys_txt_login_locked", bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'))),''), bx_api_get_relative_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'))];
         }
+        return _t("_sys_txt_login_locked", bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')));
 	}
 
     $aAccountInfo = $oAccount->getInfo();

+ 1 - 1
install/sql/system.sql

@@ -633,7 +633,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 (@iCategoryId, 'sys_account_allow_plus_in_email', '_adm_stg_cpt_option_sys_allow_plus_in_email', 'on', 'checkbox', '', '', '', 50),
 
-(@iCategoryId, 'sys_account_accounts_pruning', '_adm_stg_cpt_option_sys_accounts_pruning', 'no', 'select', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:28:"get_options_pruning_interval";s:5:"class";s:18:"BaseServiceAccount";}', '', '', 55),
+(@iCategoryId, 'sys_account_accounts_pruning', '_adm_stg_cpt_option_sys_accounts_pruning', '', 'list', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:28:"get_options_pruning_interval";s:5:"class";s:18:"BaseServiceAccount";}', '', '', 55),
 (@iCategoryId, 'sys_account_accounts_pruning_interval', '_adm_stg_cpt_option_sys_accounts_pruning_interval', '0', 'digit', '', '', '', 56),
 (@iCategoryId, 'sys_account_accounts_password_log_count', '_adm_stg_cpt_option_sys_accounts_password_log_count', '0', 'digit', '', '', '', 57),
 (@iCategoryId, 'sys_account_accounts_force_password_change_after_expiration', '_adm_stg_cpt_option_sys_accounts_force_password_change_after_expiration', '', 'checkbox', '', '', '', 58),

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

@@ -1576,7 +1576,6 @@
     
     <string name="_adm_stg_cpt_option_sys_lock_from_unauthenticated"><![CDATA[Lock site from unauthenticated users]]></string>
     <string name="_adm_stg_cpt_option_sys_lock_from_unauthenticated_exceptions"><![CDATA[Comma separated list of pages URIs, which are avalilable for unauthenticated users]]></string>
-    <string name="_adm_stg_cpt_option_value_sys_account_pruning_no"><![CDATA[No pruning]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_pruning_no_login_delete"><![CDATA[Delete accounts with no login within N days]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_pruning_no_login_suspend"><![CDATA[Suspend accounts with no login within N days]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_pruning_no_confirm_delete"><![CDATA[Delete accounts which didn't confirm email within N days]]></string>

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

@@ -1557,7 +1557,6 @@
     <string name="_adm_stg_cpt_option_sys_accounts_force_password_change_after_expiration"><![CDATA[Принудительная смена пароля после истечения срока действия пароля]]></string>
     <string name="_adm_stg_cpt_option_sys_lock_from_unauthenticated"><![CDATA[Заблокировать сайт от неавторизованных пользователей]]></string>
     <string name="_adm_stg_cpt_option_sys_lock_from_unauthenticated_exceptions"><![CDATA[Cписок URI страниц (разделенный запятыми), которые доступны для неавторизованных пользователей]]></string>
-    <string name="_adm_stg_cpt_option_value_sys_account_pruning_no"><![CDATA[Не удалять]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_pruning_no_login_delete"><![CDATA[Удалить учетные записи без входа в течение N дней]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_pruning_no_login_suspend"><![CDATA[Приостановить учетные записи без входа в систему на N дней]]></string>
     <string name="_adm_stg_cpt_option_value_sys_account_pruning_no_confirm_delete"><![CDATA[Удалить учетные записи, которые не подтверждали электронную почту в течение N дней]]></string>

+ 8 - 0
modules/boonex/timeline/classes/BxTimelinePageViewItem.php

@@ -29,6 +29,14 @@ class BxTimelinePageViewItem extends BxTemplPage
 
         $this->_iItemId = $iItemId;
     }
+    
+    protected function _isAvailablePage ($a)
+    {
+        if (!$this->_iItemId)
+            return false;
+
+        return parent::_isAvailablePage($a);
+    }
 
     public function getCode()
     {

+ 3 - 0
template/css/general.css

@@ -680,4 +680,7 @@ video.bx-player-embed {
 
 .bx-cont-ph-inline {
     display:inline-block;
+}
+.bx-embeded-image{
+    display: none;
 }

+ 1 - 1
template/scripts/BxBaseServiceAccount.php

@@ -508,7 +508,7 @@ class BxBaseServiceAccount extends BxDol
     {
         $aResult = array();
 
-        $aChoices = array('no', 'no_login_delete', 'no_login_suspend', 'no_confirm_delete', 'no_profile_delete');
+        $aChoices = array('no_login_delete', 'no_login_suspend', 'no_confirm_delete', 'no_profile_delete');
         foreach($aChoices as $sChoice) 
             $aResult[] = array('key' => $sChoice, 'value' => _t('_adm_stg_cpt_option_value_sys_account_pruning_' . $sChoice));