function WT_IPC_Monitor() { $gw = WT_spawn_new_gateway(); $r = $gw->current_lib->IPC_Monitor(); if ($r != '') { print setvars($r); } else { print ' '; } }
function WT_ProblemRejudge() { global $id; if ($id == '') { return; } $gw = WT_spawn_new_gateway(); if ($gw->current_lib->IPC_Problem_Rejudge($id)) { print '+OK'; } else { print '-ERR'; } }
function WT_ToggleProblemUsage() { global $cid, $id; if ($id == '' || $cid == '') { return; } $gw = WT_spawn_new_gateway(); if ($gw->current_lib->IPC_Contest_ToggleDisableProblem($cid, $id)) { print '+OK'; } else { print '-ERR'; } }
function WT_GetProblemDesc() { global $id, $cid, $backlink; if ($id == '' || $cid == '') { return; } $gw = WT_spawn_new_gateway(); $r = $gw->current_lib->IPC_Problem_DescriptionForm($id, $cid, $backlink); if ($r != '') { print setvars($r); } else { print ' '; } }
function WT_ProblemAddTag() { $id = $_POST['id']; $tag = trim($_POST['tag']); if (!isnumber($id) || $tag == '') { print '-ERR'; return; } $gw = WT_spawn_new_gateway(); if ($gw->current_lib->IPC_Problem_AddTag($id, $tag)) { print '+OK'; } else { print '-ERR'; } }
function WT_spawn_new_library($lid, $gw = nil) { global $WT_libraries; if (isset($WT_libraries[$lid])) { return $WT_libraries[$lid]; } if ($gw == nil) { $gw = WT_spawn_new_gateway(); } $cnt = WT_spawn_new_library_container(); $arr = $cnt->GetList(); $n = count($arr); for ($i = 0; $i < $n; $i++) { if ($arr[$i]['lid'] == $lid) { $res = new $arr[$i]['class']($gw); $res->Init(); $WT_libraries[$lid] = $res; return $res; } } return nil; }
function GetAccessibleList($user_id) { $gw = WT_spawn_new_gateway(); if (isset($this->cache['ACCLIST'][$user_id])) { return $this->cache['ACCLIST'][$user_id]; } if ($gw->GetAllowed('CONTEST.MANAGE')) { $arr = $this->data; } else { $q = db_query('SELECT `tcg`.contest_id FROM `tester_contestgroup` ' . 'AS `tcg`, `usergroup` AS `ug`, `tester_contests` ' . 'AS `tc` ' . "WHERE (`ug`.`user_id`={$user_id}) AND " . "(`tcg`.`group_id`=`ug`.`group_id`) " . "AND (`tc`.`id`=`tcg`.`contest_id`) " . 'GROUP BY `tcg`.`contest_id` ' . 'ORDER BY `tc`.`lid`, `tc`.`name`'); // println (db_error ()); $arr = array(); while ($r = db_row($q)) { $arr[] = $this->ContestByID($r['contest_id']); } } $this->cache['ACCLIST'][$user_id] = $arr; return $arr; }
<?php /** * Gate - Wiki engine and web-interface for WebTester Server * * WebTester client page generation script * * Copyright (c) 2008-2009 Sergey I. Sharybin <*****@*****.**> * * This program can be distributed under the terms of the GNU GPL. * See the file COPYING. */ if ($PHP_SELF != '') { print 'HACKERS?'; die; } if (!user_authorized()) { redirect('./login?redirect=' . get_redirection()); } $gw = WT_spawn_new_gateway(); $gw->Handle(); $gw->Draw();