[pLog-svn] r2297 - plog/branches/plog-1.0.2/class/action

jondaley at devel.plogworld.net jondaley at devel.plogworld.net
Sat Jul 9 14:05:10 GMT 2005


Author: jondaley
Date: 2005-07-09 14:05:09 +0000 (Sat, 09 Jul 2005)
New Revision: 2297

Modified:
   plog/branches/plog-1.0.2/class/action/defaultaction.class.php
Log:
fixes typo, and removes a query if given a userid and username, and arbitrarily gives preference to the userId.  http://bugs.plogworld.net/view.php?id=629

Modified: plog/branches/plog-1.0.2/class/action/defaultaction.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/action/defaultaction.class.php	2005-07-09 13:59:50 UTC (rev 2296)
+++ plog/branches/plog-1.0.2/class/action/defaultaction.class.php	2005-07-09 14:05:09 UTC (rev 2297)
@@ -114,7 +114,7 @@
             // if we got a user user id, then we should first look up this id
             // user in the database and see if it exists
             if( $this->_userId > 0) {
-                $user = $users->getUserInfoFromId( $this->_userName );
+                $user = $users->getUserInfoFromId( $this->_userId );
                 if( !$user ) {
                     $this->_view = new ErrorView( $this->_blogInfo );
                     $this->_view->setValue( 'message', 'error_incorrect_user_id' );
@@ -122,11 +122,10 @@
                     return false;
                 }
             } 
-
-            // if we got a user name instead of a user id, then we
-            // should first look up this user in the database and see if
-            // it exists
-            if( $this->_userName ) {
+            else if( $this->_userName ) {
+                    // if we got a user name instead of a user id, then we
+                    // should first look up this user in the database and see if
+                    // it exists
                 $user = $users->getUserInfoFromUsername( $this->_userName );
                 if( !$user ) {
                     $this->_view = new ErrorView( $this->_blogInfo );




More information about the pLog-svn mailing list