本文整理汇总了PHP中ISafe::get方法的典型用法代码示例。如果您正苦于以下问题:PHP ISafe::get方法的具体用法?PHP ISafe::get怎么用?PHP ISafe::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISafe
的用法示例。
在下文中一共展示了ISafe::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPaymentList
public function getPaymentList()
{
$user_id = ISafe::get('user_id');
$where = 'status = 0';
if (!$user_id) {
$where .= " and class_name != 'balance'";
}
switch (IClient::getDevice()) {
//移动支付
case IClient::MOBILE:
//如果是微信客户端,必须用微信专用支付
if (IClient::isWechat() == true) {
$where .= " and class_name = 'wap_wechat'";
} else {
$where .= " and client_type in(2,3) and class_name != 'wap_wechat' ";
}
break;
//pc支付
//pc支付
case IClient::PC:
$where .= ' and client_type in(1,3) ';
break;
}
$paymentDB = new IModel('payment');
return $paymentDB->query($where);
}
示例2: callback
/**
* @see paymentplugin::callback()
*/
public function callback($ExternalData, &$paymentId, &$money, &$message, &$orderNo)
{
$partnerKey = Payment::getConfigParam($paymentId, 'M_PartnerKey');
$user_id = ISafe::get('user_id');
ksort($ExternalData);
$temp = array();
foreach ($ExternalData as $k => $v) {
if ($k != 'sign') {
$temp[] = $k . '=' . urlencode($v);
}
}
$encryptKey = isset(IWeb::$app->config['encryptKey']) ? IWeb::$app->config['encryptKey'] : 'iwebshop';
$testStr = join('&', $temp) . '&' . $user_id . $partnerKey . $encryptKey;
$orderNo = $ExternalData['order_no'];
$money = $ExternalData['total_fee'];
if ($ExternalData['sign'] == md5($testStr)) {
//支付单号
switch ($ExternalData['is_success']) {
case 'T':
$log = new AccountLog();
$config = array('user_id' => $user_id, 'event' => 'pay', 'note' => '通过余额支付方式进行商品购买', 'num' => '-' . $money, 'order_id' => $orderNo);
$log->write($config);
return true;
break;
case 'F':
return false;
break;
}
} else {
$message = '校验码不正确';
}
return false;
}
示例3: callback
function callback($in, &$paymentId, &$money, &$message, &$tradeno)
{
//比对md5码
$pKey = $this->getConf($paymentId, 'PrivateKey');
$user_id = ISafe::get('user_id');
ksort($in);
unset($in['controller']);
unset($in['action']);
unset($in['payment_name']);
$temp = array();
foreach ($in as $k => $v) {
if ($k != 'sign') {
$temp[] = $k . '=' . urlencode($v);
}
}
$testStr = join('&', $temp) . '&' . $user_id . $pKey;
$tradeno = $in['order_no'];
$money = $in['total_fee'];
if ($in['sign'] == md5($testStr)) {
//支付单号
switch ($in['is_success']) {
case 'T':
$log = new AccountLog();
$config = array('user_id' => ISafe::get('user_id'), 'event' => 'pay', 'note' => '通过余额支付方式进行商品购买', 'num' => '-' . $money, 'order_id' => $tradeno);
$log->write($config);
return PAY_SUCCESS;
break;
case 'F':
return PAY_FAILED;
break;
}
} else {
IError::show(403, '校验码不正确');
}
}
示例4: filterMenu
/**
* @brief 根据用户的权限过滤菜单
* @return array
*/
private function filterMenu()
{
$rights = ISafe::get('admin_right');
//如果不是超级管理员则要过滤菜单
if ($rights != 'administrator') {
foreach (self::$menu as $firstKey => $firstVal) {
if (is_array($firstVal)) {
foreach ($firstVal as $secondKey => $secondVal) {
if (is_array($secondVal)) {
foreach ($secondVal as $thirdKey => $thirdVal) {
if (!in_array($thirdKey, self::$commonMenu) && stripos(str_replace('@', '/', $rights), ',' . substr($thirdKey, 1) . ',') === false) {
unset(self::$menu[$firstKey][$secondKey][$thirdKey]);
}
}
if (empty(self::$menu[$firstKey][$secondKey])) {
unset(self::$menu[$firstKey][$secondKey]);
}
}
}
if (empty(self::$menu[$firstKey])) {
unset(self::$menu[$firstKey]);
}
}
}
}
}
示例5: init
public function init()
{
CheckRights::checkUserRights();
if (ISafe::get('user_id') == '') {
$this->redirect('/simple/login');
}
}
示例6: user_ico_upload
function user_ico_upload()
{
$user_id = ISafe::get('user_id');
$result = array('isError' => true);
if (isset($_FILES['attach']['name']) && $_FILES['attach']['name'] != '') {
$photoObj = new PhotoUpload();
$photoObj->setThumb(100, 100, 'user_ico');
$photo = $photoObj->run();
if (!empty($photo['attach']['thumb']['user_ico'])) {
$user_id = ISafe::get('user_id');
$user_obj = new IModel('user');
$dataArray = array('head_ico' => $photo['attach']['thumb']['user_ico']);
$user_obj->setData($dataArray);
$where = 'id = ' . $user_id;
$isSuss = $user_obj->update($where);
if ($isSuss !== false) {
$result['isError'] = false;
$result['data'] = IUrl::creatUrl() . $photo['attach']['thumb']['user_ico'];
ISafe::set('head_ico', $dataArray['head_ico']);
} else {
$result['message'] = '上传失败';
}
} else {
$result['message'] = '上传失败';
}
} else {
$result['message'] = '请选择图片';
}
echo '<script type="text/javascript">parent.callback_user_ico(' . JSON::encode($result) . ');</script>';
}
示例7: onCreateController
/**
* @brief theme和skin进行选择
*/
public static function onCreateController()
{
$controller = func_num_args() > 0 && func_get_arg(0) ? func_get_arg(0) : IWeb::$app->controller;
/**
* 对于theme和skin的判断流程
* 1,直接从URL中获取是否已经设定了方案__theme,__skin
* 2,从cookie获取数据
*/
$urlTheme = IReq::get('__theme');
$urlSkin = IReq::get('__skin');
if ($urlTheme && $urlSkin && preg_match('|^\\w+$|', $urlTheme) && preg_match('|^\\w+$|', $urlSkin)) {
ISafe::set('__theme', $theme = $urlTheme);
ISafe::set('__skin', $skin = $urlSkin);
} elseif (ISafe::get('__theme') && ISafe::get('__skin')) {
$theme = ISafe::get('__theme');
$skin = ISafe::get('__skin');
}
if (isset($theme) && isset($skin)) {
$themePath = IWeb::$app->getViewPath() . $theme . "/" . IWeb::$app->controller->getId();
if (is_dir($themePath)) {
$controller->theme = $theme;
$controller->skin = $skin;
}
}
}
示例8: getAuthorize
/**
* 获取版权信息,存储到缓存中进行比对
* @return boolean
*/
public static function getAuthorize()
{
$iwebshopAuthorize = ISafe::get('iwebshopAuthorize');
if ($iwebshopAuthorize === null) {
$return = self::send('_c=system&_a=authorize&host=' . IUrl::getHost());
$iwebshopAuthorize = isset($return['success']) && $return['success'] == 1 ? true : false;
ISafe::set('iwebshopAuthorize', $iwebshopAuthorize);
}
return $iwebshopAuthorize;
}
示例9: onCreateController
/**
* @brief theme和skin进行选择
*/
public static function onCreateController()
{
$controller = func_num_args() > 0 ? func_get_arg(0) : IWeb::$app->controller;
//判断是否为后台管理控制器
if (in_array($controller->getId(), self::$syscontroller)) {
defined("IWEB_SCENE") ? "" : define("IWEB_SCENE", self::SCENE_SYSDEFAULT);
$controller->theme = self::$sysTheme;
$controller->skin = self::$sysSkin;
} elseif (in_array($controller->getId(), self::$sellercontroller)) {
defined("IWEB_SCENE") ? "" : define("IWEB_SCENE", self::SCENE_SYSSELLER);
$controller->theme = self::$sysSellerTheme;
$controller->skin = self::$sysSellerSkin;
} else {
defined("IWEB_SCENE") ? "" : define("IWEB_SCENE", self::SCENE_SITE);
/**
* 对于theme和skin的判断流程
* 1,直接从URL中获取是否已经设定了方案__theme,__skin
* 2,获取cookie中的方案名称
* 3,读取config配置中的默认方案
*/
$urlTheme = IReq::get('__theme');
$urlSkin = IReq::get('__skin');
if ($urlTheme && $urlSkin && preg_match('|^\\w+$|', $urlTheme) && preg_match('|^\\w+$|', $urlSkin)) {
ISafe::set('__theme', $controller->theme = $urlTheme);
ISafe::set('__skin', $controller->skin = $urlSkin);
} elseif (ISafe::get('__theme') && ISafe::get('__skin')) {
$controller->theme = ISafe::get('__theme');
$controller->skin = ISafe::get('__skin');
} else {
if (isset(IWeb::$app->config['theme'])) {
//根据不同的客户端进行智能选择
if (is_array(IWeb::$app->config['theme'])) {
$client = IClient::getDevice();
$controller->theme = isset(IWeb::$app->config['theme'][$client]) ? IWeb::$app->config['theme'][$client] : current(IWeb::$app->config['theme']);
} else {
$controller->theme = IWeb::$app->config['theme'];
}
}
if (isset(IWeb::$app->config['skin'])) {
//根据不同的客户端进行智能选择
if (is_array(IWeb::$app->config['skin'])) {
$client = IClient::getDevice();
$controller->skin = isset(IWeb::$app->config['skin'][$client]) ? IWeb::$app->config['skin'][$client] : current(IWeb::$app->config['skin']);
} else {
$controller->skin = IWeb::$app->config['skin'];
}
}
}
}
//修正runtime配置
IWeb::$app->runtimePath = IWeb::$app->getRuntimePath() . $controller->theme . '/';
IWeb::$app->webRunPath = IWeb::$app->getWebRunPath() . $controller->theme . '/';
}
示例10: show
/**
* @brief 展示插件
* @param string $name 用户名
* @param string $pwd 密码
*/
public function show($name = '', $pwd = '')
{
$sessionName = ISafe::name();
$sessionId = ISafe::id();
$uploadUrl = IUrl::creatUrl($this->submit);
$admin_name = $name == '' ? ISafe::get('admin_name') : $name;
$admin_pwd = $pwd == '' ? ISafe::get('admin_pwd') : $pwd;
echo <<<OEF
\t\t<script type="text/javascript">
\t\twindow.onload = function()
\t\t{
\t\t\tnew SWFUpload({
\t\t\t\t// Backend Settings
\t\t\t\tupload_url: "{$uploadUrl}",
\t\t\t\tpost_params: {"{$sessionName}": "{$sessionId}","admin_name":"{$admin_name}","admin_pwd":"{$admin_pwd}"},
\t\t\t\t// File Upload Settings
\t\t\t\tfile_types : "*.jpg;*.jpge;*.png;*.gif",
\t\t\t\t// Event Handler Settings - these functions as defined in Handlers.js
\t\t\t\t// The handlers are not part of SWFUpload but are part of my website and control how
\t\t\t\t// my website reacts to the SWFUpload events.
\t\t\t\tswfupload_preload_handler : preLoad,
\t\t\t\tswfupload_load_failed_handler : loadFailed,
\t\t\t\tfile_queue_error_handler : fileQueueError,
\t\t\t\tfile_dialog_complete_handler : fileDialogComplete,
\t\t\t\tupload_progress_handler : uploadProgress,
\t\t\t\tupload_error_handler : uploadError,
\t\t\t\tupload_success_handler : uploadSuccess,
\t\t\t\tupload_complete_handler : uploadComplete,
\t\t\t\t// Button Settings
\t\t\t\tbutton_placeholder_id : "uploadButton",
\t\t\t\tbutton_width: 50,
\t\t\t\tbutton_height: 21,
\t\t\t\tbutton_text : '选择...',
\t\t\t\tbutton_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
\t\t\t\tbutton_cursor: SWFUpload.CURSOR.HAND,
\t\t\t\t// Flash Settings
\t\t\t\tflash_url : "{$this->path}swfupload.swf",
\t\t\t\tcustom_settings : {
\t\t\t\t\tupload_target : "divFileProgressContainer"
\t\t\t\t},
\t\t\t\t// Debug Settings
\t\t\t\tdebug: false
\t\t\t});
\t\t};
\t\t</script>
OEF;
}
示例11: __construct
/**
* 构造函数
*/
public function __construct($user_id = null)
{
$this->user_id = $user_id ? $user_id : ISafe::get('user_id');
//获取用户组ID及组的折扣率
if ($this->user_id != null) {
$groupObj = new IModel('member as m , user_group as g');
$groupRow = $groupObj->getObj('m.user_id = ' . $this->user_id . ' and m.group_id = g.id', 'g.*');
if ($groupRow) {
$this->group_id = $groupRow['id'];
$this->group_discount = $groupRow['discount'] * 0.01;
}
}
}
示例12: getUser
/**
* @brief 获取通用的注册用户数组
*/
public static function getUser()
{
$user = array('user_id' => ISafe::get('user_id'), 'username' => ISafe::get('username'), 'head_ico' => ISafe::get('head_ico'), 'user_pwd' => ISafe::get('user_pwd'));
if (self::isValidUser($user['username'], $user['user_pwd'])) {
return $user;
} else {
ISafe::clear('user_id');
ISafe::clear('username');
ISafe::clear('head_ico');
ISafe::clear('user_pwd');
return null;
}
}
示例13: login_act
function login_act()
{
$admin_name = IFilter::act(IReq::get('admin_name'));
$password = IReq::get('password');
$captcha = IReq::get('captcha', 'post');
$message = '';
if ($admin_name == '') {
$message = '登录名不能为空';
} else {
if ($password == '') {
$message = '密码不能为空';
} else {
if ($captcha != ISafe::get('Captcha')) {
$message = '验证码输入不正确';
} else {
$adminObj = new IModel('admin');
$adminRow = $adminObj->getObj('admin_name = "' . $admin_name . '"');
if (!empty($adminRow) && $adminRow['password'] == md5($password) && $adminRow['is_del'] == 0) {
$dataArray = array('last_ip' => IClient::getIp(), 'last_time' => ITime::getDateTime());
$adminObj->setData($dataArray);
$where = 'id = ' . $adminRow["id"];
$adminObj->update($where);
//根据角色分配权限
if ($adminRow['role_id'] == 0) {
ISafe::set('admin_right', 'administrator');
ISafe::set('admin_role_name', '超级管理员');
} else {
$roleObj = new IModel('admin_role');
$where = 'id = ' . $adminRow["role_id"] . ' and is_del = 0';
$roleRow = $roleObj->getObj($where);
ISafe::set('admin_right', $roleRow['rights']);
ISafe::set('admin_role_name', $roleRow['name']);
}
ISafe::set('admin_id', $adminRow['id']);
ISafe::set('admin_name', $adminRow['admin_name']);
ISafe::set('admin_pwd', $adminRow['password']);
$this->redirect('/system/default');
} else {
$message = '用户名与密码不匹配';
}
}
}
}
if ($message != '') {
$this->admin_name = $admin_name;
$this->redirect('index', false);
Util::showMessage($message);
}
}
示例14: checkUserRights
public function checkUserRights()
{
$object = $this->ctrlObj;
$user = array();
$user['user_id'] = intval(ISafe::get('user_id'));
$user['username'] = ISafe::get('username');
$user['head_ico'] = ISafe::get('head_ico');
$user['user_pwd'] = ISafe::get('user_pwd');
if (self::isValidUser($user['username'], $user['user_pwd'])) {
$object->user = $user;
} else {
ISafe::clear('user_id');
ISafe::clear('user_pwd');
ISafe::clear('username');
ISafe::clear('head_ico');
}
}
示例15: checkUserRights
public static function checkUserRights()
{
$object = IWeb::$app->getController();
$user = array();
$user['user_id'] = intval(ISafe::get('user_id'));
$user['username'] = ISafe::get('username');
$user['head_ico'] = ISafe::get('head_ico');
$user['user_pwd'] = ISafe::get('user_pwd');
if (self::isValidUser($user['username'], $user['user_pwd'])) {
$object->user = $user;
} else {
ISafe::clear('user_id');
ISafe::clear('user_pwd');
ISafe::clear('username');
ISafe::clear('head_ico');
}
}