コード例 #1
0
 function step0()
 {
     //检测安装来源
     if (isset($_SERVER['HTTP_REFERER']) && false !== strpos($_SERVER['HTTP_REFERER'], 'operation')) {
         //从dz后台启动
         $this->_sess->setInfo('boot_referer', 'admincp');
     } else {
         //自启动(即在地址栏直接输入)
         $this->_sess->setInfo('boot_referer', 'self');
     }
     $image_file = "icon.gif";
     $showTab = 'info';
     $btn_enable = 'class="btn"';
     $btn_name = '确定卸载';
     $tokenhash = xwb_token::make('xwbuninstall', false);
     $link = '?step=1&delete_data=0&tokenhash=' . $tokenhash;
     include $this->tpl_dir . '/uninstall.php';
     exit;
 }
コード例 #2
0
 /**
  * 评论回推设置页面
  */
 function cfgPage()
 {
     if (!defined('XWB_S_IS_ADMIN') || !XWB_S_IS_ADMIN) {
         XWB_plugin::deny('');
     }
     $pushKey = strval(XWB_Plugin::pCfg('pushback_authkey'));
     if (empty($pushKey)) {
         $isOpen = 0;
     } else {
         $isOpen = 1;
     }
     $db = XWB_plugin::getDB();
     $query = $db->query('SELECT `cachekey`,`cachevalue` FROM ' . DB::table('common_cache') . " WHERE `cachekey` IN ('xwb_pushback_nexttime', 'xwb_pushback_lasttime')");
     $res = array();
     while ($row = $db->fetch_array($query)) {
         $res[$row['cachekey']] = $row['cachevalue'];
     }
     $lastUpdateTime = isset($res['xwb_pushback_lasttime']) ? (int) $res['xwb_pushback_lasttime'] : 0;
     $nextUpdateTime = isset($res['xwb_pushback_nexttime']) ? (int) $res['xwb_pushback_nexttime'] : 0;
     $fromid = (double) XWB_Plugin::pCfg('pushback_fromid');
     $tokenhash = xwb_token::make('pushback', true);
     include XWB_P_ROOT . '/tpl/plugin_cfg_pushback.tpl.php';
 }
コード例 #3
0
 /**
  * api通信设置
  */
 function apiCfg()
 {
     $tokenhash = xwb_token::make($this->tokehash, true);
     include XWB_P_ROOT . '/tpl/api_cfg_app_set.tpl.php';
 }
コード例 #4
0
 /**
  * 显示绑定时的错误信息
  * @param string $errorType 错误类型
  */
 function _showBindError($errorType = 'api')
 {
     $isBind = XWB_plugin::isUserBinded();
     //获取绑定关系
     $unbind_tokenhash = xwb_token::make('unbind', true);
     include XWB_P_ROOT . '/tpl/xwb_bind_error.tpl.php';
     exit;
 }
コード例 #5
0
 /**
  * 验算令牌token是否正确
  * @param string $type 类型,可选值:g/p/c/r
  * @param string $hashadd 
  * @param string $useBindData 默认为false
  * @return bool
  */
 function checkInput($type = 'p', $hashadd = '', $useBindData = false)
 {
     if (XWB_plugin::V($type . ':' . XWB_TOKEN_NAME) != xwb_token::make($hashadd, $useBindData)) {
         return false;
     } else {
         return true;
     }
 }