function __construct() { $this->auth_name = 'openid'; // nickname,email,fullname,dob,gender,postcode,country,language,timezone $this->field_name = array('author', 'nickname', 'email', 'local_id', 'identity_url', 'fullname'); $this->response = array(); parent::__construct(); }
function __construct() { global $auth_api; $this->auth_name = 'jugemkey'; $this->sec_key = $auth_api[$this->auth_name]['sec_key']; $this->api_key = $auth_api[$this->auth_name]['api_key']; $this->field_name = array('title', 'token'); $this->response = array(); parent::__construct(); }
/** * コンストラクタ */ public function __construct() { global $auth_api; $this->auth_name = 'hatena'; $this->sec_key = $auth_api[$this->auth_name]['sec_key']; $this->api_key = $auth_api[$this->auth_name]['api_key']; $this->api_sig = md5($this->sec_key . 'api_key' . $this->api_key); $this->field_name = array('name', 'image_url', 'thumbnail_url'); $this->response = array(); parent::__construct(); }
/** * 認証されたAPIの情報を取得 * @global type $auth_api * @global type $auth_wkgrp_user * @global type $defaultpage * @return array */ static function get_auth_api_info() { global $auth_api, $auth_wkgrp_user, $defaultpage; $retval = array('role' => self::ROLE_GUEST, 'nick' => null, 'key' => null, 'api' => 'plus', 'group' => null, 'displayname' => null, 'home' => null, 'mypage' => null); foreach ($auth_api as $api => $val) { // どうしても必要な場合のみ開始 if (!$val['use']) { continue; } break; } $obj = new AuthApi(); $msg = $obj->getSession(); if (isset($msg['api']) && $auth_api[$msg['api']]['use']) { if (PluginRenderer::hasPlugin($msg['api'])) { $call_func = 'plugin_' . $msg['api'] . '_get_user_name'; $auth_key = $call_func(); $auth_key['api'] = $msg['api']; if (empty($auth_key['nick'])) { return $auth_key; } // 上書き・追加する項目 if (!empty($auth_wkgrp_user[$auth_key['api']][$auth_key['key']])) { $val =& $auth_wkgrp_user[$auth_key['api']][$auth_key['key']]; $auth_key['role'] = empty($val['role']) ? self::ROLE_ENROLLEE : $val['role']; $auth_key['group'] = empty($val['group']) ? null : $val['group']; $auth_key['displayname'] = empty($val['displayname']) ? null : $val['displayname']; $auth_key['home'] = empty($val['home']) ? $defaultpage : $val['home']; $auth_key['mypage'] = empty($val['mypage']) ? null : $val['mypage']; } } } return $auth_key; }