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'; } }
public function init() { parent::init(); if (!self::$_metasRendered) { if (@$this->_config->metadata->description) { $this->view->headMeta()->appendName('description', $this->_config->metadata->description); } if (@$this->_config->metadata->keywords) { $this->view->headMeta()->appendName('keywords', $this->_config->metadata->keywords); } self::$_metasRendered = true; } Zend_Controller_Action_HelperBroker::addPrefix('CommunityID_Controller_Action_Helper'); }
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; }