예제 #1
0
 public function content()
 {
     global $dbh, $postvar, $getvar, $instance;
     if ($_POST) {
         check::empty_fields();
         if (!main::errors()) {
             $user = $dbh->staff($_SESSION['user']);
             if (!$user['password']) {
                 main::errors("Wrong username!?");
             } else {
                 if (crypto::passhash($postvar['old'], $user['salt']) == $user['password']) {
                     if ($postvar['new'] != $postvar['confirm']) {
                         main::errors("Your passwords don't match!");
                     } else {
                         $salt = crypto::salt();
                         $newpass = crypto::passhash($postvar['new'], $salt);
                         $update_staff = array("password" => $newpass, "salt" => $salt);
                         $dbh->update("staff", $update_staff, array("id", "=", $_SESSION['user']));
                         main::errors("Password changed!");
                     }
                 } else {
                     main::errors("Your old password was wrong!");
                 }
             }
         }
     }
     echo style::replaceVar("tpl/admin/change-admin-password.tpl");
 }
예제 #2
0
 function saveInfo($arrData, $intModify = 0, $isAlert = true, $isLastID = false)
 {
     global $arrGWeb;
     $arr = array();
     $arr = check::SqlInjection($this->saveTableFieldG($arrData));
     if ($intModify == 0) {
         if ($this->insertInfo($arr)) {
             if ($isAlert) {
                 check::Alert("恭喜你,订阅成功!系统将返回到首页", $arrGWeb['WEB_ROOT_pre'] . '/index.php');
             } else {
                 return true;
             }
         } else {
             if ($isAlert) {
                 check::Alert("订阅失败", -1);
             } else {
                 return false;
             }
         }
     } else {
         if ($this->updateInfo($arr)) {
             if ($isAlert) {
                 check::Alert("退订成功!系统将返回到首页", $arrGWeb['WEB_ROOT_pre'] . '/index.php');
             } else {
                 return true;
             }
         } else {
             if ($isAlert) {
                 check::Alert("退订失败", $arrGWeb['WEB_ROOT_pre'] . '/index.php');
             } else {
                 return false;
             }
         }
     }
 }
예제 #3
0
/**
 * Smarty truncate modifier plugin
 *
 * Type:     modifier<br>
 * Name:     truncate<br>
 * Purpose:  Truncate a string to a certain length if necessary,
 *           optionally splitting in the middle of a word, and
 *           appending the $etc string or inserting $etc into the middle.
 * @link http://smarty.php.net/manual/en/language.modifier.truncate.php
 *          truncate (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param string
 * @param integer
 * @param string
 * @param boolean
 * @param boolean
 * @return string
 */
function smarty_modifier_api($array, $class, $fun, $args = '', $debug = false)
{
    if (empty($class) || empty($fun)) {
        return $array;
    }
    $result = check::getAPI($class, $fun, $args, $debug);
    return $result;
}
예제 #4
0
/**
 * Smarty truncate modifier plugin
 *
 * Type:     modifier<br>
 * Name:     truncate<br>
 * Purpose:  Truncate a string to a certain length if necessary,
 *           optionally splitting in the middle of a word, and
 *           appending the $etc string or inserting $etc into the middle.
 * @link http://smarty.php.net/manual/en/language.modifier.truncate.php
 *          truncate (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param string
 * @param integer
 * @param string
 * @param boolean
 * @param boolean
 * @return string
 */
function smarty_modifier_imgurl($string, $module = '')
{
    global $arrGWeb;
    if (empty($module)) {
        $module = $arrGWeb['module_id'];
    }
    return check::getImgUrl($module);
}
예제 #5
0
/**
 * Smarty truncate modifier plugin
 *
 * Type:     modifier<br>
 * Name:     truncate<br>
 * Purpose:  Truncate a string to a certain length if necessary,
 *           optionally splitting in the middle of a word, and
 *           appending the $etc string or inserting $etc into the middle.
 * @link http://smarty.php.net/manual/en/language.modifier.truncate.php
 *          truncate (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param string
 * @param integer
 * @param string
 * @param boolean
 * @param boolean
 * @return string
 */
function smarty_modifier_age($date, $blday = true)
{
    if ($date == '0000-00-00') {
        return '0';
    } else {
        return check::birthday2age($date, $blday);
    }
}
예제 #6
0
function long_long_equal($a, $b, $message)
{
    if (!($a === $b)) {
        if (!((double) $a === $b)) {
            return check::fail($message . ": '{$a}'!=='{$b}'");
        }
    }
    return TRUE;
}
예제 #7
0
 function __tostring()
 {
     $input1 = "";
     if ($this->number == 0) {
         $input1 .= "<script>alert('查不到');history.back();</script>";
     } else {
         foreach ($this->info as $value) {
             $sql = "select * from t_wz";
             $f = new check($sql);
             $input1 .= "<div class='post' id='post-001'>";
             $input1 .= "<h1>" . $value['title'] . "</h1>";
             $input1 .= "<small>" . $value['sj'] . "|</small> <a>分类:" . $value['kind'] . "</a>";
             $input1 .= "<div id='rensheng'><img src='../img/" . $value['id'] . ".jpg'></div>";
             $input1 .= "<div id='comments'><a href='blog_main.php?action=article2&id=" . $value['id'] . "'>readermore</a> <a>|</a><a>comments(" . $f->check1($value['id']) . ")</a></div>";
             $input1 .= " </div>";
         }
     }
     return $input1;
 }
예제 #8
0
/**
 * Smarty truncate modifier plugin
 *
 * Type:     modifier<br>
 * Name:     truncate<br>
 * Purpose:  Truncate a string to a certain length if necessary,
 *           optionally splitting in the middle of a word, and
 *           appending the $etc string or inserting $etc into the middle.
 * @link http://smarty.php.net/manual/en/language.modifier.truncate.php
 *          truncate (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param string
 * @param integer
 * @param string
 * @param boolean
 * @param boolean
 * @return string
 */
function smarty_modifier_ip_replace($ip, $start = 4, $ellipsis = '*')
{
    if (check::FormatIP($ip)) {
        $start = $start - 1;
        $arrIP = explode('.', $ip);
        foreach ($arrIP as $k => $v) {
            if ($k >= $start) {
                $arrIP[$k] = $ellipsis;
            }
        }
        $ip = implode('.', $arrIP);
        return $ip;
    }
}
예제 #9
0
 /**
  * 上传文件
  * @author	肖飞
  * @param array	 	$arrFile			图片文件信息数组$_FILES
  * @param int 		$PR					自动压缩的比例
  * @param int		$intID				内容ID,标示新增还是修改
  * @return unknown
  */
 function uploadInfoImage($arrFile, $PR = 0, $intID = 0)
 {
     if ($arrFile['name']) {
         if (!in_array(strtolower($arrFile['type']), array('image/jpg', 'image/jpeg', 'image/gif', 'image/pjpeg', 'image/png', 'image/x-png', 'application/x-shockwave-flash'))) {
             check::AlertExit('文件类型不符合要求(' . $arrFile['type'] . ')', -1);
         }
     }
     if ($intID == 0) {
         $intID = $this->getMaxID();
     }
     $strDir = ceil($intID / 1000);
     $strMakeDir = $this->arrGPic['FileSavePath'] . $strDir;
     if (!is_dir($this->arrGPic['FileSavePath'])) {
         @mkdir($this->arrGPic['FileSavePath']);
         @chmod($this->arrGPic['FileSavePath'], 0777);
     }
     if (!is_dir($strMakeDir)) {
         @mkdir($strMakeDir);
         @chmod($strMakeDir, 0777);
     }
     $FileExt = strrchr($arrFile['name'], ".");
     //取得上传文件扩展名
     $strPhoto = $strDir . "/" . $intID . "_" . time() . $FileExt;
     //存入数据库的图片访问路径
     $strPicName = $strMakeDir . "/" . $intID . "_" . time() . $FileExt;
     //新图片路径及名称
     if ($arrFile['type'] != 'application/x-shockwave-flash' && $arrFile['size'] > $this->arrGPic['FileMaxSize']) {
         if ($PR != 0) {
             move_uploaded_file($arrFile['tmp_name'], $strPicName);
             $objGDImage = new GDImage();
             if ($objGDImage->makePRThumb($strPicName, $PR)) {
                 return $strPhoto;
             } else {
                 check::AlertExit($strPicName . "文件上传错误!", -1);
             }
         } else {
             check::AlertExit("文件大小不符合要求!", -1);
         }
     } else {
         if (move_uploaded_file($arrFile['tmp_name'], $strPicName)) {
             return $strPhoto;
         } else {
             check::AlertExit($strPicName . "文件上传错误!", -1);
         }
     }
 }
예제 #10
0
 public function import()
 {
     global $dbh, $postvar, $getvar, $instance;
     if (!$_POST) {
         $servers_query = $dbh->select("servers", array("type", "=", "zpanel"), 0, 0, 1);
         while ($servers_data = $dbh->fetch_array($servers_query)) {
             $values[] = array($servers_data['name'], $servers_data['id']);
         }
         $zpanel_array['DROPDOWN'] = main::dropdown("server", $values);
         echo style::replaceVar("tpl/admin/import/zpanel.tpl", $zpanel_array);
     } elseif ($_POST) {
         $postvar['server'] = $postvar['server'];
         //Hack to make sure we post the 'server' field as it doesn't post if it's empty.
         check::empty_fields();
         if (main::errors()) {
             echo "<ERRORS>";
         } else {
             $n = 0;
             include INC . "/servers/zpanel.php";
             $zpanel = new zpanel($postvar['server']);
             $zpanel_accounts = $zpanel->listaccs($postvar['server']);
             foreach ($zpanel_accounts as $zpanel_data) {
                 $packages_data = $dbh->select("packages", array("backend", "=", $zpanel_data['package']));
                 $users_data = $dbh->select("users", array("user", "=", $zpanel_data['user']));
                 if (!$packages_data['id']) {
                     $packages_insert = array("name" => $zpanel_data['package'], "backend" => $zpanel_data['package'], "description" => "Imported from ZPanel: " . $zpanel_data['package'], "type" => "free", "server" => $postvar['server'], "admin" => "1");
                     $dbh->insert("packages", $packages_insert);
                 }
                 $new_packages_data = $dbh->select("packages", array("backend", "=", $zpanel_data['package']));
                 if (!$users_data['id']) {
                     $salt = crypto::salt();
                     $newpass = crypto::passhash(rand(), $salt);
                     $users_insert = array("user" => $zpanel_data['user'], "zpanel_uid" => $zpanel_data['user'], "email" => $zpanel_data['user'], "password" => $zpanel_data['user'], "salt" => $zpanel_data['user'], "signup" => $zpanel_data['user'], "status" => $zpanel_data['user'], "domain" => $zpanel_data['user'], "pid" => $zpanel_data['user']);
                     $dbh->insert("users", $users_insert);
                     $dbh->insert("users_bak", $users_insert);
                     $n++;
                 }
             }
             echo $n . " Accounts have been imported";
         }
     }
 }
예제 #11
0
 /**
  * 保存信息内容
  * @author	肖飞
  * @param	int $arrData    信息信息数组
  * @return  void
  */
 function saveInfo($arrData, $intModify = 0, $isAlert = true)
 {
     $arr = array();
     $arr = check::SqlInjection($this->saveTableFieldG($arrData));
     if ($intModify == 0) {
         if (!empty($_SESSION['user_id'])) {
             $arr['user_id'] = intval($_SESSION['user_id']);
         }
         if ($this->insertInfo($arr)) {
             if ($isAlert) {
                 check::Alert("预约成功,我们会尽快通知您,祝您生活愉快", -1);
             }
             check::AlertExit("", $arrGWeb['WEB_ROOT_pre'] . "/xingfu_apply/");
         } else {
             check::Alert("发布失败", -1);
         }
     } else {
         if ($this->updateInfo($arr)) {
             check::Alert("修改成功!");
         } else {
             check::Alert("修改失败");
         }
     }
 }
예제 #12
0
 /**
  * 执行信息操作
  * @author	肖飞
  * @param	string	$strAction		执行命令
  * @param	array		$arrData		选中的操作数据id数组
  * @param	array		$arrFile			需要删除的文件
  * @return	boolen
  */
 public function doInfoAction($strAction = null, $arrData = null, $arrFile = array('photo'))
 {
     switch ($strAction) {
         case 'del':
             foreach ($arrData as $key => $val) {
                 if (!$this->checkPopedomG($_SESSION['user_id'], 'd')) {
                     check::AlertExit('对不起,您没有删除权限', -1);
                 }
                 $this->deleteInfo($val, $arrFile);
             }
             break;
         case 'delpic':
             foreach ($arrData as $key => $val) {
                 if (!$this->checkPopedomG($_SESSION['user_id'], 'd')) {
                     check::AlertExit('对不起,您没有删除权限', -1);
                 }
                 $this->deleteInfoPic($val, $arrFile);
             }
             break;
         case 'moveup':
             foreach ($arrData as $key => $val) {
                 if (!$this->checkPopedomG($_SESSION['user_id'], 'x')) {
                     check::AlertExit('对不起,您没有执行权限', -1);
                 }
                 $this->moveupInfo($val);
             }
             break;
         case 'check':
             foreach ($arrData as $key => $val) {
                 if (!$this->checkPopedomG($_SESSION['user_id'], 'x')) {
                     check::AlertExit('对不起,您没有执行权限', -1);
                 }
                 $this->passInfo($val, 1);
             }
             break;
         case 'uncheck':
             foreach ($arrData as $key => $val) {
                 if (!$this->checkPopedomG($_SESSION['user_id'], 'x')) {
                     check::AlertExit('对不起,您没有执行权限', -1);
                 }
                 $this->passInfo($val, 0);
             }
             break;
         case 'settop':
             foreach ($arrData as $key => $val) {
                 if (!$this->checkPopedomG($_SESSION['user_id'], 'x')) {
                     check::AlertExit('对不起,您没有执行权限', -1);
                 }
                 $this->topInfo($val, 1);
             }
             break;
         case 'unsettop':
             foreach ($arrData as $key => $val) {
                 if (!$this->checkPopedomG($_SESSION['user_id'], 'x')) {
                     check::AlertExit('对不起,您没有执行权限', -1);
                 }
                 $this->topInfo($val, 0);
             }
             break;
         case 'setrecommend':
             foreach ($arrData as $key => $val) {
                 if (!$this->checkPopedomG($_SESSION['user_id'], 'x')) {
                     check::AlertExit('对不起,您没有执行权限', -1);
                 }
                 $this->recommendInfo($val, 1);
             }
             break;
         case 'unsetrecommend':
             foreach ($arrData as $key => $val) {
                 if (!$this->checkPopedomG($_SESSION['user_id'], 'x')) {
                     check::AlertExit('对不起,您没有执行权限', -1);
                 }
                 $this->recommendInfo($val, 0);
             }
             break;
     }
     return true;
 }
예제 #13
0
    }
    if (is_array($_POST['photo'])) {
        $_POST['thumbnail'] = $_POST['photo'][0]['photo'];
    } else {
        $_POST['thumbnail'] = $_POST['photo'];
    }
    $_POST['photo'] = array_values($_POST['photo']);
    $_POST['video'] = array_values($_POST['video']);
    #自动拆字生成tag
    if (empty($_POST['tag'])) {
        $objSP = new SplitWord();
        $_POST['tag'] = $objSP->SplitRMM($_POST['title'], false);
    }
    $_POST = array_merge($arrInfo, $_POST);
    $objWebInit->saveInfo($_POST, 1);
    $objWebInit->updateCache($_POST['id'], $_POST['type_id'], $arrMOutput);
    check::WindowLocation('index.php', 'page=' . $_GET['page']);
}
if (!is_array($arrMType) || empty($arrMType)) {
    $arrMType = $objWebInit->getTypeList();
    $arrMType = $objWebInit->formatTypeList(0, $arrMType);
}
// 输出到模板
$arrMOutput["template_file"] = "admin.html";
$arrMOutput["smarty_assign"]['FileCallPath'] = $objWebInit->arrGPic['FileCallPath'];
$arrMOutput["smarty_assign"]['FileListPicSize'] = $objWebInit->arrGPic['FileListPicSize'];
$arrMOutput["smarty_assign"]['arrData'] = $arrInfo;
$arrMOutput["smarty_assign"]['arrMType'] = $arrMType;
$arrMOutput["smarty_assign"]['action_type'] = "save";
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['admin_main_dir'] . 'submit.htm';
$objWebInit->output($arrMOutput);
예제 #14
0
require "tests.php";
require "exception_order.php";
check::functions(array(a_foo, a_bar, a_foobar, a_barfoo));
check::classes(array(A, E1, E2, E3, exception_order, ET_i, ET_d));
check::globals(array(efoovar, foovar, cfoovar, a_sfoovar, a_foovar, a_efoovar));
$a = new A();
try {
    $a->foo();
} catch (Exception $e) {
    check::equal($e->getMessage(), 'C++ E1 exception thrown', '');
}
try {
    $a->bar();
} catch (Exception $e) {
    check::equal($e->getMessage(), 'C++ E2 exception thrown', '');
}
try {
    $a->foobar();
} catch (Exception $e) {
    check::equal($e->getMessage(), 'postcatch unknown', '');
}
try {
    $a->barfoo(1);
} catch (Exception $e) {
    check::equal($e->getMessage(), 'C++ E1 exception thrown', '');
}
try {
    $a->barfoo(2);
} catch (Exception $e) {
    check::equal($e->getMessage(), 'C++ E2 * exception thrown', '');
}
예제 #15
0
/**
 * Smarty truncate modifier plugin
 *
 * Type:     modifier<br>
 * Name:     truncate<br>
 * Purpose:  Truncate a string to a certain length if necessary,
 *           optionally splitting in the middle of a word, and
 *           appending the $etc string or inserting $etc into the middle.
 * @link http://smarty.php.net/manual/en/language.modifier.truncate.php
 *          truncate (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param string
 * @param integer
 * @param string
 * @param boolean
 * @param boolean
 * @return string
 */
function smarty_modifier_age($date, $blday = false)
{
    return check::birthday2age($date, $blday);
}
예제 #16
0
    check::AlertExit('对不起,您没有权限访问此页', -1);
}
if (empty($_GET['path'])) {
    $arrMOutput["template_file"] = 'siteset/template_right_index.htm';
} else {
    $path = $_GET['path'];
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $strFileName = $_SESSION['fileName'];
        $content = str_replace('\\', '', $_POST['content']);
        if (is_writable($strFileName)) {
            $fp = fopen($strFileName, 'w');
            fputs($fp, $content);
            fclose($fp);
            check::AlertExit('修改成功', -1);
        } else {
            check::AlertExit('很遗憾,template/ 下文件没有写权限!', -1);
        }
    }
    $strFileName = __WEB_ROOT . '/templates/' . $arrGWeb['templates_id'] . '/' . $path;
    $_SESSION['fileName'] = $strFileName;
    $fp = fopen($strFileName, 'r');
    $contents = fread($fp, filesize($strFileName));
    fclose($fp);
    //文件类型
    $opeType = substr(strrchr($path, '.'), 1);
    $arrMOutput["smarty_assign"]['contents'] = $contents;
    $arrMOutput["smarty_assign"]['strType'] = $opeType;
    $arrMOutput["template_file"] = 'siteset/template_right.htm';
}
// 输出到模板
$objWebInit->output($arrMOutput);
예제 #17
0
파일: install.php 프로젝트: TiMoChao/xingfu
    $strWEBADMIN_ROOT = __WEBADMIN_ROOT;
}
unset($arrGWeb);
if (empty($ver_path)) {
    $ver_path = '';
}
$strFilename = '..' . $ver_path . '/data/webconfig.inc.php';
include $strFilename;
$arrGMeta['xingfu_school_show']['name'] = '兴甫幼儿园_ 园所展区';
$arrGMeta['xingfu_school_show']['cache'] = 1;
//该栏目是否生成静态页,0=不可以,1=可以
$arrGMeta['xingfu_school_show']['admin'] = array(array('href' => '../xingfu_school_show/admin/category.php', 'name' => '兴甫幼儿园_ 园所展区分类'), array('href' => '../xingfu_school_show/admin/index.php', 'name' => '兴甫幼儿园_ 园所展区管理'));
$arrGMeta['xingfu_school_show']['meta'] = array('Title' => $arrGMeta['xingfu_school_show']['name'], 'Description' => $arrGMeta['xingfu_school_show']['name'], 'Keywords' => $arrGMeta['xingfu_school_show']['name']);
$somecontent = '<?php' . "\n" . '$arrGWeb = ' . var_export($arrGWeb, true) . ';' . "\n" . '$arrGMeta = ' . var_export($arrGMeta, true) . ';' . "\n" . '?>';
//写入文件
file_put_contents($strFilename, $somecontent);
//sql语句
if ($_SESSION['install_type']) {
    $sql[] = "DROP TABLE IF EXISTS `" . $arrGPdoDB['db_tablepre'] . "xingfu_school_show`;";
}
$sql[] = "CREATE TABLE IF NOT EXISTS `" . $arrGPdoDB['db_tablepre'] . "xingfu_school_show` (\n  `id` int(10) unsigned NOT NULL auto_increment,\n  `type_id` tinyint(3) unsigned default '0',\n  `type_roue_id` varchar(80) default NULL,\n  `user_id` int(10) unsigned default '0',\n  `tag` varchar(30) default NULL,\n  `bedeck` tinyint(3) unsigned default '0',\n  `title` varchar(100) default NULL,\n  `title_md5` char(32) default NULL,\n  `linkurl` varchar(100) default NULL,\n  `summary` varchar(" . $intDbSummaryLen . ") default NULL,\n  `structon_tb` mediumtext,\n  `thumbnail` varchar(30) default NULL,\n  `submit_date` datetime default '0000-00-00 00:00:00',\n  `topflag` tinyint(1) default '0',\n  `recommendflag` tinyint(1) default '0',\n  `stars` tinyint(1) default '0',\n  `clicktimes` mediumint(10) unsigned default '0',\n  `pass` tinyint(1) default '1',\n  PRIMARY KEY  (`id`),\n  KEY `user_id` (`user_id`),\n  KEY `type_id` (`type_id`),\n  KEY `title_md5` (`title_md5`),\n  KEY `submit_date` (`submit_date`)\n) ENGINE=MyISAM {$extend} COMMENT='兴甫幼儿园_ 园所展区表' ;";
if ($_SESSION['install_type']) {
    $sql[] = "DROP TABLE IF EXISTS `" . $arrGPdoDB['db_tablepre'] . "xingfu_school_show_type`;";
}
$sql[] = "CREATE TABLE IF NOT EXISTS `" . $arrGPdoDB['db_tablepre'] . "xingfu_school_show_type` (\n  `type_id` int(10) unsigned NOT NULL auto_increment,\n  `type_parentid` int(10) unsigned NOT NULL default '0',\n  `type_roue_id` varchar(80) default NULL,\n  `type_title` varchar(80) default NULL,\n  `type_link` varchar(150) default NULL COMMENT '跳转链接',\n  `type_sort` int(10) unsigned default NULL,\n  `type_pass` tinyint(1) NOT NULL default '1',\n  `type_read_grade` tinyint(1) NOT NULL default '0',\n  `type_write_grade` tinyint(1) NOT NULL default '0',\n  PRIMARY KEY  (`type_id`),\n  KEY `type_parentid` (`type_parentid`),\n  KEY `type_sort` (`type_sort`)\n) ENGINE=MyISAM  {$extend} COMMENT='兴甫幼儿园_ 园所展区分类表' ;";
foreach ($sql as $val) {
    $objWebInit->db->query($val);
}
if (empty($arrModule)) {
    check::AlertExit('兴甫幼儿园_ 园所展区系统安装成功', "{$strWEB_ROOT_pre}{$strWEBADMIN_ROOT}/");
}
예제 #18
0
require_once '../../admin/checklogin.php';
$objWebInit = new ads();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
$objWebInit->db();
//JS生成参数
$objWebInit->arrGjs = $arrGjs;
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'])) {
    check::AlertExit('对不起,您没有权限访问此页', -1);
}
$arrWhere = array();
$arrLink = array();
if (isset($_GET['action'])) {
    if ($_GET['action'] == 'search') {
        // 构造搜索条件和翻页参数
        $arrLink[] = 'action=search';
        if (!empty($_GET['pass'])) {
            if ($_GET['pass'] == '1' || $_GET['pass'] == '0') {
                $arrWhere[] = "pass='******'pass'] . "'";
                $arrLink[] = 'pass='******'pass'];
            }
        }
        if (!empty($_GET['id'])) {
            $arrWhere[] = "id='" . $_GET['id'] . "'";
예제 #19
0
 public function content()
 {
     global $dbh, $postvar, $getvar, $instance;
     switch ($getvar['sub']) {
         case "tchoose":
             if ($_POST) {
                 check::empty_fields();
                 if (!main::errors()) {
                     foreach ($postvar as $key => $value) {
                         $dbh->updateConfig($key, $value);
                     }
                     main::errors("Settings Updated!");
                 }
             }
             $folder = "../themes/";
             if ($handle = opendir($folder)) {
                 while (false !== ($file = readdir($handle))) {
                     if ($file != "." && $file != ".." && $file != ".svn" && $file != "icons" && $file != "index.html" && $file != "flags") {
                         $values[] = array($file, $file);
                     }
                 }
             }
             closedir($handle);
             $theme_settings_array['THEME'] = main::dropDown("theme", $values, $dbh->config("theme"));
             echo style::replaceVar("tpl/admin/lof/theme-settings.tpl", $theme_settings_array);
             break;
         case "tupload":
             // Theme Uploader
             echo "Here you can upload a theme of your choice to the installer. Please be sure that the theme is in .zip format.<br><br>";
             if ($_POST) {
                 $response = main::upload_theme();
                 echo $response . "<br><br>";
             }
             echo style::replaceVar('tpl/admin/lof/theme-upload.tpl');
             break;
         case "cssedit":
             echo $this->EditTemplate("style", "css");
             break;
         case "tpledit":
             echo style::replaceVar('tpl/admin/lof/template-editor.tpl');
             break;
         case "navedit":
             echo style::replaceVar("tpl/admin/lof/navedit/top.tpl");
             $navbar_query = $dbh->select("navbar", 0, array("sortorder", "ASC"));
             while ($navbar_data = $dbh->fetch_array($navbar_query)) {
                 $link_box_array['ID'] = $navbar_data['id'];
                 $link_box_array['NAME'] = $navbar_data['visual'];
                 $link_box_array['ICON'] = $navbar_data['icon'];
                 $link_box_array['LINK'] = $navbar_data['link'];
                 $links_array['LINKS'] .= style::replaceVar("tpl/admin/lof/navedit/link-box.tpl", $link_box_array);
             }
             echo style::replaceVar("tpl/admin/lof/navedit/links.tpl", $links_array);
             echo style::replaceVar("tpl/admin/lof/navedit/bottom.tpl");
             break;
         case "editheader":
             echo $this->EditTemplate("header", "tpl");
             break;
         case "editfooter":
             echo $this->EditTemplate("footer", "tpl");
             break;
         case "ui-theme":
             if ($_POST) {
                 check::empty_fields();
                 if (!main::errors()) {
                     foreach ($postvar as $key => $value) {
                         $dbh->updateConfig($key, $value);
                     }
                     main::errors("Settings Updated!");
                 }
             }
             $folder = INC . "/css/";
             foreach (main::folderFiles($folder) as $file) {
                 $files[] = array($file, $file);
             }
             $jquery_theme_changer_array['THEME'] = main::dropDown("ui-theme", $files, $dbh->config("ui-theme"));
             echo style::replaceVar('tpl/admin/lof/jquery-theme-changer.tpl', $jquery_theme_changer_array);
             break;
     }
 }
예제 #20
0
파일: index.php 프로젝트: TiMoChao/xingfu
            $arrWhere[] = "type_id='" . $intTypeID . "' or type_roue_id like '%:{$intTypeID}:%'";
            $arrLink[] = 'type_id=' . $intTypeID;
        }
        if (!empty($_GET['state'])) {
            $intState = intval($_GET['state']);
            $arrWhere[] = " state = '{$intState}' ";
            $arrLink[] = 'state=' . $intState;
        }
    } else {
        if ($_GET['action'] == 'del') {
            if (!$objWebInit->checkPopedomG($_SESSION['user_id'], 'd')) {
                check::AlertExit('对不起,您没有删除权限', -1);
            }
        } else {
            if (!$objWebInit->checkPopedomG($_SESSION['user_id'], 'w')) {
                check::AlertExit('对不起,您没有写权限', -1);
            }
        }
        $objWebInit->doInfoAction($_GET['action'], $_POST['select']);
    }
}
if (!empty($_GET['title'])) {
    $strKeywords = strval(urldecode($_GET['title']));
    if ($strKeywords[0] == '/') {
        //精确查询ID
        $strKeywords = substr($strKeywords, 1);
        if (is_numeric($strKeywords)) {
            $arrWhere[] = "id = '" . $strKeywords . "'";
        }
    } else {
        $arrWhere[] = "title LIKE '%" . $_GET['title'] . "%'";
예제 #21
0
 /**
  * Email是否重复检查
  */
 public function ajaxemailAction()
 {
     $email = $this->post('email');
     if (!check::is_email($email)) {
         exit('<b><font color=red>' . lang('a-mem-21') . '</font></b>');
     }
     $id = $this->post('id');
     if (empty($email)) {
         exit('<b><font color=red>' . lang('a-mem-22') . '</font></b>');
     }
     $where = $id ? "email='" . $email . "' and id<>" . $id : "email='" . $email . "'";
     $data = $this->member->getOne($where);
     if ($data) {
         exit('<b><font color=red>' . lang('a-mem-23') . '</font></b>');
     }
     exit('<b><font color=green>√</font></b>');
 }
예제 #22
0
if ($arrGWeb['isSubUrl']) {
    if (strpos($_SERVER['HTTP_HOST'], $arrGWeb['subPre']) === false) {
        $_SESSION['langset'] = 'zh_cn';
    } else {
        $_SESSION['langset'] = 'zh_tw';
    }
} elseif (empty($_SESSION['langset'])) {
    $_SESSION['langset'] = 'zh_cn';
}
//取的网站前缀,用于退出等功能
if (empty($_SESSION['WEB_ROOT_pre'])) {
    $_SESSION['WEB_ROOT_pre'] = $arrGWeb['WEB_ROOT_pre'];
}
//取得浏览器版本
if (empty($_SESSION['browser'])) {
    $_SESSION['browser'] = check::BrowserVer();
}
//数据库全局配置文件
include_once __WEB_ROOT . '/config/pdodb.inc.php';
//静态页面缓存参数
$arrGCache = array();
$arrGCache['cache_root'] = __WEB_ROOT . $arrGWeb['cache_url'];
$arrGCache['cache_filenum'] = 2500;
//同一目录存放多少个文件,建议不超过3000
//上传图片处理参数
$arrGPic = array();
$arrGPic['waterMark'] = $arrGWeb['waterMark'];
$arrGPic['waterPos'] = $arrGWeb['waterPos'];
$arrGPic['waterImage'] = $arrGWeb['waterImage'];
$arrGPic['zoomMode'] = $arrGWeb['zoomMode'];
//smarty参数
예제 #23
0
<?php

// direct access protection
if (!defined('KIRBY')) {
    die('Direct access is not allowed');
}
if (check::wrongKirbyVersion()) {
    $step = 3;
} else {
    if (check::installed()) {
        $step = 2;
    } else {
        $step = 1;
    }
}
function relativePath($path)
{
    return str_replace(server::get('DOCUMENT_ROOT'), '', $path);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
  
<title>Kirby Panel Installation</title>
<meta charset="utf-8" />
<meta name="robots" content="noindex, nofollow" />

<style>

* {
예제 #24
0
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (!$objWebInit->checkPopedomG($_SESSION['user_id'], 'w', 'siteset')) {
        check::AlertExit('对不起,您没有写权限', -1);
    }
    unset($_POST['okgo']);
    unset($arrGWeb);
    $strFilename = '../../data/webconfig.inc.php';
    include $strFilename;
    foreach ($arrGWeb as $k => $v) {
        foreach ($_POST as $k1 => $v1) {
            if ($k == $k1) {
                $arrGWeb[$k] = $_POST[$k1];
            }
        }
    }
    $somecontent = '<?php' . "\n" . '$arrGWeb = ' . var_export($arrGWeb, true) . ';' . "\n" . '$arrGMeta = ' . var_export($arrGMeta, true) . ';' . "\n" . '?>';
    if (!($handle = fopen($strFilename, 'w'))) {
        check::AlertExit("错误:不能打开文件 {$strFilename} !", -1);
    }
    // 将$somecontent写入到我们打开的文件中。
    if (fwrite($handle, $somecontent) === FALSE) {
        check::AlertExit("错误:不能写入到文件 {$strFilename} !", -1);
    }
    fclose($handle);
    check::AlertExit("成功地写入到文件 {$strFilename} !", -1);
}
// 输出到模板
$arrMOutput["smarty_assign"]['strNav'] = '网站缓存设置';
$arrMOutput["template_file"] = "admin.html";
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['admin_main_dir'] . 'siteset/cache_set.htm';
$objWebInit->output($arrMOutput);
예제 #25
0
                        if ($strReturnCode == "5") {
                            check::Alert("手机号或发送信息不能为空", -1);
                        } else {
                            if ($strReturnCode == "6") {
                                check::Alert("超过每次提交100个号码的下发限制!", -1);
                            } else {
                                if ($strReturnCode == "7") {
                                    check::Alert("超过XX个字,请修改后发送!", -1);
                                } else {
                                    if ($strReturnCode == "8") {
                                        check::Alert("用户已冻结,请联系客服人员", -1);
                                    } else {
                                        if ($strReturnCode == "0009") {
                                            check::Alert("参数无效!", -1);
                                        } else {
                                            check::Alert("未知错误!", -1);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
$objSms = new BizSMS();
$objSms->setParam($yx_arrMBizParam);
$message = $objSms->getMsgInfo();
$objSms->setParam($arrMBizParam);
예제 #26
0
파일: search.php 프로젝트: TiMoChao/xingfu
$strWhere = 'where ' . $strWhere;
$intStart = ($intPage - 1) * $objWebInit->arrGPage['page_size'];
$arrInfoList = check::getAPI($strModuleID, "getInfoList", "{$strWhere}^ ORDER BY topflag DESC,submit_date DESC^{$intStart}^{$arrGPage['page_size']}^id,title,clicktimes");
$intRows = $arrInfoList['COUNT_ROWS'];
unset($arrInfoList['COUNT_ROWS']);
//翻页跳转
if (!empty($arrLink)) {
    $strLink = implode('&', $arrLink);
}
$arrListPage = $objWebInit->makeInfoListPage($intRows, $strLink, $link_type = 2);
//print_r($arrListPage);
include_once 'include/title.php';
include_once 'include/head.php';
$intRowNum = ($intPage - 1) * $arrGPage['page_size'] + 1;
foreach ($arrInfoList as $k => $v) {
    $v['title'] = check::csubstr($v['title'], 0, $arrMHaw['list_charnum']);
    $myText = new HAW_text($intRowNum . ":");
    $myText->br = 0;
    $objHaw->add_text($myText);
    $myLink = new HAW_link($v['title'], "detail.php?id=" . $v['id'] . "&mod=" . $strModuleID . "&page=" . $intPage);
    $myLink->br = 0;
    $objHaw->add_link($myLink);
    $myText = new HAW_text(" (" . $v['clicktimes'] . ")");
    $objHaw->add_text($myText);
    $intRowNum++;
}
if (!empty($arrListPage['pagedown'])) {
    $myLink = new HAW_link('下页', "search.php?page=" . $arrListPage['pagedown']);
    $myLink->set_br(0);
    $objHaw->add_link($myLink);
}
예제 #27
0
<?php

require "tests.php";
require "li_carrays.php";
// Check functions.
check::functions(array(new_intarray, delete_intarray, intarray_getitem, intarray_setitem));
// Check classes.
// NB An "li_carrays" class is created as a mock namespace.
check::classes(array(li_carrays, doubleArray, AB, XY, XYArray));
// No new global variables.
check::globals(array());
$d = new doubleArray(10);
$d->setitem(0, 7);
$d->setitem(5, $d->getitem(0) + 3);
check::equal($d->getitem(0) + $d->getitem(5), 17.0, "7+10==17");
check::done();
예제 #28
0
    }
    if ($_POST['summary'] == '') {
        $_POST['summary'] = check::csubstr(trim(str_replace("&nbsp;", " ", str_replace("\r\n", "", strip_tags($_POST['intro'])))), 0, $arrGWeb['db_summary_len']);
    }
    if (is_array($_POST['photo'])) {
        $_POST['thumbnail'] = $_POST['photo'][0]['photo'];
    } else {
        $_POST['thumbnail'] = $_POST['photo'];
    }
    $_POST['photo'] = array_values($_POST['photo']);
    $_POST['video'] = array_values($_POST['video']);
    //print_r($_POST);exit;
    $_POST = array_merge($arrInfo, $_POST);
    $objWebInit->saveInfo($_POST, 1);
    $objWebInit->updateCache($_POST['id'], $_POST['type_id'], $arrMOutput);
    check::WindowLocation('index.php', $_SERVER["QUERY_STRING"]);
}
if (!is_array($arrMType) || empty($arrMType)) {
    $arrMType = $objWebInit->getTypeList();
    $arrMType = $objWebInit->formatTypeList(0, $arrMType);
}
//print_r($arrMYear);
// 输出到模板
$arrMOutput["template_file"] = "admin.html";
$arrMOutput["smarty_assign"]['FileCallPath'] = $objWebInit->arrGPic['FileCallPath'];
$arrMOutput["smarty_assign"]['FileListPicSize'] = $objWebInit->arrGPic['FileListPicSize'];
$arrMOutput["smarty_assign"]['arrData'] = $arrInfo;
$arrMOutput["smarty_assign"]['arrMType'] = $arrMType;
$arrMOutput["smarty_assign"]['arrTypeB'] = $arrMTypeB;
$arrMOutput["smarty_assign"]['action_type'] = "save";
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['admin_main_dir'] . 'submit.htm';
예제 #29
0
        //GModuleLoad($arrMModule,$arrGModule);
        $strKeywords = strval(urldecode($_REQUEST['keywords']));
        $arrKeywords = explode(' ', $strKeywords);
        foreach ($arrKeywords as $v) {
            $v = trim($v);
            if (!empty($v)) {
                $arrWhere[] = "title LIKE '%{$v}%'";
            }
        }
        $_SESSION['arrWhere'] = $arrWhere;
        $_SESSION['strKeywords'] = $strKeywords;
    }
    $arrLink[] = 'keywords=' . urlencode($strKeywords);
} else {
    if (empty($_REQUEST['keywords']) && $isGo) {
        check::AlertExit("错误:关键词必须填写!", -1);
    } else {
        $arrWhere = $_SESSION['arrWhere'];
        $strKeywords = $_SESSION['strKeywords'];
    }
}
$strWhere = implode(' AND ', $arrWhere);
$strWhere = 'where ' . $strWhere;
$arrInfoList = $objWebInit->getInfoList($strWhere, '  ORDER BY topflag DESC,submit_date DESC', ($intPage - 1) * $arrGPage['page_size'], $arrGPage['page_size']);
$intRows = $arrInfoList['COUNT_ROWS'];
unset($arrInfoList['COUNT_ROWS']);
//翻页跳转link
$strPage = $objWebInit->makeInfoListPage($intRows, $strLink, $link_type = $arrGWeb['URL_static']);
// 输出到模板
$arrMOutput["smarty_assign"]['FileCallPath'] = $arrGPic['FileCallPath'];
$arrMOutput["smarty_assign"]['arrInfoList'] = $arrInfoList;
예제 #30
0
                if ($types['type_id'] == $id) {
                    $arrType = $types;
                }
            }
            $arrTypeList = $objWebInit->formatTypeList(0, $arrTypeList);
            $arrMOutput["smarty_assign"]['type_id'] = $id;
            $arrMOutput["smarty_assign"]['arrType'] = $arrType;
            $arrMOutput["smarty_assign"]['arrData'] = $arrTypeList;
            $arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['admin_main_dir'] . 'edit_category.htm';
            $objWebInit->output($arrMOutput);
            break;
            // 更新课程培训类别
        // 更新课程培训类别
        case 'update':
            if (empty($_POST['type_title'])) {
                check::AlertExit("错误:提交数据为空!", -1);
            }
            if (!empty($_POST['type_link'])) {
                $_POST['type_link'] = str_replace("http://", "", strtolower($_POST['type_link']));
            }
            $objWebInit->makeUpdateType($_POST);
            unset($_GET['action']);
            break;
    }
}
if (!isset($_GET['action'])) {
    // 课程培训类型列表
    $arrTypeList = $objWebInit->getTypeList();
    $arrTypeList = $objWebInit->formatTypeList(0, $arrTypeList);
    // 输出到模板
    $arrMOutput["smarty_assign"]['arrData'] = $arrTypeList;