Exemple #1
0
 function begin_consumer($url)
 {
     global $openid_auth_request;
     if ($openid_auth_request == NULL) {
         set_error_handler(array('WordPressOpenID_Logic', 'customer_error_handler'));
         if (WordPressOpenID_Logic::isValidEmail($url)) {
             $_SESSION['openid_login_email'] = $url;
             set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
             require_once 'Auth/Yadis/Email.php';
             $mapped_url = Auth_Yadis_Email_getID($url, trailingslashit(get_option('home')));
             if ($mapped_url) {
                 $url = $mapped_url;
             }
         }
         $consumer = WordPressOpenID_Logic::getConsumer();
         $openid_auth_request = $consumer->begin($url);
         restore_error_handler();
     }
     return $openid_auth_request;
 }
Exemple #2
0
function openid_begin_consumer($url)
{
    static $request;
    @session_start();
    if ($request == NULL) {
        set_error_handler('openid_customer_error_handler');
        if (is_email($url)) {
            $_SESSION['openid_login_email'] = $url;
            set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
            require_once 'Auth/Yadis/Email.php';
            $mapped_url = Auth_Yadis_Email_getID($url, trailingslashit(get_option('home')));
            if ($mapped_url) {
                $url = $mapped_url;
            }
        }
        $consumer = openid_getConsumer();
        $request = $consumer->begin($url);
        restore_error_handler();
    }
    return $request;
}
Exemple #3
0
 private function transformEmailToOpenID($email)
 {
     if (App::import('Vendor', $this->importPrefix . 'emailtoid', array('file' => 'Auth' . DS . 'Yadis' . DS . 'Email.php'))) {
         return Auth_Yadis_Email_getID($email);
     }
     throw new InvalidArgumentException('Invalid OpenID');
 }