<?php
|
include_once "/Common/CommFunc.php";
|
include_once "/Common/Logging.php";
|
include_once "/Account/User.php";
|
include_once "/language/lang.php";
|
|
$Permission = \User\Permission::P_Chatmonitor;
|
$spid = $_SESSION['spid'];
|
$user = new \User\User($_SESSION['UserAccount']);
|
if (!$user->HavePermission($Permission)) {
|
exit;
|
}
|
|
$wordFile0 = "chatmonitor/word_" . $spid . "_0.txt";
|
$wordFile1 = "chatmonitor/word_" . $spid . "_1.txt";
|
|
$ok = 0;
|
$alertMsg = "";
|
if ($_POST["submit"]) {
|
$words0 = $_POST["words0"];
|
$words1 = $_POST["words1"];
|
$ret0 = file_put_contents($wordFile0, $words0);
|
$ret1 = file_put_contents($wordFile1, $words1);
|
if ($ret0 >= 0 && $ret1 >= 0) {
|
$ok = 1;
|
$alertMsg = "ok";
|
} else {
|
$alertMsg = "error";
|
}
|
} else {
|
$words0 = \CommFunc\GetFileContents($wordFile0);
|
$words1 = \CommFunc\GetFileContents($wordFile1);
|
}
|
|
?>
|
|
<!DOCTYPE HTML>
|
<html>
|
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<title><?php echo \Lang\gettext("敏感词管理"); ?></title>
|
<link rel="gettext" type="application/x-po" href="../language/<?php echo \Lang\getLang(); ?>/LC_MESSAGES/<?php echo \Lang\getjspodomain(); ?>.po" />
|
</head>
|
|
<body>
|
<form action="chatwordmgr.php" method="POST">
|
<center>
|
<?php echo \Lang\gettext("敏感词用英文','隔开"); ?><br />
|
<br />
|
<?php echo \Lang\gettext("超级敏感词"); ?>:<br />
|
<textarea name="words0" id="words0" cols="100" rows="20"><?php echo $words0; ?></textarea><br />
|
<br />
|
<?php echo \Lang\gettext("普通敏感词"); ?>:<br />
|
<textarea name="words1" id="words1" cols="100" rows="20"><?php echo $words1; ?></textarea><br />
|
<input type="submit" name="submit" value="<?php echo \Lang\gettext("提交"); ?>" onclick="return CheckSubmit()" />
|
</center>
|
</form>
|
</body>
|
|
<script type='text/javascript' src="/js/common.js"></script>
|
<script type="text/javascript">
|
window.onload = function() {
|
var alertMsg = "<?php echo $alertMsg; ?>";
|
if (alertMsg) {
|
alert(alertMsg);
|
}
|
|
var ok = "<?php echo $ok; ?>";
|
if (ok == 1) {
|
var words0 = "<?php echo $words0; ?>";
|
var words1 = "<?php echo $words1; ?>";
|
var words0list = words0.split(',');
|
var words1list = words1.split(',');
|
var words = [words0list, words1list];
|
opener.updSensitiveWord(words); //更新父页面数据
|
}
|
}
|
|
function CheckSubmit() {
|
var words0 = document.getElementById("words0").value;
|
var words1 = document.getElementById("words1").value;
|
// 替换中文逗号为英文逗号
|
if (words0.indexOf(",") != -1) {
|
words0 = words0.replaceAll(",", ",");
|
document.getElementById("words0").value = words0;
|
}
|
if (words1.indexOf(",") != -1) {
|
words1 = words1.replaceAll(",", ",");
|
document.getElementById("words1").value = words1;
|
}
|
var words0list = words0.split(',');
|
var words1list = words1.split(',');
|
var br = getbr();
|
confirmStr = "";
|
confirmStr += "<?php echo \Lang\gettext("超级敏感词"); ?>" + " : " + br + JSON.stringify(words0list) + br + br;
|
confirmStr += "<?php echo \Lang\gettext("普通敏感词"); ?>" + " : " + br + JSON.stringify(words1list) + br + br;
|
confirmStr += "<?php echo \Lang\gettext("确定提交?"); ?>";
|
if (!window.confirm(confirmStr)) {
|
return false;
|
}
|
return true;
|
}
|
</script>
|
|
</html>
|