/** * 模拟登录 */ public function Login($verifycode = NULL) { $data = $this->account; if (!is_numeric($data['username']) && !str_contains($data['username'], '@')) { return '用户名格式错误,请输入QQ号或QQ邮箱。'; } Session::Set('qq', $data['username']); if (!$verifycode) { $ret = $this->get('http://check.ptlogin2.qq.com/check?appid=15000101&uin=' . $data['username']); // $arr = explode("'", $ret); $verifycode = $arr[3]; if (strlen($verifycode) != 4) { return '绑定账号失败:请输入验证码'; //'登录服务暂时不可用,请稍后再试!'; } } $param = array('aid' => 15000101, 'fp' => 'loginerroralert', 'from_ui' => 1, 'g' => 1, 'h' => 1, 'u' => $data['username'], 'p' => $this->encpwd($data['password'], $data['username'], $verifycode), 'verifycode' => $verifycode, 'u1' => 'http://imgcache.qq.com/qzone/v5/loginsucc.html?para=izone'); Log::customLog('qzone.txt', "GET http://ptlogin2.qq.com/login:\r\n" . print_r($param, true)); $ret = $this->get('http://ptlogin2.qq.com/login?' . http_build_query($param)); Log::customLog('qzone.txt', "Response:\r\n" . print_r($this->http_header, true) . print_r($ret, true)); $arr = explode("'", $ret); $ret = $arr[9]; if (start_with($ret, '登录成功')) { return true; } return $ret; }
static function Upload($image) { $user = Session::Get('current_user'); $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $image["name"]); $extension = strtolower(end($temp)); if (in_array($extension, $allowedExts)) { if ($image["error"] > 0) { if ($image["error"] == 1 || $image["error"] == 2) { Error::Set('avatar', 'The uploaded file exceeds the upload_max_filesize directive in php.ini or in the html form.'); } } else { if ($image["size"] >= Config::Get('avatar.maxsize')) { Error::Set('avatar', 'imagemaxsize'); } else { $filename = '_' . md5($user->Get('id')) . "." . $extension; $src = PLSPATH . Config::Get("avatar.upload_path") . $filename; if (move_uploaded_file($image["tmp_name"], $src)) { Session::Set('current_user_temp_avatar', $filename); return true; } else { Error::Set('avatar', 'uploadfailed'); } } } } else { Error::Set('avatar', 'invalidimage'); } return false; }
public function index() { if ($_POST) { $email = $this->_get("email"); $password = $this->_get("password"); $users = D('Users'); $login_user = $users->GetLogin($_POST['email'], $_POST['password']); if (!$login_user) { Session::Set('error', '用户名或密码错误'); redirect("/manage/login/index"); } else { if ($login_user['is_enabled'] == 'N' && $login_user['secret']) { Session::Set('error', '登录失败'); redirect("/manage/login/index"); } else { if (abs(intval($_POST['auto_login']))) { Login::Logon($login_user, true); } else { Login::Logon($login_user); } Session::set("success", "登录成功"); redirect("/manage"); } } } else { $this->display(); } }
/** * Return default skin path from configuration */ private static function GetDefault() { /** * Multilenguage Support */ $lang = Session::Get('lang'); if (!$lang) { $default = Configuration::Query("/configuration/skins/skin[@default='1']"); /* We should have one default skin */ if (!$default) { Error::Alert('Default Skin is not defined.'); } /* Default skin should have the language defined */ $lang = $default->item(0)->getAttribute('lang'); if (empty($lang)) { Error::Alert('Default Skin does not have a language defined.'); } Session::Set('lang', $lang); } // Util::debug($lang); $skin = Configuration::Query("/configuration/skins/skin[@lang='" . $lang . "']/path"); /* If there is not a skin for the language stored, something is really wrong */ if (!$skin) { Session::Destroy('lang'); Error::Alert('Could not load the skin for language "' . $lang . '".'); } $default = $skin->item(0)->nodeValue; $subdir = Configuration::Query('/configuration/domain/@subdir'); if ($subdir) { $default = '/' . $subdir->item(0)->nodeValue . $default; } return $default; }
/** * 保存用户 * @param array $user 用户信息 */ public static function SaveUser($user) { $sessionKey = SESSION_LOGIN_USER; $cookieKey = COOKIE_USER_ID; $cookieExpireTime = 86400 * Config_User::$loginCookieExpireDay; Session::Set($sessionKey, $user); Cookie::Set($cookieKey, $user['id'], $cookieExpireTime); }
/** * 获取登录验证码 */ public function showCode() { $ret = $this->get('http://www.douban.com/accounts/login?error=requirecaptcha'); $captcha = $this->getMatch1('#<img.*? src="(.+?)" alt="captcha"#i', $ret); $captcha_id = $this->getMatch1('#name="captcha-id" value="(.*?)"#i', $ret); Session::Set('douban_chapcha_id', $captcha_id); echo $this->get(urldecode($captcha)); }
public static function Set() { $ranStr = md5(microtime()); // Lấy chuỗi rồi mã hóa md5 $ranStr = substr($ranStr, 0, 6); // Cắt chuỗi lấy 6 ký tự return Session::Set('captcha', $ranStr); }
function init($file) { $this->excelSheet = $this->_getPhpExcel($file); if (!$this->excelSheet) { Session::Set("error", "文件损坏或格式错误"); redirect("/import"); } $this->rowIterator = $this->excelSheet->getRowIterator(); }
public function action_recover($hash = null) { if (Input::Method() === "POST") { if ($user = \Model\Auth_User::find_by_email(Input::POST('email'))) { // generate a recovery hash $hash = \Auth::instance()->hash_password(\Str::random()) . $user->id; // and store it in the user profile \Auth::update_user(array('lostpassword_hash' => $hash, 'lostpassword_created' => time()), $user->username); // send an email out with a reset link \Package::load('email'); $email = \Email::forge(); $html = 'Your password recovery link <a href="' . Uri::Create('login/recover/' . $hash) . '">Recover My Password!</a>'; // use a view file to generate the email message $email->html_body($html); // give it a subject $email->subject(\Settings::Get('site_name') . ' Password Recovery'); // GET ADMIN EMAIL FROM SETTINGS? $admin_email = Settings::get('admin_email'); if (empty($admin_email) === false) { $from = $admin_email; } else { $from = 'support@' . str_replace('http:', '', str_replace('/', '', Uri::Base(false))); } $email->from($from); $email->to($user->email, $user->fullname); // and off it goes (if all goes well)! try { // send the email $email->send(); Session::set('success', 'Email has been sent to ' . $user->email . '! Please check your spam folder!'); } catch (\Exception $e) { Session::Set('error', 'We failed to send the eamil , contact ' . $admin_email); \Response::redirect_back(); } } else { Session::Set('error', 'Sorry there is not a matching email!'); } } elseif (empty($hash) === false) { $hash = str_replace(Uri::Create('login/recover/'), '', Uri::current()); $user = substr($hash, 44); if ($user = \Model\Auth_User::find_by_id($user)) { // do we have this hash for this user, and hasn't it expired yet , must be within 24 hours if (isset($user->lostpassword_hash) and $user->lostpassword_hash == $hash and time() - $user->lostpassword_created < 86400) { // invalidate the hash \Auth::update_user(array('lostpassword_hash' => null, 'lostpassword_created' => null), $user->username); // log the user in and go to the profile to change the password if (\Auth::instance()->force_login($user->id)) { Session::Set('current_password', Auth::reset_password($user->username)); Response::Redirect(Uri::Create('user/settings')); } } } Session::Set('error', 'Invalid Hash!'); } $this->template->content = View::forge('login/recover'); }
public function action_profiler() { $profiler = Session::get('profiler'); if (empty($profiler) === false) { Session::Delete('profiler'); } else { Session::Set('profiler', true); } Response::Redirect_Back(); }
public function before() { parent::before(); if (\Settings::Get('api') !== true) { echo 'API DISABLED'; Session::Set('error', 'API Disabled'); Response::redirect(Uri::Base()); die; } }
function Save() { if (isset($this->userData['id'])) { $this->db->Update($this->changes)->Where('id', $this->userData['id'])->Limit(1)->Execute(Config::Get('db.table')); $result = true; if (Session::Get('current_user') && $this->userData['id'] == Session::Get('current_user')->Get('id')) { Session::Set('current_user', $this); } } else { $result = $this->db->Insert($this->userData)->Execute(Config::Get('db.table')); } $this->changes = array(); return $result; }
public static function Version() { /** * Multi version Support */ $version = Session::Get('version'); // If version is not set, take the last if (!$version) { $list = self::Source(); $version = end($list); Session::Set('version', $version); } return $version; }
function __construct() { global $login_user; global $partner; // login as customer if ($this->_get('token')) { $cmd_user_id_viapm = intval(Crypt::de($this->_get('token'))); $login_user = D('CmsUsers')->getById($cmd_user_id_viapm); Session::Set("login_user", $login_user); Session::Set("via_pm", 1); } else { $login_user = Session::Get("login_user"); } if (!empty($login_user)) { $this->assign("login_user", $login_user); $user_info = D(PM_NAME . "://UserInfo")->getUserInfo($login_user['id']); if ($user_info && !$user_info['birthday']) { $user_info['birthday'] = '1990-01-01'; // if(!$user_info['submit_time']) { // $user_info['submit_time'] = date('Y-m-d'); // } } $this->user_info = $this->userinfo = $user_info; define(USER_ID, $login_user['id']); } else { redirect("/"); } $options = M("Options")->where("autoload = 'Y'")->select(); $INI = array(); foreach ($options as $index => $option) { $INI[$option['option_name']] = $option['option_value']; } $this->assign("INI", $INI); // 安全过滤 foreach ($_POST as $k => $v) { if (!is_array($v)) { $v = preg_replace('/script.*?\\/script/is', '', $v); $v = preg_replace('/alert\\(.*?\\)/is', '', $v); $v = str_replace(array('eval', 'function', 'onerror', 'alert'), '', $v); // $_POST[$k] = htmlspecialchars($v); } } // $this->user_info_items = $this->get_user_info(); }
function do_main() { global $ttH; $link_action = $ttH->site->get_link($this->modules, $ttH->setting[$this->modules]["change_pass_link"]); $err = ''; if (isset($ttH->post['do_submit'])) { /*print_arr($ttH->post); die();*/ $password_cur = $ttH->func->md25($ttH->post['password_cur']); $password = $ttH->func->md25($ttH->post['password']); $re_password = $ttH->func->md25($ttH->post['re_password']); if (empty($err) && $password_cur != $ttH->data['user_cur']['password']) { $err = $ttH->html->html_alert($ttH->lang['global']['err_invalid_password_cur'], "error"); } if (empty($err) && empty($ttH->post['password'])) { $err = $ttH->html->html_alert($ttH->lang['global']['err_invalid_password'], "error"); } if (empty($err) && $password != $re_password) { $err = $ttH->html->html_alert($ttH->lang['global']['err_invalid_re_password'], "error"); } if (empty($err)) { $col = array(); $col["password"] = $password; $col["date_update"] = time(); $ok = $ttH->db->do_update("user", $col, " user_id='" . $ttH->data['user_cur']['user_id'] . "'"); if ($ok) { $user_cur = Session::get('user_cur'); $user_cur['password'] = $password; $user_cur = Session::Set('user_cur', $user_cur); $err = $ttH->html->html_alert($ttH->lang["user"]["edit_success"], "success"); //$ttH->html->redirect_rel($link_action); } else { $err = $ttH->html->html_alert($ttH->lang["user"]["edit_false"], "error"); } } } $data = $ttH->data['user_cur']; $data['err'] = $err; $data['link_action'] = $link_action; $data['content'] = $ttH->site->get_banner('change-pass', 1); $ttH->temp_act->assign('data', $data); $ttH->temp_act->parse("change_pass"); return $ttH->temp_act->text("change_pass"); }
function need_login($force = false) { if (isset($_GET['abc'])) { print_r($_SESSION); die; } if (isset($_SESSION['user_id'])) { if (is_post()) { unset($_SESSION['loginpage']); unset($_SESSION['loginpagepost']); } return $_SESSION['user_id']; } if (is_get()) { Session::Set('loginpage', $_SERVER['REQUEST_URI']); } else { Session::Set('loginpage', $_SERVER['HTTP_REFERER']); Session::Set('loginpagepost', json_encode($_POST)); } return redirect(WEB_ROOT . '/login.php?' . $_SERVER['QUERY_STRING']); }
function password_submit() { $oldpassword = $this->_param("oldpassword"); $newpassword = $this->_param("newpassword"); if (!$oldpassword || !$newpassword) { redirect('/dashboard/account_info'); } if ($oldpassword == $newpassword) { Session::Set("error", '新密码和旧密码不能一样'); redirect('/dashboard/account_info'); } $oldpassword = D("CmsUsers")->genPassword($oldpassword); $newpassword = D("CmsUsers")->genPassword($newpassword); $u = D('CmsUsers')->getById($this->login_user['id']); if ($u['password'] !== $oldpassword) { Session::Set("error", '旧密码有误,请重新输入'); redirect('/dashboard/account_info'); } D("CmsUsers")->where(array("id" => $this->login_user['id']))->setField("password", $newpassword); Login::UserLogout(); Session::Set("success", '密码修改成功,请重新登录'); redirect("/register/login"); }
public function action_index() { // Check to see if the config exsists if (file_exists(APPPATH . 'config/production/db.php') === true) { // Check to make sure DB tables exists if (DBUtil::table_exists('urls') && DBUtil::table_exists('users_groups') && DBUtil::table_exists('url_stats') && DBUtil::table_exists('settings')) { // return Controller_Install::force_login(); Response::Redirect('/login'); } } else { if (Input::Method() === 'POST') { // $database = Input::Post('database'); // $old_database = Input::Post('old_database'); // MAKE CONFIG if (Controller_Install::create_db_config()) { if (Controller_Install::create_tables()) { Controller_Install::force_login(); } else { Session::Set('error', 'You cannot have the same database names for upgrade, please change database names!'); return Response::forge(View::forge('install/index')); } } } else { $data = null; if (file_exists(DOCROOT . 'assets/cache') === true) { $data['public_cache'] = File::get_permissions(DOCROOT . 'assets/cache'); } if (file_exists(APPPATH . 'config/production') === true) { $data['config'] = File::get_permissions(APPPATH . 'config/production'); } if (file_exists(APPPATH . 'cache') === true) { $data['cache'] = File::get_permissions(APPPATH . 'cache'); } } return Response::forge(View::forge('install/index', $data)); } }
public function index() { if ($_POST) { if (!Utility::CaptchaCheck($this->_post('verifycode'))) { Session::Set("error", "验证码有误,请重新输入"); redirect("/login"); } $email = $this->_get("email"); $password = $this->_get("password"); $users = D('Users'); $login_user = $users->getLogin($_POST['email'], $_POST['password']); if (!$login_user) { Session::Set('error', '用户名或密码错误'); $this->redirect("/frontend/login/index"); } else { if ($login_user['is_enabled'] == 'N' && $login_user['secret']) { Session::Set('error', '登录失败'); $this->redirect("/frontend/login/index"); } else { if (abs(intval($_POST['auto_login']))) { Login::Logon($login_user, true); } else { Login::Logon($login_user); } Session::set("success", "登录成功"); if ($_REQUEST['ref']) { redirect($_REQUEST['ref']); } else { redirect("/"); } } } } else { $this->display(); } }
function do_main() { global $ttH; $user_code = isset($ttH->get['code']) ? $ttH->get['code'] : ''; $sql = "select user_id, username, password, user_code, session from user \n\t\t\t\t\t\twhere is_show=0 \n\t\t\t\t\t\tand user_code='" . $user_code . "' \n\t\t\t\t\t\tlimit 0,1"; //echo $sql; $result = $ttH->db->query($sql); if ($user = $ttH->db->fetch_row($result)) { $col = array(); $col["is_show"] = 1; $ok = $ttH->db->do_update("user", $col, " user_id='" . $user['user_id'] . "'"); if ($ok) { Session::Set('user_cur', array('userid' => $user['user_id'], 'username' => $user['username'], 'password' => $user['password'], 'session' => $user['session'])); $link_go = $ttH->site->get_link($this->modules); $ttH->html->redirect_rel($link_go); } else { $link_go = $ttH->site->get_link($this->modules, $ttH->setting[$this->modules]["signin_link"]); $ttH->html->alert($ttH->lang["global"]["not_found_page"], $link_go); } } else { $link_go = $ttH->site->get_link($this->modules, $ttH->setting[$this->modules]["signin_link"]); $ttH->html->alert($ttH->lang["global"]["not_found_page"], $link_go); } }
<?php require_once dirname(dirname(dirname(__FILE__))) . '/app.php'; /* 平台商密钥 */ $key = $INI['tenpay']['sec']; /* 创建支付应答对象 */ $resHandler = new MediPayResponseHandler(); $resHandler->setKey($key); //判断签名 if ($resHandler->isTenpaySign()) { //商家订单号 $v_oid = $resHandler->getParameter("mch_vno"); @(list($_, $order_id, $city_id, $_) = explode('-', $v_oid, 4)); //金额,以分为单位 $v_amount = moneyit($resHandler->getParameter("total_fee") * 0.01); //返回码 $retcode = $resHandler->getParameter("retcode"); //状态 $status = $resHandler->getParameter("status"); //返回码判断 if ("0" == $retcode) { $order = Table::Fetch('order', $order_id); if ($order['state'] == 'pay') { Session::Set('notice', "购买成功!"); } } else { Session::Set('notice', "支付失败!"); } } redirect(WEB_ROOT . "/order/pay.php?id={$order_id}");
redirect( WEB_ROOT . "/manage/team/index.php"); } else if ( $team['id'] ) { log_admin('team', '非法编辑team项目',$insert); Session::Set('error', '非法编辑'); redirect( WEB_ROOT . "/manage/team/index.php"); } if ( $table->insert($insert) ) { log_admin('team', '新建team项目',$insert); Session::Set('notice', '新建项目成功'); redirect( WEB_ROOT . "/manage/team/index.php"); } else { log_admin('team', '编辑team项目失败',$insert); Session::Set('error', '编辑项目失败'); redirect(null); } } $groups = DB::LimitQuery('category', array( 'condition' => array( 'zone' => 'group','fid' => '0', ), )); $groups = Utility::OptionArray($groups, 'id', 'name'); $level_groups = DB::LimitQuery('category', array( 'condition' => array( "zone" => "group", " fid <> 0" ), )); $level_groups = Utility::OptionArray($level_groups, 'id','name'); $partners = DB::LimitQuery('partner', array(
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; $id = abs(intval($_GET['id'])); $order = Table::Fetch('order', $id); if (!$order) { Session::Set('error', '订单不存在!'); redirect('index.php'); } $team = Table::Fetch('team', $order['team_id']); $team['state'] = team_state($team); if ($team['close_time']) { redirect("team.php?id={$id}"); } /* generator unique pay_id */ if (!($order['pay_id'] && (preg_match('#-(\\d+)-(\\d+)-#', $order['pay_id'], $m) && ($m[1] == $order['id'] && $m[2] == $order['quantity'])))) { $randid = strtolower(Utility::GenSecret(4, Utility::CHAR_WORD)); $pay_id = "go-{$order['id']}-{$order['quantity']}-{$randid}"; Table::UpdateCache('order', $order['id'], array('pay_id' => $pay_id)); } /* end */ include template('wap_check');
} if ($_POST['password2'] == $_POST['password'] && $_POST['password']) { if ($INI['system']['emailverify']) { $u['enable'] = 'N'; } $usergroup = Table::Fetch('user_group', 'customer', 'name'); if (!empty($usergroup)) { $u['user_group_id'] = $usergroup['id']; } if ($user_id = ZUser::Create($u)) { if ($INI['system']['emailverify']) { mail_sign_id($user_id); Session::Set('unemail', $_POST['email']); Utility::Redirect(WEB_ROOT . '/account/verify.php'); } else { ZLogin::Login($user_id); Utility::Redirect(WEB_ROOT . '/index.php'); } } else { $au = Table::Fetch('user', $_POST['email'], 'email'); if ($au) { Session::Set('error', 'Failed, Email has registerred '); } else { Session::Set('error', 'Failed, username has been taken'); } } } else { Session::Set('error', 'Register failed, check your password please'); } } include template('account_signup');
$INI['system']['conduser'] = abs(intval($INI['system']['conduser']>0)); $INI['system']['currencyname'] = strtoupper($INI['system']['currencyname']); //2013.07.29 $sorts = array('MO', 'NO', 'AF', 'NI'); $sorts_key = array_search($INI['system']['sorttype'], $sorts); if(!$sorts_key) $sorts_key = 0; $INI['system']['sorttype'] = $sorts[($sorts_key + 1)%4]; save_config(); $value = Utility::ExtraEncode($INI); $table = new Table('system', array('value'=>$value)); if ( $system ) $table->SetPK('id', 1); $flag = $table->update(array( 'value')); log_admin('system', '编辑基本设置',$_POST); Session::Set('notice', '更新系统信息成功'); redirect( null ); } include template("manage_system_index{$ts}"); function current_system_index($s=null) { global $city; $filter = array( 'a' => 'AAAAAAA', 'b' => 'BBBBBBBBB', 'c' => 'CCCCCCCC', 'd' => 'DDDDDDDDD', 'e' => 'EEEEEEEEE', ); $a['/manage/system/index.php'] = '基本';
<?php require_once dirname(dirname(dirname(__FILE__))) . '/app.php'; need_manager(); need_auth('market'); if ($_POST) { $table = new Table('partner', $_POST); $table->SetStrip('location', 'other'); $table->create_time = time(); $table->user_id = $login_user_id; $table->password = ZPartner::GenPassword($table->password); $table->group_id = abs(intval($table->group_id)); $table->city_id = abs(intval($table->city_id)); $table->open = strtoupper($table->open) == 'Y' ? 'Y' : 'N'; $table->display = strtoupper($table->display) == 'Y' ? 'Y' : 'N'; $table->image = upload_image('upload_image', null, 'team', true); $table->image1 = upload_image('upload_image1', null, 'team'); $table->image2 = upload_image('upload_image2', null, 'team'); $table->insert(array('username', 'user_id', 'city_id', 'title', 'group_id', 'bank_name', 'bank_user', 'bank_no', 'create_time', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone', 'password', 'address', 'open', 'display', 'image', 'image1', 'image2', 'longlat')); $partner = DB::GetTableRow('partner', array('username' => $username, 'password' => $password)); // 更新商户支付信息 if ($login_partner) { $table = new Table('partner_pay', $_POST); $table->SetPk('id', $partner['id']); $insert = array('id', 'tenpaymid', 'tenpaysec', 'alipaymid', 'alipaysec'); $flag = $table->insert($insert); } Session::Set('notice', '新建商户成功'); Utility::Redirect(WEB_ROOT . '/manage/partner/index.php'); } include template('manage_partner_create');
$isLocked = $_REQUEST["isLocked"]; $feeAmt = $_REQUEST["feeAmt"]; $respCode = $_REQUEST["respCode"]; $VerficationCode = $INI['gopay']['code']; $signValue = $_REQUEST["signValue"]; $orderId = preg_replace('/_/', '-', $merOrderNum); $str = "tranCode=[{$tranCode}]merchantID=[{$merchantID}]merOrderNum=[{$merOrderNum}]tranAmt=[{$tranAmt}]ticketAmt=[{$ticketAmt}]tranDateTime=[{$tranDateTime}]currencyType=[{$currencyType}]merURL=[{$merURL}]customerEMail=[{$customerEMail}]authID=[{$authID}]orgOrderNum=[{$orgOrderNum}]orgtranDateTime=[{$orgtranDateTime}]orgtranAmt=[{$orgtranAmt}]orgTxnType=[{$orgTxnType}]orgTxnStat=[{$orgTxnStat}]msgExt=[{$msgExt}]virCardNo=[{$virCardNo}]virCardNoIn=[{$virCardNoIn}]tranIP=[{$tranIP}]isLocked=[{$isLocked}]feeAmt=[{$feeAmt}]respCode=[{$respCode}]VerficationCode=[{$VerficationCode}]"; $newSign = MD5($str); @(list($_, $order_id, $city_id, $_) = explode('-', $orderId, 4)); if (Table::Fetch('pay', $orderId)) { die('SUCCESS'); } if ($newSign == $signValue && $respCode == '0000') { /* charge */ if ($_ == 'charge') { @(list($_, $user_id, $create_time, $_) = explode('-', $orderId, 4)); ZFlow::CreateFromCharge($tranAmt, $user_id, $create_time, 'gopay', $tranCode); Session::Set('notice', "国付宝充值{$tranAmt}元成功!"); redirect(WEB_ROOT . '/credit/index.php'); die('success'); } /* end charge */ $currency = 'CNY'; $service = 'gopay'; $bank = '国付宝'; ZOrder::OnlineIt($order_id, $orderId, $tranAmt, $currency, $service, $bank, $tranCode); //Session::Set('notice', "购买成功!"); redirect(WEB_ROOT . "/order/pay.php?id={$order_id}"); die('success'); } include template('order_return_error');
Session::Set('error', "备份表-{$table}-{$p}-失败"); _go_reload(); } $p++; $sql = null; } } if ($sql) { if (true !== backup_write_file($sql, $filename)) { Session::Set('error', "备份表-{$table}-失败"); _go_reload(); } } Session::Set('notice', "表-{$table}-数据备份完成"); _go_reload(); } if ($_POST['weizhi'] == "localpc" && $_POST['fenjuan'] == 'yes') { Session::Set('error', "选择备份到服务器,才能使用分卷备份"); _go_reload(); } if ($_POST['fenjuan'] == "yes" && !$_POST['filesize']) { Session::Set('error', "选择了分卷备份,未填写分卷文件大小"); _go_reload(); } $backupdir = DIR_ROOT . '/data'; if ($_POST['weizhi'] == "server" && is_writeable($backupdir)) { Session::Set('error', "备份文件存放目录{$backupdir}不可写,请修改目录属性"); _go_reload(); } _go_reload(); }
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; //今日接受调查人次 $daytime = strtotime(date('Y-m-d')); $ip = Utility::GetRemoteIp(); $action = $_GET['action'] ? $_GET['action'] : ''; if ($action == 'addSuccess') { Session::Set('notice', '提交数据成功,感谢您的参与。'); redirect(WEB_ROOT . '/vote/index.php'); } $question_list = DB::LimitQuery('vote_question', array('condition' => array("`is_show` = '1'"), 'order' => 'ORDER BY `order` , id', 'size' => 100, 'offset' => $offset)); foreach ($question_list as $key => $question) { $options_list = DB::LimitQuery('vote_options', array('condition' => array("`question_id` = '{$question['id']}'", "`is_show` = '1'"), 'order' => 'ORDER BY `order` , id', 'size' => 100, 'offset' => $offset)); $question_list[$key]['options_list'] = $options_list; } $pagetitle = '用户调查'; include template('vote_index');
/** * Sets the session variables and performs the login * @param $account_information - array */ private function SetSessionVariables($account_information) { Session::Set('session_account_id', $account_information['id']); Session::Set('session_account_logged', $account_information['id'] ? $this->GetUniqueUrl() . $account_information['id'] : false); Session::Set('session_user_name', $account_information['user_name']); Session::Set('session_user_first_name', $account_information['first_name']); Session::Set('session_user_last_name', $account_information['last_name']); Session::Set('session_user_email', $account_information['email']); Session::Set('session_account_type', $this->accountType == 'admin' ? $account_information['account_type'] : 'customer'); Session::Set('session_last_login', $account_information['date_lastlogin']); if (isset($account_information['b_country'])) { Session::Set('session_user_country', $account_information['b_country']); } // check if predefined lang still exists, if not set default language if (isset($account_information['preferred_language']) && Languages::LanguageActive($account_information['preferred_language'])) { $preferred_language = $account_information['preferred_language']; } else { $preferred_language = Languages::GetDefaultLang(); } Session::Set('session_preferred_language', $preferred_language); // prepare role privileges $result = Roles::GetPrivileges(Session::Get('session_account_type')); $privileges_info = array(); for ($i = 0; $i < $result[1]; $i++) { $privileges_info[$result[0][$i]['code']] = $result[0][$i]['is_active'] == '1' ? true : false; } Session::Set('session_user_privileges', $privileges_info); $this->LoadListings(); // clean some session variables Session::Set('preview', ''); }