diff options
| author | Christian Fowler <spider@viovio.com> | 2009-10-21 15:05:56 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2009-10-21 15:05:56 +0000 |
| commit | 84a7289b1fe6bd5c39bcd162953e66c9a07243e9 (patch) | |
| tree | ae448ee73d4e1d352a43200664d6c33ed8367cec | |
| parent | d671f8136cc57547355a03dfd847dea3a8decc33 (diff) | |
| download | users-84a7289b1fe6bd5c39bcd162953e66c9a07243e9.tar.gz users-84a7289b1fe6bd5c39bcd162953e66c9a07243e9.tar.bz2 users-84a7289b1fe6bd5c39bcd162953e66c9a07243e9.zip | |
make sure getUserInfo lookup has a real value
| -rw-r--r-- | BitUser.php | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/BitUser.php b/BitUser.php index 60a68b6..62a72e2 100644 --- a/BitUser.php +++ b/BitUser.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/BitUser.php,v 1.236 2009/10/20 20:03:32 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/BitUser.php,v 1.237 2009/10/21 15:05:56 spiderr Exp $ * * Lib for user administration, groups and permissions * This lib uses pear so the constructor requieres @@ -12,7 +12,7 @@ * All Rights Reserved. See below for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details * - * $Id: BitUser.php,v 1.236 2009/10/20 20:03:32 spiderr Exp $ + * $Id: BitUser.php,v 1.237 2009/10/21 15:05:56 spiderr Exp $ * @package users */ @@ -42,7 +42,7 @@ define( "ACCOUNT_DISABLED", -6 ); * Class that holds all information for a given user * * @author spider <spider@steelsun.com> - * @version $Revision: 1.236 $ + * @version $Revision: 1.237 $ * @package users * @subpackage BitUser */ @@ -1436,19 +1436,20 @@ class BitUser extends LibertyMime { function getUserInfo( $pUserMixed ) { $ret = NULL; if( is_array( $pUserMixed ) ) { - $val = current( $pUserMixed ); - if( !is_numeric( $val ) ) { - $col = "UPPER( uu.`".key( $pUserMixed )."` ) "; - $val = strtoupper( $val ); - } else { - $col = " uu.`".key( $pUserMixed )."` "; - if( $val > 0xFFFFFFFF ) { - // 32 bit overflow, set to zero to avoid fatal error in databases with 32 bit integer columns - $val = 0; + if( $val = current( $pUserMixed ) ) { + if( !is_numeric( $val ) ) { + $col = "UPPER( uu.`".key( $pUserMixed )."` ) "; + $val = strtoupper( $val ); + } else { + $col = " uu.`".key( $pUserMixed )."` "; + if( $val > 0xFFFFFFFF ) { + // 32 bit overflow, set to zero to avoid fatal error in databases with 32 bit integer columns + $val = 0; + } } + $query = "SELECT uu.* FROM `".BIT_DB_PREFIX."users_users` uu LEFT OUTER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON (lc.`content_id`=uu.`content_id`) WHERE $col = ?"; + $ret = $this->mDb->getRow( $query, array( $val )); } - $query = "SELECT uu.* FROM `".BIT_DB_PREFIX."users_users` uu LEFT OUTER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON (lc.`content_id`=uu.`content_id`) WHERE $col = ?"; - $ret = $this->mDb->getRow( $query, array( $val )); } return $ret; } |
