Auth_Basic::allow PHP Метод

allow() публичный Метод

Configure this Auth controller with a generic Model based on static collection of user/password combinations. Use this method if you only want one or few accounts to access the system.
public allow ( string | array $user, string $pass = null )
$user string | array Either string username or associative array with data
$pass string Password if username is string
    public function allow($user, $pass = null)
    {
        // creates fictional model to allow specified user and password
        // TODO: test this
        if ($this->model) {
            $this->model->table[] = array($this->login_field => $user, $this->password_field => $pass);
            return $this;
        }
        /** @type Model $m */
        $m = $this->add('Model');
        $m->setSource('Array', array(is_array($user) ? $user : array($this->login_field => $user, $this->password_field => $pass)));
        $m->id_field = $this->login_field;
        $this->setModel($m);
        return $this;
    }