cvs: pear /LiveUser/Perm/Storage MDB.php MDB2.php

From: Date: Mon, 15 Aug 2005 12:25:46 +0000
Subject: cvs: pear /LiveUser/Perm/Storage MDB.php MDB2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-33982@lists.php.net to get a copy of this message
lsmith Mon Aug 15 08:25:46 2005 EDT Modified files: /pear/LiveUser/Perm/Storage MDB.php MDB2.php Log: - do not alias field name when fetching the field type from fields

http://cvs.php.net/diff.php/pear/LiveUser/Perm/Storage/MDB.php?r1=1.17&r2=1.18&ty=u Index: pear/LiveUser/Perm/Storage/MDB.php diff -u pear/LiveUser/Perm/Storage/MDB.php:1.17 pear/LiveUser/Perm/Storage/MDB.php:1.18 --- pear/LiveUser/Perm/Storage/MDB.php:1.17 Mon Aug 15 06:32:51 2005 +++ pear/LiveUser/Perm/Storage/MDB.php Mon Aug 15 08:25:45 2005 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2005 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: MDB.php,v 1.17 2005/08/15 10:32:51 lsmith Exp $ + * @version CVS: $Id: MDB.php,v 1.18 2005/08/15 12:25:45 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -139,14 +139,14 @@ '.$this->prefix.$this->alias['perm_users'].' WHERE ' . $this->alias['auth_user_id'] . ' = '. - $this->dbc->getValue($this->fields[$this->alias['auth_user_id']], $auth_user_id).' + $this->dbc->getValue($this->fields['auth_user_id'], $auth_user_id).' AND ' . $this->alias['auth_container_name'] . ' = '. - $this->dbc->getValue($this->fields[$this->alias['auth_container_name']], $containerName); + $this->dbc->getValue($this->fields['auth_container_name'], $containerName); $types = array( - $this->fields[$this->alias['perm_user_id']], - $this->fields[$this->alias['perm_type']] + $this->fields['perm_user_id'], + $this->fields['perm_type'] ); $result = $this->dbc->queryRow($query, $types, MDB_FETCHMODE_ASSOC); @@ -184,11 +184,11 @@ R.' . $this->alias['right_id'] . ' = U.' . $this->alias['right_id'] . ' AND U.' . $this->alias['perm_user_id'] . ' = '. - $this->dbc->getValue($this->fields[$this->alias['perm_user_id']], $perm_user_id); + $this->dbc->getValue($this->fields['perm_user_id'], $perm_user_id); $types = array( - $this->fields[$this->alias['right_id']], - $this->fields[$this->alias['right_level']] + $this->fields['right_id'], + $this->fields['right_level'] ); $result = $this->dbc->queryAll($query, $types, MDB_FETCHMODE_ORDERED, true); @@ -223,11 +223,11 @@ AAA.area_id = R.area_id AND AAA.' . $this->alias['perm_user_id'] . ' = '. - $this->dbc->getValue($this->fields[$this->alias['perm_user_id']], $perm_user_id); + $this->dbc->getValue($this->fields['perm_user_id'], $perm_user_id); $types = array( - $this->fields[$this->alias['right_id']], - $this->fields[$this->alias['right_level']] + $this->fields['right_id'], + $this->fields['right_level'] ); $result = $this->dbc->queryAll($query, $types, MDB_FETCHMODE_ORDERED, true); @@ -263,15 +263,15 @@ GU.' . $this->alias['group_id'] . ' = G. ' . $this->alias['group_id'] . ' AND GU.' . $this->alias['perm_user_id'] . ' = '. - $this->dbc->getValue($this->fields[$this->alias['perm_user_id']], $perm_user_id); + $this->dbc->getValue($this->fields['perm_user_id'], $perm_user_id); if (isset($this->tables['groups']['fields']['is_active'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . - $this->dbc->getValue($this->fields[$this->alias['is_active']], true); + $this->dbc->getValue($this->fields['is_active'], true); } - $result = $this->dbc->queryCol($query, $this->fields[$this->alias['group_id']]); + $result = $this->dbc->queryCol($query, $this->fields['group_id']); if (PEAR::isError($result)) { $this->_stack->push(LIVEUSER_ERROR, 'exception', array(), @@ -309,8 +309,8 @@ GR.' . $this->alias['right_id'] . ''; $types = array( - $this->fields[$this->alias['right_id']], - $this->fields[$this->alias['right_level']] + $this->fields['right_id'], + $this->fields['right_level'] ); $result = $this->dbc->queryAll($query, $types, MDB_FETCHMODE_ORDERED, true); @@ -353,10 +353,10 @@ if (isset($this->tables['groups']['fields']['is_active'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . - $this->dbc->getValue($this->fields[$this->alias['is_active']], true); + $this->dbc->getValue($this->fields['is_active'], true); } - $result = $this->dbc->queryCol($query, $this->fields[$this->alias['group_id']]); + $result = $this->dbc->queryCol($query, $this->fields['group_id']); if (PEAR::isError($result)) { $this->_stack->push(LIVEUSER_ERROR, 'exception', array(), @@ -393,11 +393,11 @@ implode(', ', array_keys($rightIds)).') AND R.' . $this->alias['has_implied'] . '='. - $this->dbc->getValue($this->fields[$this->alias['has_implied']], true); + $this->dbc->getValue($this->fields['has_implied'], true); $types = array( - $this->fields[$this->alias['right_level']], - $this->fields[$this->alias['right_id']], + $this->fields['right_level'], + $this->fields['right_id'], ); $result = $this->dbc->queryAll($query, $types, MDB_FETCHMODE_ORDERED, true, false, true); @@ -436,9 +436,9 @@ implode(', ', $currentRights).')'; $types = array( - $this->fields[$this->alias['right_id']], - $this->fields[$this->alias['right_level']], - $this->fields[$this->alias['has_implied']] + $this->fields['right_id'], + $this->fields['right_level'], + $this->fields['has_implied'] ); $result = $this->dbc->queryAll($query, $types, MDB_FETCHMODE_ASSOC); http://cvs.php.net/diff.php/pear/LiveUser/Perm/Storage/MDB2.php?r1=1.17&r2=1.18&ty=u Index: pear/LiveUser/Perm/Storage/MDB2.php diff -u pear/LiveUser/Perm/Storage/MDB2.php:1.17 pear/LiveUser/Perm/Storage/MDB2.php:1.18 --- pear/LiveUser/Perm/Storage/MDB2.php:1.17 Mon Aug 15 06:32:51 2005 +++ pear/LiveUser/Perm/Storage/MDB2.php Mon Aug 15 08:25:45 2005 @@ -40,7 +40,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2005 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: MDB2.php,v 1.17 2005/08/15 10:32:51 lsmith Exp $ + * @version CVS: $Id: MDB2.php,v 1.18 2005/08/15 12:25:45 lsmith Exp $ * @link http://pear.php.net/LiveUser */ @@ -140,14 +140,14 @@ '.$this->prefix.$this->alias['perm_users'].' WHERE ' . $this->alias['auth_user_id'] . ' = '. - $this->dbc->quote($auth_user_id, $this->fields[$this->alias['auth_user_id']]).' + $this->dbc->quote($auth_user_id, $this->fields['auth_user_id']).' AND ' . $this->alias['auth_container_name'] . ' = '. - $this->dbc->quote($containerName, $this->fields[$this->alias['auth_container_name']]); + $this->dbc->quote($containerName, $this->fields['auth_container_name']); $types = array( - $this->fields[$this->alias['perm_user_id']], - $this->fields[$this->alias['perm_type']] + $this->fields['perm_user_id'], + $this->fields['perm_type'] ); $result = $this->dbc->queryRow($query, $types, MDB2_FETCHMODE_ASSOC); @@ -185,11 +185,11 @@ R.' . $this->alias['right_id'] . ' = U.' . $this->alias['right_id'] . ' AND U.' . $this->alias['perm_user_id'] . ' = '. - $this->dbc->quote($perm_user_id, $this->fields[$this->alias['perm_user_id']]); + $this->dbc->quote($perm_user_id, $this->fields['perm_user_id']); $types = array( - $this->fields[$this->alias['right_id']], - $this->fields[$this->alias['right_level']] + $this->fields['right_id'], + $this->fields['right_level'] ); $result = $this->dbc->queryAll($query, $types, MDB2_FETCHMODE_ORDERED, true); @@ -224,11 +224,11 @@ AAA.area_id = R.area_id AND AAA.' . $this->alias['perm_user_id'] . ' = '. - $this->dbc->quote($perm_user_id, $this->fields[$this->alias['perm_user_id']]); + $this->dbc->quote($perm_user_id, $this->fields['perm_user_id']); $types = array( - $this->fields[$this->alias['right_id']], - $this->fields[$this->alias['right_level']] + $this->fields['right_id'], + $this->fields['right_level'] ); $result = $this->dbc->queryAll($query, $types, MDB2_FETCHMODE_ORDERED, true); @@ -264,15 +264,15 @@ GU.' . $this->alias['group_id'] . ' = G. ' . $this->alias['group_id'] . ' AND GU.' . $this->alias['perm_user_id'] . ' = '. - $this->dbc->quote($perm_user_id, $this->fields[$this->alias['perm_user_id']]); + $this->dbc->quote($perm_user_id, $this->fields['perm_user_id']); if (isset($this->tables['groups']['fields']['is_active'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . - $this->dbc->quote(true, $this->fields[$this->alias['is_active']]); + $this->dbc->quote(true, $this->fields['is_active']); } - $result = $this->dbc->queryCol($query, $this->fields[$this->alias['group_id']]); + $result = $this->dbc->queryCol($query, $this->fields['group_id']); if (PEAR::isError($result)) { $this->_stack->push(LIVEUSER_ERROR, 'exception', array(), @@ -305,13 +305,13 @@ '.$this->prefix.$this->alias['grouprights'].' GR WHERE GR.' . $this->alias['group_id'] . ' IN('. - $this->dbc->datatype->implodeArray($group_ids, $this->fields[$this->alias['group_id']]).') + $this->dbc->datatype->implodeArray($group_ids, $this->fields['group_id']).') GROUP BY GR.' . $this->alias['right_id'] . ''; $types = array( - $this->fields[$this->alias['right_id']], - $this->fields[$this->alias['right_level']] + $this->fields['right_id'], + $this->fields['right_level'] ); $result = $this->dbc->queryAll($query, $types, MDB2_FETCHMODE_ORDERED, true); @@ -346,18 +346,18 @@ $this->alias['group_id'] . ' AND SG.' . $this->alias['group_id'] . ' IN ('. - $this->dbc->datatype->implodeArray($newGroupIds, $this->fields[$this->alias['group_id']]).') + $this->dbc->datatype->implodeArray($newGroupIds, $this->fields['group_id']).') AND SG.' . $this->alias['subgroup_id'] . ' NOT IN ('. - $this->dbc->datatype->implodeArray($group_ids, $this->fields[$this->alias['subgroup_id']]).')'; + $this->dbc->datatype->implodeArray($group_ids, $this->fields['subgroup_id']).')'; if (isset($this->tables['groups']['fields']['is_active'])) { $query .= ' AND G.' . $this->alias['is_active'] . '=' . - $this->dbc->quote(true, $this->fields[$this->alias['is_active']]); + $this->dbc->quote(true, $this->fields['is_active']); } - $result = $this->dbc->queryCol($query, $this->fields[$this->alias['group_id']]); + $result = $this->dbc->queryCol($query, $this->fields['group_id']); if (PEAR::isError($result)) { $this->_stack->push(LIVEUSER_ERROR, 'exception', array(), @@ -391,14 +391,14 @@ TR.' . $this->alias['right_id'] . ' = R.' . $this->alias['right_id'] . ' AND R.' . $this->alias['right_id'] . ' IN ('. - $this->dbc->datatype->implodeArray(array_keys($rightIds), $this->fields[$this->alias['right_id']]).') + $this->dbc->datatype->implodeArray(array_keys($rightIds), $this->fields['right_id']).') AND R.' . $this->alias['has_implied'] . '='. - $this->dbc->quote(true, $this->fields[$this->alias['has_implied']]); + $this->dbc->quote(true, $this->fields['has_implied']); $types = array( - $this->fields[$this->alias['right_level']], - $this->fields[$this->alias['right_id']], + $this->fields['right_level'], + $this->fields['right_id'], ); $result = $this->dbc->queryAll($query, $types, MDB2_FETCHMODE_ORDERED, true, false, true); @@ -434,12 +434,12 @@ RI.' . $this->alias['implied_right_id'] . ' = R.' . $this->alias['right_id'] . ' AND RI.' . $this->alias['right_id'] . ' IN ('. - $this->dbc->datatype->implodeArray($currentRights, $this->fields[$this->alias['right_id']]).')'; + $this->dbc->datatype->implodeArray($currentRights, $this->fields['right_id']).')'; $types = array( - $this->fields[$this->alias['right_id']], - $this->fields[$this->alias['right_level']], - $this->fields[$this->alias['has_implied']] + $this->fields['right_id'], + $this->fields['right_level'], + $this->fields['has_implied'] ); $result = $this->dbc->queryAll($query, $types, MDB2_FETCHMODE_ASSOC);
« previous php.pear.cvs (#33982) next »