Skip to content

Commit

Permalink
magic_quotes_gpc warning in admin main page
Browse files Browse the repository at this point in the history
  • Loading branch information
BLumia committed Mar 4, 2017
1 parent ded02d7 commit b9cbbd3
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 119 deletions.
3 changes: 3 additions & 0 deletions admin/index.php
Expand Up @@ -4,12 +4,15 @@
require_once('../include/setting_oj.inc.php');
require_once('../include/common_functions.inc.php');
require_once('../include/common_const.inc.php');
require_once('../include/user_check_functions.php');
//Prepares

// OJ Default Lang
$lang_count=count($LANGUAGE_EXT);
$lang=(~((int)$OJ_LANGMASK))&((1<<($lang_count))-1);

$isCurUserOperator = isOperator();

//Page Includes
require("./pages/index.php");
?>
9 changes: 6 additions & 3 deletions admin/pages/index.php
Expand Up @@ -8,14 +8,17 @@
<?php require('./pages/components/offcanvas.php');?>
<div class="container" id="mainContent">
<div class="page-header">
<h1><?php echo LA_WELCOME;?> <small>Manager</small></h1>
<h1><?php echo LA_WELCOME;?> <small><?php echo $isCurUserOperator?"Manager":"Hacker";?></small></h1>
</div>
<p class="lead">
<?php echo LA_INDEX_LEAD;?>
<?php echo $isCurUserOperator ? LA_INDEX_LEAD : LA_HACKER_ROCKS;?>
</p>
<p>
<?php echo LA_INDEX_MORE;?>
<?php if ($isCurUserOperator) echo LA_INDEX_MORE;?>
</p>
<?php if (get_magic_quotes_gpc()) { ?>
<div class="alert alert-danger" role="alert"><h4><?php echo L_WARNING;?> </h4><?php echo LA_MAGIC_QUOTE_WARN;?></div>
<?php } ?>
<table class="table">
<tr><th><?php echo LA_PROPERTY;?></th><th><?php echo LA_STATUS;?></th></tr>
<?php if ($OJ_IS_SAMPLE_CFG == true) { ?>
Expand Down
14 changes: 13 additions & 1 deletion admin/pages/problem_data.php
@@ -1,3 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<?php require_once('../include/admin_head.inc.php'); ?>
<title><title><?php echo LA_DATA_MAN." - {$OJ_NAME}";?></title></title>
<style>
table#tableFileList a {
padding-left: 5px;
}
</style>
</head>
<body>
<?php require('./pages/components/offcanvas.php');?>
<div class="container" id="mainContent">
Expand Down Expand Up @@ -250,4 +261,5 @@ function loadData_tableFileList(problemID) {
loadData_tableFileList(<?php echo $problemID; ?>);
});
</script>
</body>
</body>
</html>
18 changes: 2 additions & 16 deletions admin/problem_data.php
@@ -1,17 +1,5 @@
<?php session_start(); $ON_ADMIN_PAGE="Yap"; ?>
<!DOCTYPE html>
<html>
<head>
<?php require_once('../include/admin_head.inc.php'); ?>
<title>Problem Data</title>
<style>
table#tableFileList a {
padding-left: 5px;
}
</style>
</head>

<?php
<?php
session_start(); $ON_ADMIN_PAGE="Yap";
//Vars
require_once('../include/setting_oj.inc.php');
require_once("../include/user_check_functions.php");
Expand All @@ -29,5 +17,3 @@
//Page Includes
require("./pages/problem_data.php");
?>

</html>
3 changes: 3 additions & 0 deletions language/english.admin.inc.php
Expand Up @@ -4,6 +4,7 @@
const LA_PROB_EDITOR = "Problem Editor";
const LA_PROB_LIST = "Problem List";
const LA_PROB_MAN = "Problem Management";
const LA_DATA_MAN = "Test Data Management";
const LA_CONT_EDITOR = "Contest Editor";
const LA_CONT_ADD = "Add Contest";
const LA_CONT_LIST = "Contest List";
Expand All @@ -26,6 +27,8 @@
const LA_NO = "No";
const LA_DEFAULT_CFG = "Using default sample configre file";
const LA_DEFAULT_CFG_HELP = "We recommand you copy <code>config.sample.php</code> as <code>config.php</code> in <code>include</code> folder and modify it to configure this OJ.";
const LA_MAGIC_QUOTE_WARN = "<code>magic_quotes_gpc</code> is now <b>On</b>, that will cause problem when code submit processing, please trun it off by config your <code>php.ini</code> and restart your http server service, or upgrade your PHP package. (<a href='https://secure.php.net/manual/en/security.magicquotes.disabling.php'>See how to do it</a>)";
const LA_HACKER_ROCKS = "You hacked into the server! Congratulations! You rocks!";
const LA_SHOW_WA_INFO = "Show solution Wrong Answer detail";
const LA_ENABLED_LANG = "Allowed languages by default";
const LA_CODE_SUBMIT_LIMIT = "Code submit frequence limit";
Expand Down
6 changes: 6 additions & 0 deletions language/english.inc.php
Expand Up @@ -70,6 +70,7 @@
const L_HINT = "Hint";
const L_TAG = "Tag";
const L_SOURCE = "Source";
const L_DIFFICUTY = "Difficuty";
/************* Mail Page *****************/
const L_SEND = "Send";
const L_CLEAR = "Clear";
Expand Down Expand Up @@ -98,6 +99,9 @@
const L_SOLVED = "Solved";
const L_CHALLENGED = "Challenged";
const L_NOT_EDITABLE= "not editable";
/************* Ranklist ***************/
const L_RANK = "Rank";
const L_PASSRATE= "Pass Rate";
/************* Forum ***************/
const L_THREADLIST = "Thread List";
const L_THREAD = "Thread List";
Expand All @@ -122,13 +126,15 @@
/************* Misc *****************/
const L_OR = "or";
const L_OK = "Okay";
const L_GO = "Go";
const L_ALL = "All";
const L_DATE = "Date";
const L_HELP = "Help";
const L_LANG = "Language";
const L_CLOSE = "Close";
const L_RESULT = "Result";
const L_DELETE = "Delete";
const L_WARNING = "Warning";
const L_DOWNLOAD= "Download";
const L_UPLOAD = "Upload";
const L_CHANGE = "Change";
Expand Down
3 changes: 3 additions & 0 deletions language/schinese.admin.inc.php
Expand Up @@ -4,6 +4,7 @@
const LA_PROB_EDITOR = "问题编辑";
const LA_PROB_LIST = "问题列表";
const LA_PROB_MAN = "管理问题";
const LA_DATA_MAN = "管理数据";
const LA_CONT_EDITOR = "比赛编辑";
const LA_CONT_ADD = "添加竞赛";
const LA_CONT_LIST = "竞赛列表";
Expand All @@ -26,6 +27,8 @@
const LA_NO = "";
const LA_DEFAULT_CFG = "使用默认示例配置文件";
const LA_DEFAULT_CFG_HELP = "我们建议您复制 <code>include</code> 文件夹中的 <code>config.sample.php</code> 为 <code>config.php</code> 并修改它,以配置该在线评测系统.";
const LA_MAGIC_QUOTE_WARN = "<code>magic_quotes_gpc</code> 当前状态为 <b>开启</b>, 这个已弃用的选项会造成代码提交时被添加额外的转义符号并导致编译失败, 请在 <code>php.ini</code> 中关闭该选项并重启您的http服务或升级您的 PHP 版本以解决该问题. (<a href='https://secure.php.net/manual/zh/security.magicquotes.disabling.php'>了解应该怎么做</a>)";
const LA_HACKER_ROCKS = "恭喜入侵后台成功!翻滚吧,牛宝宝!";
const LA_SHOW_WA_INFO = "是否显示答案错误对比";
const LA_ENABLED_LANG = "默认可提交的编程语言";
const LA_CODE_SUBMIT_LIMIT = "代码提交最小间隔时间";
Expand Down
6 changes: 6 additions & 0 deletions language/schinese.inc.php
Expand Up @@ -69,6 +69,7 @@
const L_HINT = "提示";
const L_TAG = "标签";
const L_SOURCE = "来源";
const L_DIFFICUTY = "难度";
/************* Mail Page *****************/
const L_SEND = "发送";
const L_CLEAR = "清空";
Expand Down Expand Up @@ -97,6 +98,9 @@
const L_SOLVED = "已解决";
const L_CHALLENGED = "已挑战";
const L_NOT_EDITABLE= "不可修改";
/************* Ranklist ***************/
const L_RANK = "排名";
const L_PASSRATE= "通过率";
/************* Forum ***************/
const L_THREADLIST = "主题列表";
const L_THREAD = "主题帖";
Expand All @@ -121,13 +125,15 @@
/************* Misc *****************/
const L_OR = "";
const L_OK = "好的";
const L_GO = "走起";
const L_ALL = "所有";
const L_DATE = "日期";
const L_HELP = "帮助";
const L_LANG = "语言";
const L_CLOSE = "关闭";
const L_RESULT = "结果";
const L_DELETE = "删除";
const L_WARNING = "警告";
const L_DOWNLOAD= "下载";
const L_UPLOAD = "上传";
const L_CHANGE = "更换";
Expand Down
2 changes: 1 addition & 1 deletion pages/components/footer.php
Expand Up @@ -4,7 +4,7 @@
<span id="clock">Server Time: Loading...</span><br/>
FAQ | <a class="bl-footer-link" href="#">Rule</a>
</p>
<p style="float: right; margin-right: 15px;" align="right">
<p style="float: right; margin-right: 15px;" class="hidden-xs" align="right">
Powered by <a class="bl-footer-link" href="https://github.com/BLumia/BLumiaOJ/">BLumiaOJ</a><br/>
Copyright 2015~2017 © <a href="./about.php"><?php echo $OJ_NAME; ?> Develop Team</a>
</p>
Expand Down
24 changes: 12 additions & 12 deletions pages/problemset.php
Expand Up @@ -8,7 +8,7 @@
<?php require("./pages/components/navbar.php");?>
<div class="container">
<div class="row">
<div class="col-md-6 col-xs-12">
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="btn-group" role="group" id="oj-ps-pager">
<?php
for($i=1;$i<=$pageCnt;$i++) {
Expand All @@ -18,26 +18,26 @@
?>
</div>
</div>
<div class="col-md-3 col-xs-6">
<div class="col-md-3 col-sm-3 col-xs-6">
<form method="get" action="./problem.php">
<div class="input-group">
<input type="text" class="form-control" name="pid" placeholder="输入题目编号">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">走起</button>
<button class="btn btn-default" type="submit"><?php echo L_GO;?></button>
</span>
</div><!-- /input-group -->
</div>
</form>
</div><!-- /.col-lg-3 -->
<div class="col-md-3 col-xs-6">
</div>
<div class="col-md-3 col-sm-3 col-xs-6">
<form method="get">
<div class="input-group">
<input type="text" name="wd" class="form-control" placeholder="输入标题关键字">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">搜索</button>
</span>
</div><!-- /input-group -->
</div>
</form>
</div><!-- /.col-lg-3 -->
</div>
</div><!-- /.row -->
<div class="row">
<div class="col-md-12">
Expand All @@ -46,10 +46,10 @@
<tr>
<th width="5%">AC</th>
<th width="5%">ID</th>
<th width="40%">Title</th>
<th width="20%">Difficulty</th>
<th width="16%">Source</th>
<th width="14%">AC/Submit</th>
<th width="40%"><?php echo L_TITLE;?></th>
<th width="20%"><?php echo L_DIFFICUTY;?></th>
<th width="16%"><?php echo L_SOURCE;?></th>
<th width="14%"><?php echo "AC / ".L_SUBMIT;?></th>
</tr>
</thead>
<tbody id="oj-ps-problemlist">
Expand Down

0 comments on commit b9cbbd3

Please sign in to comment.