diff options
author | LAN-TW <lantw44@gmail.com> | 2013-05-04 02:34:41 +0800 |
---|---|---|
committer | LAN-TW <lantw44@gmail.com> | 2013-05-04 02:34:55 +0800 |
commit | 3e5eb3a04d2772f4e6d746f99014845f6503223e (patch) | |
tree | 948185ddedb0805809463522db921a08e332fcb4 /web/php/problem.php | |
parent | f32ce06a7c13bb6803e7062562781bb9f8619b41 (diff) | |
parent | 7557a467ea27ca6e0b0ea25b1d903d63a324ee11 (diff) | |
download | taiwan-online-judge-lantw44-master.tar.gz taiwan-online-judge-lantw44-master.tar.zst taiwan-online-judge-lantw44-master.zip |
Taiwan Online Judge upstream start developing the new version using python.
I will not provide any updates until the new python version reaches stable.
Diffstat (limited to 'web/php/problem.php')
-rw-r--r-- | web/php/problem.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/web/php/problem.php b/web/php/problem.php index 69bb2f4..4ef43f3 100644 --- a/web/php/problem.php +++ b/web/php/problem.php @@ -4,6 +4,7 @@ require_once('problem.inc.php'); require_once('user.inc.php'); +require_once('event.inc.php'); $sqlc = db_connect(); @@ -50,8 +51,9 @@ if($action == 'add_pro') die('Eproname_too_short'); if(strlen($dt->proname) > PRONAME_LEN_MAX) die('Eproname_too_long'); - - if(!problem::getmod($sqlc, $dt->modid)) + + $mod = problem::getmod($sqlc, $dt->modid); + if(!$mod) die('Ewrong_modid'); if($dt->hidden !== true && $dt->hidden !== false) @@ -65,6 +67,9 @@ if($action == 'add_pro') if(!$pro) die('Eadd_problem'); + if(event::exec_func('../pmod/'.$mod->pmodname.'/'.$mod->pmodname.'.inc.php','event_create',[$pro->proid]) === false) + die('Eevent_error'); + echo(json_encode($pro)); } if($action == 'edit_pro') |