src/Setup.php
/**
     * Opens the browsers auth dialig
     *
     * @return void
     */
Opens the browsers auth dialig
@return void
Opens the browsers auth dialig @return void
public function dialog()
    {
        if (!session_id()) {
            session_start();
        }
        if (!isset($_SESSION[self::UNAUTHORIZED])) {
            $_SESSION[self::UNAUTHORIZED] = 1;
        } else {
            $_SESSION[self::UNAUTHORIZED]++;
        }
        if ($_SESSION[self::UNAUTHORIZED] < 3) {
            header(sprintf(self::HTTP_AUTH, $this->realm, uniqid(), md5($this->realm)));
            exit;
        }
        unset($_SESSION[self::UNAUTHORIZED]);
        header(self::UNAUTHORIZED);
        Exception::i()
            ->setMessage(self::UNAUTHORIZED)
            ->setType(self::ERROR_TYPE)
            ->trigger();
    }
public function dialog ( ) { if ( ! session_id ( ) ) { session_start ( ) ; } if ( ! isset ( $ _SESSION [ self :: UNAUTHORIZED ] ) ) { $ _SESSION [ self :: UNAUTHORIZED ] = 1 ; } else { $ _SESSION [ self :: UNAUTHORIZED ] ++ ; } if ( $ _SESSION [ self :: UNAUTHORIZED ] < 3 ) { header ( sprintf ( self :: HTTP_AUTH , $ this -> realm , uniqid ( ) , md5 ( $ this -> realm ) ) ) ; exit ; } unset ( $ _SESSION [ self :: UNAUTHORIZED ] ) ; header ( self :: UNAUTHORIZED ) ; Exception :: i ( ) -> setMessage ( self :: UNAUTHORIZED ) -> setType ( self :: ERROR_TYPE ) -> trigger ( ) ; }
Opens the browsers auth dialig
 @return void
Opens the browsers auth dialig @return void
//if session has not started //start session //if they never tried //first try //more than one try //if it's their first few tries //let them try again //you are unauthorized //throw