当前位置: 首页>>代码示例>>PHP>>正文


PHP ISafe类代码示例

本文整理汇总了PHP中ISafe的典型用法代码示例。如果您正苦于以下问题:PHP ISafe类的具体用法?PHP ISafe怎么用?PHP ISafe使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ISafe类的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);
 }
开发者ID:herrify,项目名称:iwebshop,代码行数:26,代码来源:other.php

示例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;
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:36,代码来源:balance.php

示例3: 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;
         }
     }
 }
开发者ID:herrify,项目名称:iwebshop,代码行数:28,代码来源:themeroute.php

示例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]);
                 }
             }
         }
     }
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:30,代码来源:menu.php

示例5: 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>';
 }
开发者ID:Wen1750686723,项目名称:utao,代码行数:30,代码来源:ucenter.php

示例6: 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, '校验码不正确');
     }
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:35,代码来源:pay_balance.php

示例7: logout

 function logout()
 {
     ISafe::clear('seller_id');
     ISafe::clear('seller_name');
     ISafe::clear('seller_pwd');
     ISafe::clearAll();
     $this->redirect('index');
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:8,代码来源:systemseller.php

示例8: logout

 function logout()
 {
     ISafe::clear('admin_id');
     ISafe::clear('admin_right');
     ISafe::clear('admin_name');
     ISafe::clear('admin_pwd');
     ISafe::clearAll();
     $this->redirect('index');
 }
开发者ID:xzdesk,项目名称:iwebshop.com,代码行数:9,代码来源:systemadmin.php

示例9: 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;
 }
开发者ID:zhendeguoke1008,项目名称:shop,代码行数:14,代码来源:proxy.php

示例10: 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 . '/';
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:56,代码来源:themeroute.php

示例11: 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;
    }
开发者ID:yongge666,项目名称:sunupedu,代码行数:58,代码来源:swfupload.php

示例12: __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;
         }
     }
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:16,代码来源:countsum.php

示例13: 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');
     }
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:17,代码来源:checkrights.php

示例14: 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');
     }
 }
开发者ID:zhendeguoke1008,项目名称:shop,代码行数:17,代码来源:checkrights.php

示例15: getCaptcha

 /**
  * @brief 生成验证码
  * @return image图像
  */
 public function getCaptcha()
 {
     //清空布局
     $this->layout = '';
     //配置参数
     $width = IReq::get('w') ? IReq::get('w') : 130;
     $height = IReq::get('h') ? IReq::get('h') : 45;
     $wordLength = IReq::get('l') ? IReq::get('l') : 5;
     $fontSize = IReq::get('s') ? IReq::get('s') : 25;
     //创建验证码
     $ValidateObj = new Captcha();
     $ValidateObj->width = $width;
     $ValidateObj->height = $height;
     $ValidateObj->maxWordLength = $wordLength;
     $ValidateObj->minWordLength = $wordLength;
     $ValidateObj->fontSize = $fontSize;
     $ValidateObj->CreateImage($text);
     //设置验证码
     ISafe::set('captcha', $text);
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:24,代码来源:controller_class.php


注:本文中的ISafe类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。