cvs: pear /Perm_LiveUser LiveUser.php

From: Date: Tue, 30 Sep 2003 19:49:59 +0000
Subject: cvs: pear /Perm_LiveUser LiveUser.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-13195@lists.php.net to get a copy of this message
lsmith Tue Sep 30 15:49:59 2003 EDT Modified files: /pear/Perm_LiveUser LiveUser.php Log: - tweaks to the clobber method - fixed storing of the auth type in the session Index: pear/Perm_LiveUser/LiveUser.php diff -u pear/Perm_LiveUser/LiveUser.php:1.43 pear/Perm_LiveUser/LiveUser.php:1.44 --- pear/Perm_LiveUser/LiveUser.php:1.43 Sat Sep 27 13:09:01 2003 +++ pear/Perm_LiveUser/LiveUser.php Tue Sep 30 15:49:59 2003 @@ -91,7 +91,7 @@ * @author Lukas Smith <smith@backendmedia.com> * @author Pierre-Alain Joye <pajoye@php.net> * @author Arnaud Limbourg <arnaud@php.net> - * @version $Id: LiveUser.php,v 1.43 2003/09/27 17:09:01 arnaud Exp $ + * @version $Id: LiveUser.php,v 1.44 2003/09/30 19:49:59 lsmith Exp $ * @package LiveUser */ class LiveUser @@ -228,17 +228,6 @@ var $authContainers = array(); /** - * Name of the session variable that is used to store information on the - * backend in which the auth data resides. - * This is needed to include the - * correct backend class definition on demand. - * - * @access private - * @var string - */ - var $authContainerTypeVar = 'authContainerType'; - - /** * Array of settings for the permission container to use for retrieving * user rights. * If set to false, no permission container will be used. @@ -337,8 +326,8 @@ * used in LiveUser::_readConfig() * * @access private - * @param array $a1 Array that should be clobbered - * @param array $a2 Array that should be clobbered + * @param array $a1 array that should be clobbered + * @param array $a2 array that should be clobbered * * @return mixed array on success and false on error * @author kc@hireability.com @@ -348,15 +337,17 @@ if (!is_array($a1) || !is_array($a2)) { return false; } - $newarray = $a1; - while (list($key, $val) = each($a2)) { - if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { - $newarray[$key] = $this->_arrayMergeClobber($newarray[$key], $val); + foreach($a2 as $key => $val) { + if (is_array($val) && + isset($a1[$key]) && + is_array($a1[$key]) + ) { + $a1[$key] = $this->_arrayMergeClobber($a1[$key], $val); } else { - $newarray[$key] = $val; + $a1[$key] = $val; } } - return $newarray; + return $a1; } /** @@ -744,7 +735,7 @@ if (is_object($this->_perm)) { $_SESSION[$this->_options['session']['varname']]['perm'] = serialize($this->_perm); } - $_SESSION[$this->authContainerTypeVar] = $this->authContainers[$counter]['type']; + $_SESSION[$this->_options['session']['varname']]['auth_type'] = $this->authContainers[$counter]['type']; $this->setRememberCookie(); } @@ -819,10 +810,10 @@ if (isset($_SESSION[$this->_options['session']['varname']]['auth'])) { $classFile = 'LiveUser/Auth/Container/'; - $classFile .= $_SESSION[$this->authContainerTypeVar] . '.php'; + $classFile .= $_SESSION[$this->_options['session']['varname']]['auth_type'] . '.php'; include_once $classFile; if (class_exists('LiveUser_Auth_Container_'. - $_SESSION[$this->authContainerTypeVar])) { + $_SESSION[$this->_options['session']['varname']]['auth_type'])) { $success = true; $this->unfreeze(); }

« previous php.pear.cvs (#13195) next »