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/wechat/oauth/ |
<?php define('IN_ECTOUCH', true); require (dirname(__FILE__) . '/../../mobile/include/init.php'); $uri = !empty($_GET['uri']) ? $_GET['uri'] : ''; if(empty($uri)) { exit("uri is empty"); } if(!empty($_GET['u'])) { $uri = $uri.'&u='.$_GET['u']; $_SESSION['uri'] = $uri; } if(!empty($_GET['order_id'])) { $uri = $uri.'&order_id='.$_GET['order_id']; $_SESSION['uri'] = $uri; } else { $_SESSION['uri'] = $uri; } $appid = $db->getOne("SELECT appid FROM ". $GLOBALS['ecs']->table('weixin_config') ." WHERE `id` = 1"); $cfg_baseurl = $db->getOne("SELECT cfg_value FROM ". $GLOBALS['ecs']->table('weixin_cfg') ." WHERE cfg_name = 'baseurl'"); $gouri = urlencode($_SESSION['uri']); $back_url = $cfg_baseurl.'wechat/oauth/wxch_location.php?uri='.$gouri; $redirect_uri = urlencode($back_url); $state = 'wechat'; $scope = 'snsapi_base'; $oauth_url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$appid.'&redirect_uri='.$redirect_uri.'&response_type=code&scope='.$scope.'&state='.$state.'#wechat_redirect'; header('Expires: 0'); header('Last-Modified: '. gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cahe, must-revalidate'); header('Cache-Control: post-chedk=0, pre-check=0', false); header('Pragma: no-cache'); header("HTTP/1.1 301 Moved Permanently"); header("Location: $oauth_url"); exit; ; ?>