[pLog-svn] r997 - plog/trunk/class/action

ork at devel.plogworld.net ork at devel.plogworld.net
Tue Feb 8 14:46:09 GMT 2005


Author: ork
Date: 2005-02-08 14:46:09 +0000 (Tue, 08 Feb 2005)
New Revision: 997

Modified:
   plog/trunk/class/action/blogaction.class.php
Log:
userParam is not set.. thus there is whole if block that'll never be
executed.. fine with me :) the less code the better..


Modified: plog/trunk/class/action/blogaction.class.php
===================================================================
--- plog/trunk/class/action/blogaction.class.php	2005-02-08 14:20:11 UTC (rev 996)
+++ plog/trunk/class/action/blogaction.class.php	2005-02-08 14:46:09 UTC (rev 997)
@@ -147,21 +147,22 @@
             // "user" parameter.
             if( !$blogId && !$blogName ) {
             	// check if there was a user parameter
-                if( $userParam ) {
-                	// if so, check to which blogs the user belongs
-                	$users = new Users();
-                	$userInfo = $users->getUserInfoFromUsername( $userName );
-                    // if the user exists and is valid...
-                	if( $userInfo ) {
-                    	$userBlogs = $users->getUsersBlogs( $userInfo->getId());
-                        // check if he or she belogs to any blog. If he or she does, simply
-                        // get the first one (any better rule for this?)
-                    	if( !empty($userBlogs)) {
-	                		$blogId = $userBlogs[0]->getId();
-                        }
-                    }
-                }
-                else {
+                // TBD: remove all this code if really not needed..
+                // if( $userParam ) {
+                //	// if so, check to which blogs the user belongs
+                //	$users = new Users();
+                // 	$userInfo = $users->getUserInfoFromUsername( $userName );
+                //    // if the user exists and is valid...
+                //	if( $userInfo ) {
+                //    	$userBlogs = $users->getUsersBlogs( $userInfo->getId());
+                //        // check if he or she belogs to any blog. If he or she does, simply
+                //        // get the first one (any better rule for this?)
+                //    	if( !empty($userBlogs)) {
+	            //    		$blogId = $userBlogs[0]->getId();
+                //        }
+                //    }
+                //}
+                //else {
                     // if there is no user parameter, we take the blogId from the session
                     if( $this->_session->getValue('blogId') != '' ) {
                     	$blogId = $this->_session->getValue('blogId');
@@ -170,7 +171,7 @@
                         // get the default blog id from the database
                         $blogId = $this->_config->getValue('default_blog_id');                        
                     }
-                }
+                //}
             }
 			
             // fetch the BlogInfo object
@@ -234,4 +235,4 @@
 			return true;
 		}
     }
-?>
\ No newline at end of file
+?>




More information about the pLog-svn mailing list