2024-10-10
This commit is contained in:
47
web/swadmin/setmsg.php
Normal file
47
web/swadmin/setmsg.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
require_once("admin-header.php");
|
||||
if(!(isset($_SESSION[$OJ_NAME.'_'.'administrator']))){
|
||||
echo "<a href='../loginpage.php'>Please Login First!</a>";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
echo "<hr>";
|
||||
echo "<center><h3>$MSG_SETMESSAGE</h3></center>";
|
||||
|
||||
if(isset($_POST['do'])){
|
||||
require_once("../include/check_post_key.php");
|
||||
@mkdir("../admin/msg");
|
||||
$fp = fopen($OJ_SAE?"saestor://web/msg.txt":"../admin/msg/$domain.txt","w");
|
||||
$msg = $_POST['msg'];
|
||||
|
||||
$msg = str_replace("<p>", "", $msg);
|
||||
$msg = str_replace("</p>", "<br />", $msg);
|
||||
$msg = str_replace(",", ",", $msg);
|
||||
|
||||
if(false){
|
||||
$title = stripslashes($title);
|
||||
}
|
||||
|
||||
$msg = RemoveXSS($msg);
|
||||
fputs($fp,$msg);
|
||||
fclose($fp);
|
||||
echo "Update At ".date('Y-m-d h:i:s');
|
||||
}
|
||||
|
||||
$msg = file_get_contents($OJ_SAE?"saestor://web/msg.txt":"msg.txt");
|
||||
|
||||
include("kindeditor.php");
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<form action='setmsg.php' method='post'>
|
||||
<textarea name='msg' rows=25 class="kindeditor" ><?php echo $msg?></textarea><br>
|
||||
<input type='hidden' name='do' value='do'>
|
||||
<center><input type='submit' value='Save'></center>
|
||||
如果升级无法修改公告,发送“修改公告”到微信公众号onlinejudge看解决方案。<br>
|
||||
if this does not work, try run "sudo chown -R www-data /home/judge/src/web " in terminal.
|
||||
<?php require_once("../include/set_post_key.php");?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php require_once('../oj-footer.php'); ?>
|
||||
Reference in New Issue
Block a user