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

ork at devel.plogworld.net ork at devel.plogworld.net
Tue Feb 8 15:30:45 GMT 2005


Author: ork
Date: 2005-02-08 15:30:44 +0000 (Tue, 08 Feb 2005)
New Revision: 1005

Modified:
   plog/trunk/class/action/blogaction.class.php
Log:
solved the mystery of the userParam ;)


Modified: plog/trunk/class/action/blogaction.class.php
===================================================================
--- plog/trunk/class/action/blogaction.class.php	2005-02-08 15:16:03 UTC (rev 1004)
+++ plog/trunk/class/action/blogaction.class.php	2005-02-08 15:30:44 UTC (rev 1005)
@@ -147,22 +147,21 @@
             // "user" parameter.
             if( !$blogId && !$blogName ) {
             	// check if there was a user parameter
-                // 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( !empty($userName) ) {
+                	// 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');
@@ -171,7 +170,7 @@
                         // get the default blog id from the database
                         $blogId = $this->_config->getValue('default_blog_id');                        
                     }
-                //}
+                }
             }
 			
             // fetch the BlogInfo object




More information about the pLog-svn mailing list