Exemplo n.º 1
0
 public function direct($config)
 {
     $currentUrl = urldecode(Zend_OpenId::selfURL());
     if ($config->subdomain->enabled) {
         $protocol = Monkeys_Controller_Action::getProtocol();
         preg_match('#(.*)\\.' . $config->subdomain->hostname . '#', $currentUrl, $matches);
         return "{$protocol}://" . ($config->subdomain->use_www ? 'www.' : '') . $config->subdomain->hostname . '/openid/provider';
     } else {
         preg_match('#(.*)/(identity|openid)?/#', $currentUrl, $matches);
         return $matches[1] . '/openid/provider';
     }
 }
Exemplo n.º 2
0
 public function generateOpenId($baseUrl)
 {
     $config = Zend_Registry::get('config');
     if ($config->subdomain->enabled) {
         $openid = Monkeys_Controller_Action::getProtocol() . '://' . $this->username . '.' . $config->subdomain->hostname;
     } else {
         $openid = $baseUrl . '/identity/' . $this->username;
     }
     if ($config->SSL->enable_mixed_mode) {
         $openid = str_replace('http://', 'https://', $openid);
     }
     Zend_OpenId::normalizeUrl($openid);
     $this->openid = $openid;
 }