[pLog-svn] r3912 - plog/trunk/class/action/admin

mark at devel.lifetype.net mark at devel.lifetype.net
Wed Aug 23 18:26:52 GMT 2006


Author: mark
Date: 2006-08-23 18:26:52 +0000 (Wed, 23 Aug 2006)
New Revision: 3912

Modified:
   plog/trunk/class/action/admin/adminaction.class.php
Log:
Fixed a bug that the same blog shows twice.

Modified: plog/trunk/class/action/admin/adminaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaction.class.php	2006-08-23 17:55:23 UTC (rev 3911)
+++ plog/trunk/class/action/admin/adminaction.class.php	2006-08-23 18:26:52 UTC (rev 3912)
@@ -84,11 +84,17 @@
 			// in case we're in "admin mode" (where administrators can log into anybody's blog), we should also
 			// display the current blog in the drop-down list on the top left corner, if only to make it clear to
 			// the user that this is another completely different blog
-            if( $this->_blogInfo ) {
-                if( $this->_blogInfo->getOwnerId() != $this->_userInfo->getId() &&
-                    $this->_userInfo->isSiteAdmin()) {
-                    $this->_userBlogs[] = $this->_blogInfo;
-                }
+            if( !empty( $this->_blogInfo ) && $this->_blogInfo->getOwnerId() != $this->_userInfo->getId() &&  $this->_userInfo->isSiteAdmin() ) {
+				$find = false;
+            	foreach( $this->_userBlogs as $userBlog ) {
+					if( $userBlog->getId() == $this->_blogInfo->getId() ) {
+						$find = true;
+			        }
+	            }
+	            
+			    if( !$find ) {
+			        $this->_userBlogs[] = $this->_blogInfo;
+			    }
             }
         }
 



More information about the pLog-svn mailing list