AntonLV 6 ani în urmă
părinte
comite
3b2806af3d

+ 4 - 1
inc/classes/BxDolProfile.php

@@ -170,7 +170,10 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
      */
     public function isActive($iProfileId = false)
     {
-        return BX_PROFILE_STATUS_ACTIVE == $this->getStatus($iProfileId) && ($this->getAccountObject()->isConfirmed() || !getParam('sys_account_hide_unconfirmed_accounts'));
+        if($this->getStatus($iProfileId) != BX_PROFILE_STATUS_ACTIVE)
+            return false;
+
+        return (($oAccount = $this->getAccountObject()) !== false && $oAccount->isConfirmed()) || !getParam('sys_account_hide_unconfirmed_accounts');
     }
 
     /**

+ 9 - 6
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -2268,7 +2268,7 @@ class BxBaseModGeneralModule extends BxDolModule
     	return bx_get_logged_profile_id();
     }
 
-	public function getProfileInfo($iUserId = 0)
+    public function getProfileInfo($iUserId = 0)
     {
         $oProfile = $this->getObjectUser($iUserId);
 
@@ -2277,16 +2277,19 @@ class BxBaseModGeneralModule extends BxDolModule
             $oAccount = $oProfile->getAccountObject();
         $bAccount = !empty($oAccount);
 
+        if(!$bAccount)
+            $oProfile = BxDolProfileUndefined::getInstance();
+
         return array(
-        	'id' => $oProfile->id(),
+            'id' => $oProfile->id(),
             'name' => $oProfile->getDisplayName(),
-        	'email' => $bAccount ? $oAccount->getEmail() : '',
+            'email' => $bAccount ? $oAccount->getEmail() : '',
             'link' => $oProfile->getUrl(),
             'icon' => $oProfile->getIcon(),
-        	'thumb' => $oProfile->getThumb(),
-        	'avatar' => $oProfile->getAvatar(),
+            'thumb' => $oProfile->getThumb(),
+            'avatar' => $oProfile->getAvatar(),
             'unit' => $oProfile->getUnit(),
-        	'active' => $oProfile->isActive(),
+            'active' => $oProfile->isActive(),
         );
     }