Changeset 993 for trunk/common
- Timestamp:
- 01/22/09 01:32:19 (3 years ago)
- Location:
- trunk/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/job.php
r991 r993 10 10 // round_id: Round to submit for. Optional, if missing the job is sent 11 11 // to all parent rounds. 12 // compiler_id: c, cpp or fpc.12 // compiler_id: c, cpp, fpc, or py. 13 13 // solution: A string with the file to submit. 14 14 // … … 38 38 39 39 // Validate compiler id 40 $valid_compilers = array('c', 'cpp', 'fpc' );40 $valid_compilers = array('c', 'cpp', 'fpc', 'py'); 41 41 if (!array_key_exists('compiler_id', $args)) { 42 42 $errors['compiler_id'] = "Lipseste compilatorul."; 43 43 } else if (array_search($args['compiler_id'], $valid_compilers) === false) { 44 44 $errors['compiler_id'] = "Compilator invalid."; 45 } 46 // HACK: For the moment, only admin`s are allowed to submit Python jobs. 47 // TODO: Remove this once Python support is stable. 48 if ('py' == $args['compiler_id'] && !user_is_admin($user)) { 49 $errors['compiler_id'] = 'Deocamdata, numai administratorii pot ' 50 .'trimite surse Python.'; 45 51 } 46 52 … … 56 62 57 63 // Check task submit security 58 if ( !security_query($user, 'task-submit', $task)) {64 if ($task && !security_query($user, 'task-submit', $task)) { 59 65 $errors[] = "Nu ai voie sa trimiti la acest task."; 60 66 } 61 if ($round != null&& !security_query($round, 'task-submit', $round)) {67 if ($round && !security_query($round, 'task-submit', $round)) { 62 68 $errors[] = "Nu poti sa trimiti la aceasta runda."; 63 69 } -
trunk/common/user.php
r852 r993 107 107 } 108 108 109 function user_is_admin($user) { 110 if (!$user) { 111 return false; 112 } 113 log_assert_valid(user_validate($user)); 114 return $user['security_level'] === 'admin'; 115 } 116 109 117 ?>
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)