Prado\Security\TAuthManager::setUserManager PHP Method

setUserManager() public method

public setUserManager ( $provider )
    public function setUserManager($provider)
    {
        if ($this->_initialized) {
            throw new TInvalidOperationException('authmanager_usermanager_unchangeable');
        }
        if (!is_string($provider) && !$provider instanceof IUserManager) {
            throw new TConfigurationException('authmanager_usermanager_invalid', $this->_userManager);
        }
        $this->_userManager = $provider;
    }

Usage Example

Example #1
0
 public function testDoAuthentication()
 {
     throw new PHPUnit_Framework_IncompleteTestError();
     // Not yet finished, Session won't start because of headers :( :(
     $authManager = new TAuthManager();
     $authManager->setUserManager('users');
     $authManager->init(null);
     $authManager->setLoginPage('LoginPage');
     self::$app->raiseEvent('onAuthentication', self::$app, null);
 }