diff --git a/db/app_uoj233.sql b/db/app_uoj233.sql index c9888a8..ad8f5cb 100644 --- a/db/app_uoj233.sql +++ b/db/app_uoj233.sql @@ -724,26 +724,6 @@ LOCK TABLES `user_system_msg` WRITE; /*!40000 ALTER TABLE `user_system_msg` ENABLE KEYS */; UNLOCK TABLES; -create table pastes -( - `index` varchar(20) null, - creator varchar(20) null, - created_at datetime null, - content text null -); - -create unique index pastes_index_uindex - on pastes (`index`); - -create index pastes_created_at_index - on pastes (created_at); - -alter table pastes - add constraint pastes_pk - primary key (`index`); - - - /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; diff --git a/web/.gitignore b/web/.gitignore index 94938ff..755aeb1 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -7,7 +7,5 @@ composer.lock app/.config.php app/storage/tmp/* app/storage/submission/* -app/storage/paste/* !app/storage/tmp/.gitkeep !app/storage/submission/.gitkeep -!app/storage/paste/.gitkeep diff --git a/web/app/controllers/paste_post.php b/web/app/controllers/paste_post.php deleted file mode 100644 index 5b2ef12..0000000 --- a/web/app/controllers/paste_post.php +++ /dev/null @@ -1,37 +0,0 @@ - "source code", - "name" => "paste", - "file_name" => "paste.code" - ] - ], - 'uojRandAvaiablePasteFileName', - 'handleUpload'); -$paste_form->succ_href = '/paste'; -$paste_form->runAtServer(); -echoUOJPageHeader("Paste!"); -$paste_form->printHTML(); -echoUOJPageFooter(); diff --git a/web/app/controllers/paste_view.php b/web/app/controllers/paste_view.php deleted file mode 100644 index 277fc09..0000000 --- a/web/app/controllers/paste_view.php +++ /dev/null @@ -1,16 +0,0 @@ -runAtServer(); - $paste_deleter = new UOJForm('paste_deleter'); - $paste_deleter->addInput('paste_deleter_name', 'text', 'Paste ID', '', - function ($x, &$vdata) { - if (DB::selectCount("select count(*) from pastes where `index`='$x'")==0) { - return '不合法'; - } - $vdata['name'] = $x; - return ''; - }, - null - ); - $paste_deleter->handle = function(&$vdata) { - DB::delete("delete from pastes where `index` = '${vdata['name']}'"); - }; - $paste_deleter->runAtServer(); - $judgerlist_cols = array('judger_name', 'password'); $judgerlist_config = array(); $judgerlist_header_row = << array( 'name' => '评测机管理', 'url' => '/super-manage/judger' - ), - 'paste' => array( - 'name' => '剪贴板管理', - 'url' => '/super-manage/paste' ) ); @@ -588,11 +568,6 @@ EOD;

评测机列表

- -
-

Paste管理

- -
diff --git a/web/app/libs/uoj-html-lib.php b/web/app/libs/uoj-html-lib.php index 993c09f..8a879f9 100644 --- a/web/app/libs/uoj-html-lib.php +++ b/web/app/libs/uoj-html-lib.php @@ -411,93 +411,6 @@ function echoSubmissionsList($cond, $tail, $config, $user) { }, $table_config); } -function echoPastesList() { - $header_row = ''; - $col_names = ['`index`','creator','created_at']; - $header_row .= 'ID'; - $header_row .= ''.UOJLocale::get("problems::submitter").''; - $header_row .= ''.UOJLocale::get('problems::submit time').''; - $header_row .= ' 操作 '; - $header_row .= ''; - $table_name = 'pastes'; - echoLongTable($col_names, $table_name, "1", 'order by created_at desc', $header_row, - function($paste) { - $user = getUserLink($paste['creator']); - $token = HTML::hiddenToken(); - echo << - - {$paste['index']} - - - {$user} - - - {$paste['created_at']} - - -
- {$token} - - -
- - -HTML; - }, []); -} - -function echoPasteContent($paste) { - $zip_file = new ZipArchive(); - $submission_content = json_decode($paste['content'], true); - $zip_file->open(UOJContext::storagePath().$submission_content['file_name']); - - $config = array(); - foreach ($submission_content['config'] as $config_key => $config_val) { - $config[$config_val[0]] = $config_val[1]; - } - - $file_content = $zip_file->getFromName("paste.code"); - $file_content = uojTextEncode($file_content, array('allow_CR' => true, 'html_escape' => true)); - $file_language = htmlspecialchars($config["paste_language"]); - $footer_text = UOJLocale::get('problems::source code').', '.UOJLocale::get('problems::language').': '.$file_language; - $footer_text .= ", ".UOJLocale::get("problems::submitter") . <<${paste['creator']} -HTML; - $footer_text .= ", ".UOJLocale::get("problems::submit time").": ".$paste['created_at']; - - switch ($file_language) { - case 'C++': - case 'C++11': - $sh_class = 'sh_cpp'; - break; - case 'Python2': - case 'Python3': - $sh_class = 'sh_python'; - break; - case 'C': - $sh_class = 'sh_c'; - break; - case 'Pascal': - $sh_class = 'sh_pascal'; - break; - default: - $sh_class = ''; - break; - } - echo '
'; - echo '
'; - echo '

Paste!

'; - echo '
'; - echo '
'; - echo '
'.$file_content."\n".'
'; - echo '
'; - echo ''; - echo '
'; - - $zip_file->close(); -} - function echoSubmissionContent($submission, $requirement) { $zip_file = new ZipArchive(); $submission_content = json_decode($submission['content'], true); diff --git a/web/app/libs/uoj-rand-lib.php b/web/app/libs/uoj-rand-lib.php index 49e427b..2e221c1 100644 --- a/web/app/libs/uoj-rand-lib.php +++ b/web/app/libs/uoj-rand-lib.php @@ -31,7 +31,3 @@ function uojRandAvaiableSubmissionFileName() { } return uojRandAvaiableFileName("/submission/$num/"); } - -function uojRandAvaiablePasteFileName() { - return uojRandAvaiableFileName('/paste/'); -} diff --git a/web/app/route.php b/web/app/route.php index a71638a..fe4833e 100644 --- a/web/app/route.php +++ b/web/app/route.php @@ -68,9 +68,6 @@ Route::group([ Route::any('/click-zan', '/click_zan.php'); - Route::any('/paste', '/paste_post.php'); - Route::any('/pastes/{rand_str_id}', '/paste_view.php'); - Route::any('/map_visualizer', '/map_visualizer.php'); } ); diff --git a/web/app/views/main-nav.php b/web/app/views/main-nav.php index 06fde86..a27c434 100644 --- a/web/app/views/main-nav.php +++ b/web/app/views/main-nav.php @@ -18,7 +18,6 @@ 工具