Server : Apache System : Linux iZ2vcgyutqttsd1p850kl8Z 3.10.0-1160.92.1.el7.x86_64 #1 SMP Tue Jun 20 11:48:01 UTC 2023 x86_64 User : www ( 1000) PHP Version : 5.6.40 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv Directory : /www/wwwroot/saimikebio.com/includes/website/ |
<?php if (defined('WEBSITE')) { global $_LANG; $_LANG['help']['APP_KEY'] = '在微博开放平台创建应用审核通过后,在应用信息中查看App Key'; $_LANG['help']['APP_SECRET'] = '在微博开放平台创建应用审核通过后,在应用信息中查看App Secret'; $_LANG['help']['weibo_version'] = '勾选使用 Oauth2.0版本 验证方法 , 否则采用 1.0a 版本验证方案'; $_LANG['APP_KEY'] = 'App Key'; $_LANG['APP_SECRET'] = 'App Secret'; $_LANG['weibo_version'] = '是否使用Oauth2.0版本'; $i = isset($web) ? count($web) : 0; // 类名 $web[$i]['name'] = '新浪微博登录'; // 文件名,不包含后缀 $web[$i]['type'] = 'weibo'; // 作者信息 $web[$i]['author'] = 'ECSHOP教程网'; $web[$i]['className'] = 'weibo'; // 网址 $web[$i]['www'] = 'www.ecshopjcw.com'; // 作者qq $web[$i]['qq'] = '2479454955'; // 申请网址 $web[$i]['website'] = 'http://open.weibo.com'; // 版本号 $web[$i]['version'] = '3.6'; // 更新日期 $web[$i]['date'] = '2018-03-12'; // 配置信息 $web[$i]['config'] = array( array('type'=>'text' , 'name'=>'APP_KEY', 'value'=>''), array('type'=>'text' , 'name' => 'APP_SECRET' , 'value' => ''), ); } if (!defined('WEBSITE')) { include_once(dirname(__FILE__).'/oath2.class.php'); class website extends oath2 { function website() { $this->app_key = APP_KEY; $this->app_secret = APP_SECRET; $this->tokenURL = 'https://api.weibo.com/oauth2/access_token'; $this->authorizeURL = 'https://api.weibo.com/oauth2/authorize'; $this->display = 'popup'; $this->userURL = 'https://api.weibo.com/2/users/show.json'; $this->meth = 'POST'; } function sign( &$p ){ $this->meth = 'GET'; $this->id_format($p['uid']); } function message($info) { $arr = array(); $arr['user_id'] = $info['id']; $arr['name'] = empty($info['screen_name']) ? $info['name'] : $info['screen_name']; $arr['location'] = $info['location']; $arr['sex'] = $info['gender'] == 'm' ? 1 : 0; $arr['img'] = empty($info['avatar_large']) ? '' : $info['avatar_large']; $arr['lang'] = $info['lang']; $arr['info'] = $info; return $arr; } public function is_error($result) // 错误 { $msg = json_decode($result , true); if(empty($msg['error_code'])) { return $msg; } if(is_array($msg)) $this->add_error($msg['error_code'] , $msg['error'], $msg['request'].' - '.(isset($msg['error_description']) ? $msg['error_description'] : '') . ' - ' .$str ); return false; } function id_format(&$id) { if ( is_float($id) ) { $id = number_format($id, 0, '', ''); } elseif ( is_string($id) ) { $id = trim($id); } } } } ?>