function __construct() { $this->auth_name = 'openid_verify'; // $this->field_name = array('openid.server','openid.delegate','ts','page'); $this->field_name = array('author', 'server_url', 'local_id', 'ts', 'page'); $this->response = array(); parent::__construct(); }
function plugin_openid_get_user_name() { global $auth_api; // role,name,nick,profile if (!$auth_api['openid']['use']) { return array('role' => Auth::ROLE_GUEST, 'nick' => ''); } $obj = new AuthOpenId(); $msg = $obj->getSession(); if (empty($msg['nickname'])) { return array('role' => Auth::ROLE_GUEST, 'nick' => ''); } if (empty($msg['local_id'])) { $key = ''; $prof = $msg['nickname']; } else { $key = $prof = $msg['local_id']; } $name = plugin_openid_get_call_func($msg['identity_url']); if (empty($name) || !exist_plugin($name)) { return array('role' => Auth::ROLE_AUTH_OPENID, 'nick' => $msg['nickname'], 'profile' => $prof, 'key' => $key); } if (function_exists($name . '_get_user_name')) { $aryargs = array($msg, $prof, $key); return call_user_func_array($name . '_get_user_name', $aryargs); } return array('role' => AuthOpenId::ROLE_AUTH_OPENID, 'nick' => $msg['nickname'], 'profile' => $prof, 'key' => $key); }