AntonLV 6 yıl önce
ebeveyn
işleme
22355f6a20

+ 28 - 0
modules/base/profile/classes/BxBaseModProfileSearchResult.php

@@ -65,6 +65,34 @@ class BxBaseModProfileSearchResult extends BxBaseModGeneralSearchResult
         return $oTranscoder->getFileUrl($a[$sField]);      
     }
 
+    protected function _setAccountConfirmationConditions($aParams)
+    {
+        $sConfirmationType = getParam('sys_account_confirmation_type');
+        $bHideUnconfirmed = getParam('sys_account_hide_unconfirmed_accounts') == 'on';
+        if($sConfirmationType == BX_ACCOUNT_CONFIRMATION_NONE || !$bHideUnconfirmed) 
+            return;
+
+        $this->aCurrent['restriction'] = array_merge($this->aCurrent['restriction'], array(
+            'account_confirmed_email' => array('value' => '', 'field' => 'email_confirmed', 'operator' => '=', 'table' => 'sys_accounts'),
+            'account_confirmed_phone' => array('value' => '', 'field' => 'phone_confirmed', 'operator' => '=', 'table' => 'sys_accounts'),
+        ));
+
+        switch($sConfirmationType) {
+            case BX_ACCOUNT_CONFIRMATION_EMAIL:
+                $this->aCurrent['restriction']['account_confirmed_email']['value'] = 1;
+                break;
+
+            case BX_ACCOUNT_CONFIRMATION_PHONE:
+                $this->aCurrent['restriction']['account_confirmed_phone']['value'] = 1;
+                break;
+
+            case BX_ACCOUNT_CONFIRMATION_EMAIL_PHONE:
+                $this->aCurrent['restriction']['account_confirmed_email']['value'] = 1;
+                $this->aCurrent['restriction']['account_confirmed_phone']['value'] = 1;
+                break;
+        }
+    }
+
     protected function _setConnectionsConditions ($aParams)
     {
         $oConnection = isset($aParams['object']) ? BxDolConnection::getObjectInstance($aParams['object']) : false;

+ 5 - 3
modules/boonex/organizations/classes/BxOrgsSearchResult.php

@@ -31,12 +31,12 @@ class BxOrgsSearchResult extends BxBaseModGroupsSearchResult
             'ownFields' => array(),
             'searchFields' => array(),
             'restriction' => array(
-        		'account_id' => array('value' => '', 'field' => 'account_id', 'operator' => '='),
+                'account_id' => array('value' => '', 'field' => 'account_id', 'operator' => '='),
                 'perofileStatus' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
                 'perofileType' => array('value' => 'bx_organizations', 'field' => 'type', 'operator' => '='),
                 'owner' => array('value' => '', 'field' => 'author', 'operator' => '=', 'table' => 'bx_organizations_data'),
-        		'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>', 'table' => 'bx_organizations_data'),
-        		'online' => array('value' => '', 'field' => 'date', 'operator' => '>', 'table' => 'sys_sessions'),
+                'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>', 'table' => 'bx_organizations_data'),
+                'online' => array('value' => '', 'field' => 'date', 'operator' => '>', 'table' => 'sys_sessions'),
             ),
             'join' => array (
                 'profile' => array(
@@ -84,6 +84,8 @@ class BxOrgsSearchResult extends BxBaseModGroupsSearchResult
         $oJoinedProfile = null;
         $bProcessConditionsForPrivateContent = true;
 
+        $this->_setAccountConfirmationConditions($aParams);
+
         switch ($sMode) {
 
             case 'joined_entries':

+ 5 - 3
modules/boonex/persons/classes/BxPersonsSearchResult.php

@@ -25,12 +25,12 @@ class BxPersonsSearchResult extends BxBaseModProfileSearchResult
             'ownFields' => array(),
             'searchFields' => array(),
             'restriction' => array(
-        		'account_id' => array('value' => '', 'field' => 'account_id', 'operator' => '='),
+                'account_id' => array('value' => '', 'field' => 'account_id', 'operator' => '='),
                 'perofileStatus' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
                 'perofileType' => array('value' => 'bx_persons', 'field' => 'type', 'operator' => '='),
                 'owner' => array('value' => '', 'field' => 'author', 'operator' => '=', 'table' => 'bx_persons_data'),
-        		'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>', 'table' => 'bx_persons_data'),
-        		'online' => array('value' => '', 'field' => 'date', 'operator' => '>', 'table' => 'sys_sessions'),
+                'featured' => array('value' => '', 'field' => 'featured', 'operator' => '<>', 'table' => 'bx_persons_data'),
+                'online' => array('value' => '', 'field' => 'date', 'operator' => '>', 'table' => 'sys_sessions'),
             ),
             'join' => array (
                 'profile' => array(
@@ -75,6 +75,8 @@ class BxPersonsSearchResult extends BxBaseModProfileSearchResult
         $sSearchFields = getParam($CNF['PARAM_SEARCHABLE_FIELDS']);
         $this->aCurrent['searchFields'] = !empty($sSearchFields) ? explode(',', $sSearchFields) : '';
 
+        $this->_setAccountConfirmationConditions($aParams);
+
         switch ($sMode) {
 
             case 'connections':