public function updatecomments() { $page = ForceIntFrom('p', 1); //页码 if (IsPost('updatecomms')) { $updatecids = $_POST['updatecids']; for ($i = 0; $i < count($updatecids); $i++) { $cid = ForceInt($updatecids[$i]); APP::$DB->exe("UPDATE " . TABLE_PREFIX . "comment SET readed = 1 WHERE cid = '{$cid}'"); } } else { $deletecids = $_POST['deletecids']; for ($i = 0; $i < count($deletecids); $i++) { $cid = ForceInt($deletecids[$i]); APP::$DB->exe("DELETE FROM " . TABLE_PREFIX . "comment WHERE cid = '{$cid}'"); } } Success('comments?p=' . $page); }
public function updatephrases() { $page = ForceIntFrom('p', 1); //页码 if (IsPost('updatephrases')) { $pids = $_POST['pids']; $sorts = $_POST['sorts']; $activateds = $_POST['activateds']; $msgs = $_POST['msgs']; $msg_ens = $_POST['msg_ens']; for ($i = 0; $i < count($pids); $i++) { $pid = ForceInt($pids[$i]); APP::$DB->exe("UPDATE " . TABLE_PREFIX . "phrase SET sort = '" . ForceInt($sorts[$i]) . "',\n\t\t\t\t\tactivated = '" . ForceInt($activateds[$i]) . "',\n\t\t\t\t\tmsg = '" . ForceString($msgs[$i]) . "',\n\t\t\t\t\tmsg_en = '" . ForceString($msg_ens[$i]) . "'\t\t\t\t\t\n\t\t\t\t\tWHERE pid = '{$pid}'"); } } else { $deletepids = $_POST['deletepids']; for ($i = 0; $i < count($deletepids); $i++) { $pid = ForceInt($deletepids[$i]); APP::$DB->exe("DELETE FROM " . TABLE_PREFIX . "phrase WHERE pid = '{$pid}'"); } } Success('phrases?p=' . $page); }
<?php ob_start(); header("Content-type:application/json; charset=utf-8"); require_once 'includes/prefs.inc.php'; require_once 'includes/db.php'; require_once 'resources/i18n.php'; ob_end_flush(); if (IsPost()) { $mode = getPref('mode'); switch ($mode) { case "get": GetCalendarsByRange(); break; case "quickadd": QuickAdd(); break; case "quickupdate": QuickUpdate(); break; case "quickdelete": QuickDelete(); break; default: DefaultImpl(); break; } } function DefaultImpl() { $ret = array();
if (isset($errors)) { $errortitle = '添加群组错误'; $action = 'default'; } else { $DB->exe("INSERT INTO " . TABLE_PREFIX . "usergroup (displayorder, groupname, groupename, activated, description, descriptionen) VALUES (1, '{$groupname}', '{$groupename}', 1, '{$description}', '{$descriptionen}')"); $usergroupid = $DB->insert_id(); $DB->exe("UPDATE " . TABLE_PREFIX . "usergroup SET displayorder = '{$usergroupid}' WHERE usergroupid = '{$usergroupid}'"); GotoPage('admin.groups.php', 1); } } //########### PRINT DEFAULT ########### if ($action == 'default') { $usergroup = array('groupname' => '', 'groupename' => '', 'description' => '', 'descriptionen' => ''); if (isset($errors)) { PrintErrors($errors, $errortitle); if (!IsPost('updategroups')) { $usergroup = array('groupname' => $groupname, 'groupename' => $groupename, 'description' => $_POST['description'], 'descriptionen' => $_POST['descriptionen']); } } echo '<form method="post" action="admin.groups.php" name="groupform"> <input type="hidden" name="action" value="creatgroup"> <table border="0" cellpadding="0" cellspacing="0" class="moreinfo"> <thead> <tr> <th colspan="4">创建新客服群组:</th> </tr> </thead> <tbody> <tr> <td>客服群组的名称:</td> <td>
/** * private 输出用户登录窗口 login */ private function login() { $info = ''; if (IsPost('submit')) { $info = $this->check(); } $info = Iif($info, "<font color='#ff3300'>{$info}</font>", '请输入用户名和密码.'); $key = PassGen(8); $code = authcode(md5(WEBSITE_KEY), 'ENCODE', $key, 1800); $cookievalue = md5(WEBSITE_KEY . $key . APP::$_CFG['KillRobotCode']); echo '<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>' . APP_NAME . ' - 管理登录</title> <link rel="stylesheet" type="text/css" href="' . SYSDIR . 'public/login.css"> </head> <body> <div id="logo"> <img src="' . SYSDIR . 'public/img/logo-login.png" alt="' . APP_NAME . '"> </div> <div id="login"> <form id="loginform" action="" method="post"> <input type="hidden" name="key" value="' . $key . '"> <input type="hidden" name="code" value="' . $code . '"> <p id="info">' . $info . '</p> <div class="control-group"> <span class="icon-user"></span><input name="username" placeholder="Username" type="text" autocomplete="off"> </div> <div class="control-group"> <span class="icon-lock"></span><input name="password" placeholder="Password" type="password"> </div> <div class="remember-me"> <input name="remember" value="1" type="checkbox" id="rm"><label for="rm"> 记住我</label> <a href="" id="forget-password">忘记密码?</a> </div> <div class="login-btn"> <input id="login-btn" value="登 录" type="submit" name="submit" onclick="setSafeCookie();return true;"> </div> </form> <form id="forgotform" class="hide"> <input type="hidden" name="key" value="' . $key . '"> <input type="hidden" name="code" value="' . $code . '"> <p id="info2">请输入Email地址找回密码.</p> <div class="control-group"> <span class="icon-mail"></span><input name="email" placeholder="Email" type="text" autocomplete="off"> </div> <div class="login-btn forget-btn"> <input id="forget-btn" value="提 交" type="submit"> </div> </form> </div> <div id="login-copyright"> ' . date("Y") . ' © ' . APP_NAME . ' <a href="' . APP_URL . '" target="_blank">weentech.com</a> </div> <script src="' . SYSDIR . 'public/jquery191.js" type="text/javascript"></script> <script> function setSafeCookie() { document.cookie = "' . COOKIE_SAFE . '=' . $cookievalue . '; path=/"; } $(function(){ $("#logo").css("margin-top", ($(window).height()-460)/2+"px"); $("input[name=\'username\']").focus(); $("#forget-password").click(function (e) { $("#loginform").hide(); $("#forgotform").show(200); e.preventDefault(); }); $("#forget-btn").click(function (e) { var form_data = $("#forgotform").serialize(); var shower = $("#info2"); setSafeCookie (); //设置安全cookie $.ajax({ url: "' . BURL('getpass/check') . '", data: form_data, type: "post", cache: false, dataType: "json", beforeSend: function(){shower.html("<font color=#ff3300>邮件验证中...</font>");}, success: function(data){ if(data.s == 0){ shower.html("<font color=#ff3300>" + data.i + "</font>"); //输出错误信息 }else{ shower.html("<font color=blue>" + data.i + "</font>"); //输出成功信息 } }, error: function(XHR, Status, Error) { shower.html("<font color=#ff3300>Ajax错误, 邮件验证请求失败!</font>"); //ajax错误 } }); e.preventDefault(); }); }); </script> </body> </html>'; exit; //终止程序继续运行 important !!!!! }
// +---------------------------------------------+ // | Copyright 2010 - 2028 WeLive | // | http://www.weentech.com | // | This file may not be redistributed. | // +---------------------------------------------+ define('AUTH', true); include 'includes/welive.Core.php'; include BASEPATH . 'includes/welive.Admin.php'; if ($userinfo['usergroupid'] != 1) { exit; } $action = ForceIncomingString('action', 'default'); if (IsPost('updateusers')) { $action = 'updateusers'; } if (IsPost('deleteusers')) { $action = 'deleteusers'; } PrintHeader($userinfo['username'], 'users'); $cache_errortitle = '更新客服缓存错误'; $cache_errors = '用户信息已保存到数据库, 但更新在线客服缓存文件失败, 前台客服小面板状态无法更新! 请检查cache/目录是否存在或可写?'; //########### UPDATE OR ADD USER ########### if ($action == 'insertuser' or $action == 'updateuser') { $userid = ForceIncomingInt('userid'); $usergroupid = ForceIncomingInt('usergroupid'); $activated = ForceIncomingInt('activated'); $displayorder = ForceIncomingInt('displayorder'); $username = ForceIncomingString('username'); $password = ForceIncomingString('password'); $passwordconfirm = ForceIncomingString('passwordconfirm'); $userfrontname = ForceIncomingString('userfrontname');
// +---------------------------------------------+ // | Copyright 2010 - 2028 WeLive | // | http://www.weentech.com | // | This file may not be redistributed. | // +---------------------------------------------+ define('AUTH', true); include 'includes/welive.Core.php'; include BASEPATH . 'includes/welive.Admin.php'; if ($userinfo['usergroupid'] != 1) { exit; } $action = ForceIncomingString('action', 'default'); if (IsPost('updatemsgs')) { $action = 'updatemsgs'; } if (IsPost('deletemsgs')) { $action = 'deletemsgs'; } PrintHeader($userinfo['username'], 'automsg'); //########### UPDATE MESSAGES ########### if ($action == 'updatemsgs') { $msgids = $_POST['msgids']; $ordernums = $_POST['ordernums']; $activateds = $_POST['activateds']; $msgs = $_POST['msgs']; $page = ForceIncomingInt('p'); for ($i = 0; $i < count($msgids); $i++) { $DB->exe("UPDATE " . TABLE_PREFIX . "automsg SET ordernum = '" . ForceInt($ordernums[$i]) . "',\r\n\t\tactivated = '" . ForceInt($activateds[$i]) . "',\r\n\t\tmsg = '" . ForceString($msgs[$i]) . "'\r\n\t\tWHERE msgid = '" . ForceInt($msgids[$i]) . "'"); } GotoPage('admin.automsg.php' . Iif($page, '?p=' . $page), 1); }