Re: testing pear part one

From: Date: Fri, 31 May 2002 22:00:18 +0000
Subject: Re: testing pear part one
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-6688@lists.php.net to get a copy of this message
2. Auth/Auth.php old file was sent, here are some updates: > docs: - also information about getting/setting data from additional database fields should be added to manual. others: during test Auth feature request came to my mind: as we all know - in many cases knowing that an user was able to log into our site isn`t enough. very often basic auth system is extended with access levels. how about adding this feature to Auth class? there should be new field added to store access rights in container (a number would be ok i think) - default user would have empty access rights and by default getAuth would need no special access rights to return true. but in some cases programmer could specify required rights and then getAuth would check if current user has them set. so: function getAuth($accessRights = '') { if($accessRights === '') { $session = &$this->_importGlobalVariable("session"); if (!empty($session) && (isset($session['auth']['registered']) && $session['auth']['registered'] === true)) { return true; } else { return false; } } else { //advanced check } } There will be no need to change anything in already written code - extending Auth class in some places will be needed only.

« previous php.pear.dev (#6688) next »