本文整理汇总了PHP中Addons::createAddonShow方法的典型用法代码示例。如果您正苦于以下问题:PHP Addons::createAddonShow方法的具体用法?PHP Addons::createAddonShow怎么用?PHP Addons::createAddonShow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Addons
的用法示例。
在下文中一共展示了Addons::createAddonShow方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkUser
function checkUser()
{
if ($_REQUEST['code']) {
$redirect_uri = Addons::createAddonShow('Login', 'no_register_display', array('type' => 'taobao', 'do' => "bind"));
$url = 'https://oauth.taobao.com/token';
$field = 'grant_type=authorization_code&client_id=' . TAOBAO_KEY . '&code=' . $_REQUEST['code'] . '&client_secret=' . TAOBAO_SECRET . '&redirect_uri=' . urlencode($redirect_uri);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $field);
$result = curl_exec($ch);
$res = json_decode($result, TRUE);
if ($res['taobao_user_id']) {
$_SESSION['taobao']['access_token']['oauth_token'] = $res['access_token'];
$_SESSION['taobao']['access_token']['oauth_token_secret'] = $res['refresh_token'];
$_SESSION['taobao']['isSync'] = 1;
$_SESSION['taobao']['uid'] = $res['taobao_user_id'];
$_SESSION['taobao']['uname'] = $res['taobao_user_nick'];
$_SESSION['taobao']['userface'] = '';
$_SESSION['open_platform_type'] = 'taobao';
return $res;
} else {
return false;
}
} else {
return false;
}
}
示例2: getCallback
private function getCallback($type = '', $callbackurl = '')
{
if (!$callbackurl) {
$callbackurl = Addons::createAddonShow('Login', 'no_register_display', array('type' => $type));
}
return urlencode($callbackurl);
}
示例3: getUrl
public function getUrl($call_back = null)
{
if (empty($this->_sina_akey) || empty($this->_sina_skey)) {
return false;
}
if (is_null($call_back)) {
$call_back = Addons::createAddonShow('Login', 'no_register_display', array('type' => 'sina', 'do' => 'bind'));
}
$this->loginUrl = $this->_oauth->getAuthorizeURL($call_back);
return $this->loginUrl;
}
示例4: getCallback
private function getCallback($site = '', $type = 'bind', $callbackurl = '')
{
if (!$callbackurl) {
if ($type == 'bind') {
$callbackurl = Addons::createAddonShow('Login', 'no_register_display', array('type' => $site, 'do' => "bind"));
} else {
$callbackurl = Addons::createAddonShow('Login', 'no_register_display', array('type' => $site));
}
}
return urlencode($callbackurl);
}
示例5: getUrl
public function getUrl($call_back = null)
{
if (empty($this->_douban_key) || empty($this->_douban_secret)) {
return false;
}
if (is_null($call_back)) {
$call_back = Addons::createAddonShow('Login', 'no_register_display', array('type' => 'douban', 'do' => "bind"));
}
if (empty($this->_authorize_url)) {
$client = new DoubanOAuth($this->_douban_key, $this->_douban_secret);
$request_token = $client->getRequestToken();
$this->_authorize_url = $client->getAuthorizeURL($request_token) . '&oauth_callback=' . urlencode($call_back);
}
$_SESSION['douban']['request_token'] = $request_token;
return $this->_authorize_url;
}
示例6: checkUser
function checkUser()
{
$redirect_uri = Addons::createAddonShow('Login', 'no_register_display', array('type' => 'facebook', 'do' => "bind"));
$facebook = new FacebookAPI(array('appId' => FACEBOOK_KEY, 'secret' => FACEBOOK_SECRET));
$token = $facebook->getAccessTokenFromCode($_GET['code'], $redirect_uri);
//dump($token);
//exit;
// if($user){
// $_SESSION['baidu']['access_token']['oauth_token'] = $access_token;
// $_SESSION['baidu']['access_token']['oauth_token_secret'] = $refresh_token;
// $_SESSION['baidu']['isSync'] = 0;
// $_SESSION['baidu']['uid'] = $user['uid'];
// $_SESSION['open_platform_type'] = 'baidu';
// return $user;
// }else{
// return false;
// }
}
示例7: login_sync_other
public function login_sync_other($param)
{
// Session::start();
$regInfo = $param['regInfo'];
$platform_options = model('AddonData')->lget('login');
$data = self::$validLogin;
$type = strtolower($param['type']);
$platform = array();
$check = array();
foreach ($data[$type] as $v) {
$check[] = !empty($platform_options[$v]);
}
if (count(array_filter($check)) == count($data[$type]) && in_array($type, $platform_options['open'])) {
$this->_loadTypeLogin($type);
$object = new $type();
$url = Addons::createAddonShow('Login', 'no_register_display', array('type' => $type));
$url = $object->getUrl($url);
// if(!$url){
//dump($type.'-login-error:'.$object->getError());
//}
redirect($url);
}
// Session::pause();
}
示例8: login_input_footer
public function login_input_footer($param)
{
Session::start();
$regInfo = $param['regInfo'];
$platform_options = model('AddonData')->lget('login');
$data = self::$validLogin;
$platform = array();
foreach ($data as $plateformName => $value) {
$check = array();
foreach ($value as $v) {
$check[] = !empty($platform_options[$v]);
}
if (count(array_filter($check)) == count($value) && in_array($plateformName, $platform_options['open'])) {
$this->_loadTypeLogin($plateformName);
$object = new $plateformName();
$url = Addons::createAddonShow('Login', 'no_register_display', array('type' => $plateformName));
$platform[$plateformName] = $object->getUrl($url);
}
}
if ($regInfo['register_type'] == 'open' && !empty($platform)) {
$html = "<div class='frm alC lh35' style='border-top:1px solid #C9C9C9; margin: 10px 0 0;'>";
$html .= "<div class='tit'>你也可以通过站外账号进行登录!";
$html .= "</div>";
foreach ($platform as $key => $vo) {
$url = $vo;
$image = $this->htmlPath . "/html/image/btn_{$key}.gif";
$html .= sprintf("<a href='%s'><img src='%s' style='cursor: pointer;margin:0 2px' /></a>", $url, $image);
}
$html .= "</div>";
echo $html;
}
Session::pause();
}
示例9: getCallback
private function getCallback($type = '', $do = 'login')
{
$callbackurl = Addons::createAddonShow('Login', 'no_register_display', array('type' => $type, 'do' => $do));
return urlencode($callbackurl);
}