Example #1
0
     unset($session->error);
 }
 if (isset($_GET['openid_action'])) {
     if ($_GET['openid_action'] == 'register') {
         $ret = $view->render('register.phtml');
     } else {
         if ($_GET['openid_action'] == 'registration_complete' && isset($_GET['openid_name'])) {
             $view->name = $_GET['openid_name'];
             $view->url = Zend_OpenId::selfURL() . '?openid=' . $view->name;
             if ($server->hasUser($view->url)) {
                 $view->url2 = Zend_OpenId::selfURL() . '?openid2=' . $view->name;
                 $ret = $view->render('registration_complete.phtml');
             }
         } else {
             if ($_GET['openid_action'] == 'logout') {
                 $server->logout();
                 header('Location: ' . $_SERVER['PHP_SELF']);
                 exit;
             } else {
                 if ($_GET['openid_action'] == 'login') {
                     if (isset($_GET['openid_identity'])) {
                         $view->id = $_GET['openid_identity'];
                         $view->ro = true;
                     }
                     $ret = $view->render('login.phtml');
                 } else {
                     if ($_GET['openid_action'] == 'trust') {
                         if ($server->getLoggedInUser() !== false) {
                             $view->site = $server->getSiteRoot($_GET);
                             $view->url = $server->getLoggedInUser();
                             $sreg = new Zend_OpenId_Extension_Sreg();
Example #2
0
 /**
  * testing logout
  *
  */
 public function testLoggedInUser()
 {
     $storage = new Zend_OpenId_Provider_Storage_File(dirname(__FILE__) . "/_files/provider");
     $storage->delUser(self::USER);
     $this->_user->delLoggedInUser();
     $provider = new Zend_OpenId_Provider(null, null, $this->_user, $storage);
     $this->assertFalse($provider->getLoggedInUser());
     $this->assertTrue($provider->register(self::USER, self::PASSWORD));
     $this->assertFalse($provider->getLoggedInUser());
     $this->assertTrue($provider->login(self::USER, self::PASSWORD));
     $this->assertSame(self::USER, $this->_user->getLoggedInUser());
     $this->assertTrue($provider->logout());
     $this->assertFalse($provider->getLoggedInUser());
     $storage->delUser(self::USER);
     $this->_user->delLoggedInUser();
 }