cvs: pear /LiveUser/Auth Common.php DB.php MDB.php MDB2.php PDO.php PEARAuth.php XML.php /LiveUser/Perm Complex.php Simple.php
/LiveUser/Perm/Storage DB.php MDB.php MDB2.php PDO.php

From: Date: Fri, 07 Apr 2006 22:20:57 +0000
Subject: cvs: pear /LiveUser/Auth Common.php DB.php MDB.php MDB2.php PDO.php PEARAuth.php XML.php /LiveUser/Perm Complex.php Simple.php
/LiveUser/Perm/Storage DB.php MDB.php MDB2.php PDO.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-39477@lists.php.net to get a copy of this message
lsmith Fri Apr 7 22:20:57 2006 UTC Modified files: /pear/LiveUser/Auth Common.php DB.php MDB.php MDB2.php PDO.php PEARAuth.php XML.php /pear/LiveUser/Perm Complex.php Simple.php /pear/LiveUser/Perm/Storage DB.php MDB.php MDB2.php PDO.php Log: - replace isset() with array_key_exists() where applicable

http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Auth/Common.php?r1=1.51&r2=1.52&diff_format=u Index: pear/LiveUser/Auth/Common.php diff -u pear/LiveUser/Auth/Common.php:1.51 pear/LiveUser/Auth/Common.php:1.52 --- pear/LiveUser/Auth/Common.php:1.51 Tue Mar 14 13:10:04 2006 +++ pear/LiveUser/Auth/Common.php Fri Apr 7 22:20:56 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: Common.php,v 1.51 2006/03/14 13:10:04 lsmith Exp $ + * @version CVS: $Id: Common.php,v 1.52 2006/04/07 22:20:56 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -480,11 +480,11 @@ */ function setExternalValues() { - if (isset($this->externalValues['keysToCheck']) + if (array_key_exists('keysToCheck', $this->externalValues) && is_array($this->externalValues['keysToCheck']) ) { foreach ($this->externalValues['keysToCheck'] as $keyToCheck) { - if (isset($this->externalValues['values'][$keyToCheck])) { + if (array_key_exists($keyToCheck, $this->externalValues['values'])) { $this->propertyValues['storedExternalValues'][$keyToCheck] = md5($this->externalValues['values'][$keyToCheck]); } @@ -501,12 +501,12 @@ */ function externalValuesMatch() { - if (isset($this->propertyValues['storedExternalValues']) + if (array_key_exists('storedExternalValues', $this->propertyValues) && is_array($this->propertyValues['storedExternalValues']) ) { foreach ($this->propertyValues['storedExternalValues'] as $keyToCheck => $storedValue) { // return false if any one of the stored values does not match the current value - if (!isset($this->externalValues['values'][$keyToCheck]) + if (!array_key_exists($keyToCheck, $this->externalValues['values']) || md5($this->externalValues['values'][$keyToCheck]) != $storedValue ) { return false; http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Auth/DB.php?r1=1.38&r2=1.39&diff_format=u Index: pear/LiveUser/Auth/DB.php diff -u pear/LiveUser/Auth/DB.php:1.38 pear/LiveUser/Auth/DB.php:1.39 --- pear/LiveUser/Auth/DB.php:1.38 Tue Mar 14 13:10:04 2006 +++ pear/LiveUser/Auth/DB.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: DB.php,v 1.38 2006/03/14 13:10:04 lsmith Exp $ + * @version CVS: $Id: DB.php,v 1.39 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -150,7 +150,7 @@ */ function _updateUserData() { - if (!isset($this->tables['users']['fields']['lastlogin'])) { + if (!array_key_exists('lastlogin', $this->tables['users']['fields'])) { return true; } http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Auth/MDB.php?r1=1.40&r2=1.41&diff_format=u Index: pear/LiveUser/Auth/MDB.php diff -u pear/LiveUser/Auth/MDB.php:1.40 pear/LiveUser/Auth/MDB.php:1.41 --- pear/LiveUser/Auth/MDB.php:1.40 Tue Mar 14 13:10:04 2006 +++ pear/LiveUser/Auth/MDB.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: MDB.php,v 1.40 2006/03/14 13:10:04 lsmith Exp $ + * @version CVS: $Id: MDB.php,v 1.41 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -162,7 +162,7 @@ */ function _updateUserData() { - if (!isset($this->tables['users']['fields']['lastlogin'])) { + if (!array_key_exists('lastlogin', $this->tables['users']['fields'])) { return true; } http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Auth/MDB2.php?r1=1.44&r2=1.45&diff_format=u Index: pear/LiveUser/Auth/MDB2.php diff -u pear/LiveUser/Auth/MDB2.php:1.44 pear/LiveUser/Auth/MDB2.php:1.45 --- pear/LiveUser/Auth/MDB2.php:1.44 Tue Mar 14 13:10:04 2006 +++ pear/LiveUser/Auth/MDB2.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: MDB2.php,v 1.44 2006/03/14 13:10:04 lsmith Exp $ + * @version CVS: $Id: MDB2.php,v 1.45 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -171,7 +171,7 @@ */ function _updateUserData() { - if (!isset($this->tables['users']['fields']['lastlogin'])) { + if (!array_key_exists('lastlogin', $this->tables['users']['fields'])) { return true; } http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Auth/PDO.php?r1=1.13&r2=1.14&diff_format=u Index: pear/LiveUser/Auth/PDO.php diff -u pear/LiveUser/Auth/PDO.php:1.13 pear/LiveUser/Auth/PDO.php:1.14 --- pear/LiveUser/Auth/PDO.php:1.13 Thu Mar 30 19:31:22 2006 +++ pear/LiveUser/Auth/PDO.php Fri Apr 7 22:20:57 2006 @@ -39,7 +39,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: PDO.php,v 1.13 2006/03/30 19:31:22 lsmith Exp $ + * @version CVS: $Id: PDO.php,v 1.14 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -170,7 +170,7 @@ */ function _updateUserData() { - if (!isset($this->tables['users']['fields']['lastlogin'])) { + if (!array_key_exists('lastlogin', $this->tables['users']['fields'])) { return true; } http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Auth/PEARAuth.php?r1=1.37&r2=1.38&diff_format=u Index: pear/LiveUser/Auth/PEARAuth.php diff -u pear/LiveUser/Auth/PEARAuth.php:1.37 pear/LiveUser/Auth/PEARAuth.php:1.38 --- pear/LiveUser/Auth/PEARAuth.php:1.37 Tue Mar 14 13:10:04 2006 +++ pear/LiveUser/Auth/PEARAuth.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: PEARAuth.php,v 1.37 2006/03/14 13:10:04 lsmith Exp $ + * @version CVS: $Id: PEARAuth.php,v 1.38 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -168,10 +168,10 @@ $this->propertyValues['auth_user_id'] = $this->pearAuth->getUsername(); $this->propertyValues['handle'] = $this->pearAuth->getUsername(); $this->propertyValues['passwd'] = $this->encryptPW($this->pearAuth->password); - if (!isset($this->tables['users']['fields']['is_active'])) { + if (!array_key_exists('is_active', $this->tables['users']['fields'])) { $this->propertyValues['is_active'] = true; } - if (!isset($this->tables['users']['fields']['lastlogin'])) { + if (!array_key_exists('lastlogin', $this->tables['users']['fields'])) { $this->propertyValues['lastlogin'] = null; } return true; http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Auth/XML.php?r1=1.42&r2=1.43&diff_format=u Index: pear/LiveUser/Auth/XML.php diff -u pear/LiveUser/Auth/XML.php:1.42 pear/LiveUser/Auth/XML.php:1.43 --- pear/LiveUser/Auth/XML.php:1.42 Tue Mar 14 13:10:04 2006 +++ pear/LiveUser/Auth/XML.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: XML.php,v 1.42 2006/03/14 13:10:04 lsmith Exp $ + * @version CVS: $Id: XML.php,v 1.43 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -139,6 +139,10 @@ */ function _updateUserData() { + if (!array_key_exists('lastlogin', $this->tables['users']['fields'])) { + return true; + } + $index = 0; foreach ($this->userObj->children as $value) { if ($value->name == $this->alias['lastlogin']) { @@ -211,7 +215,7 @@ $result = array(); $names = array_flip($this->alias); foreach ($user->children as $value) { - if (isset($names[$value->name])) { + if (array_key_exists($value->name, $names)) { $result[$names[$value->name]] = $value->content; } } http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Perm/Complex.php?r1=1.25&r2=1.26&diff_format=u Index: pear/LiveUser/Perm/Complex.php diff -u pear/LiveUser/Perm/Complex.php:1.25 pear/LiveUser/Perm/Complex.php:1.26 --- pear/LiveUser/Perm/Complex.php:1.25 Mon Feb 27 18:05:28 2006 +++ pear/LiveUser/Perm/Complex.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: Complex.php,v 1.25 2006/02/27 18:05:28 lsmith Exp $ + * @version CVS: $Id: Complex.php,v 1.26 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -58,7 +58,7 @@ * @package LiveUser * @author Lukas Smith <smith@pooteeweet.org> * @author Bjoern Kraus <krausbn@php.net> - * @version $Id: Complex.php,v 1.25 2006/02/27 18:05:28 lsmith Exp $ + * @version $Id: Complex.php,v 1.26 2006/04/07 22:20:57 lsmith Exp $ * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt * @version Release: @package_version@ @@ -101,7 +101,7 @@ foreach ($result as $val) { // only store the implied right if the right wasn't stored before // or if the level is higher - if (!isset($rightIds[$val['right_id']]) + if (!array_key_exists($val['right_id'], $rightIds) || $rightIds[$val['right_id']] < $val['right_level'] ) { $rightIds[$val['right_id']] = $val['right_level']; http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Perm/Simple.php?r1=1.39&r2=1.40&diff_format=u Index: pear/LiveUser/Perm/Simple.php diff -u pear/LiveUser/Perm/Simple.php:1.39 pear/LiveUser/Perm/Simple.php:1.40 --- pear/LiveUser/Perm/Simple.php:1.39 Tue Mar 14 13:10:04 2006 +++ pear/LiveUser/Perm/Simple.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: Simple.php,v 1.39 2006/03/14 13:10:04 lsmith Exp $ + * @version CVS: $Id: Simple.php,v 1.40 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -251,7 +251,7 @@ if (!$right_id || $this->perm_type > LIVEUSER_AREAADMIN_TYPE_ID) { return LIVEUSER_MAX_LEVEL; // If he does, look for the right in question. - } elseif (is_array($this->rights) && isset($this->rights[$right_id])) { + } elseif (is_array($this->rights) && array_key_exists($right_id, $this->rights)) { // We know the user has the right so the right level will be returned. return $this->rights[$right_id]; } http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Perm/Storage/DB.php?r1=1.32&r2=1.33&diff_format=u Index: pear/LiveUser/Perm/Storage/DB.php diff -u pear/LiveUser/Perm/Storage/DB.php:1.32 pear/LiveUser/Perm/Storage/DB.php:1.33 --- pear/LiveUser/Perm/Storage/DB.php:1.32 Tue Mar 14 13:10:04 2006 +++ pear/LiveUser/Perm/Storage/DB.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: DB.php,v 1.32 2006/03/14 13:10:04 lsmith Exp $ + * @version CVS: $Id: DB.php,v 1.33 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -69,7 +69,7 @@ * @package LiveUser * @author Lukas Smith <smith@pooteeweet.org> * @author Bjoern Kraus <krausbn@php.net> - * @version $Id: DB.php,v 1.32 2006/03/14 13:10:04 lsmith Exp $ + * @version $Id: DB.php,v 1.33 2006/04/07 22:20:57 lsmith Exp $ * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt * @version Release: @package_version@ @@ -239,7 +239,7 @@ GU.' . $this->alias['perm_user_id'] . ' = '. $this->dbc->quoteSmart($perm_user_id); - if (isset($this->tables['groups']['fields']['is_active'])) { + if (array_key_exists('is_active', $this->tables['groups']['fields'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . $this->dbc->quoteSmart(true); @@ -319,7 +319,7 @@ SG.' . $this->alias['subgroup_id'] . ' NOT IN ('. implode(', ', $group_ids).')'; - if (isset($this->tables['groups']['fields']['is_active'])) { + if (array_key_exists('is_active', $this->tables['groups']['fields'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . $this->dbc->quoteSmart(true); http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Perm/Storage/MDB.php?r1=1.31&r2=1.32&diff_format=u Index: pear/LiveUser/Perm/Storage/MDB.php diff -u pear/LiveUser/Perm/Storage/MDB.php:1.31 pear/LiveUser/Perm/Storage/MDB.php:1.32 --- pear/LiveUser/Perm/Storage/MDB.php:1.31 Tue Mar 14 13:10:04 2006 +++ pear/LiveUser/Perm/Storage/MDB.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: MDB.php,v 1.31 2006/03/14 13:10:04 lsmith Exp $ + * @version CVS: $Id: MDB.php,v 1.32 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -262,7 +262,7 @@ GU.' . $this->alias['perm_user_id'] . ' = '. $this->dbc->getValue($this->fields['perm_user_id'], $perm_user_id); - if (isset($this->tables['groups']['fields']['is_active'])) { + if (array_key_exists('is_active', $this->tables['groups']['fields'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . $this->dbc->getValue($this->fields['is_active'], true); @@ -346,7 +346,7 @@ SG.' . $this->alias['subgroup_id'] . ' NOT IN ('. implode(', ', $group_ids).')'; - if (isset($this->tables['groups']['fields']['is_active'])) { + if (array_key_exists('is_active', $this->tables['groups']['fields'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . $this->dbc->getValue($this->fields['is_active'], true); http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Perm/Storage/MDB2.php?r1=1.32&r2=1.33&diff_format=u Index: pear/LiveUser/Perm/Storage/MDB2.php diff -u pear/LiveUser/Perm/Storage/MDB2.php:1.32 pear/LiveUser/Perm/Storage/MDB2.php:1.33 --- pear/LiveUser/Perm/Storage/MDB2.php:1.32 Tue Mar 14 13:10:04 2006 +++ pear/LiveUser/Perm/Storage/MDB2.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: MDB2.php,v 1.32 2006/03/14 13:10:04 lsmith Exp $ + * @version CVS: $Id: MDB2.php,v 1.33 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -270,7 +270,7 @@ GU.' . $this->alias['perm_user_id'] . ' = '. $this->dbc->quote($perm_user_id, $this->fields['perm_user_id']); - if (isset($this->tables['groups']['fields']['is_active'])) { + if (array_key_exists('is_active', $this->tables['groups']['fields'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . $this->dbc->quote(true, $this->fields['is_active']); @@ -354,7 +354,7 @@ SG.' . $this->alias['subgroup_id'] . ' NOT IN ('. $this->dbc->datatype->implodeArray($group_ids, $this->fields['subgroup_id']).')'; - if (isset($this->tables['groups']['fields']['is_active'])) { + if (array_key_exists('is_active', $this->tables['groups']['fields'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . $this->dbc->quote(true, $this->fields['is_active']); http://cvs.php.net/viewcvs.cgi/pear/LiveUser/Perm/Storage/PDO.php?r1=1.11&r2=1.12&diff_format=u Index: pear/LiveUser/Perm/Storage/PDO.php diff -u pear/LiveUser/Perm/Storage/PDO.php:1.11 pear/LiveUser/Perm/Storage/PDO.php:1.12 --- pear/LiveUser/Perm/Storage/PDO.php:1.11 Mon Mar 27 10:02:52 2006 +++ pear/LiveUser/Perm/Storage/PDO.php Fri Apr 7 22:20:57 2006 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: PDO.php,v 1.11 2006/03/27 10:02:52 lsmith Exp $ + * @version CVS: $Id: PDO.php,v 1.12 2006/04/07 22:20:57 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -274,7 +274,7 @@ GU.' . $this->alias['perm_user_id'] . ' = '. $this->dbc->quote($perm_user_id); - if (isset($this->tables['groups']['fields']['is_active'])) { + if (array_key_exists('is_active', $this->tables['groups']['fields'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . $this->dbc->quote(true); @@ -363,7 +363,7 @@ SG.' . $this->alias['subgroup_id'] . ' NOT IN ('. implode(', ', $group_ids).')'; - if (isset($this->tables['groups']['fields']['is_active'])) { + if (array_key_exists('is_active', $this->tables['groups']['fields'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . $this->dbc->quote(true);
« previous php.pear.cvs (#39477) next »