當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。