Changeset 1076 for trunk/common
- Timestamp:
- 12/13/09 18:05:25 (2 years ago)
- Location:
- trunk/common
- Files:
-
- 2 edited
-
common.php (modified) (1 diff)
-
round.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/common.php
r1074 r1076 78 78 define("IA_TLF_TRIED", '2'); 79 79 define("IA_TLF_SOLVED", '3'); 80 81 // Constants for IA user-defined rounds 82 // Users can't create rounds lasting 123141231223 hours 83 define("IA_USER_DEFINED_ROUND_DURATION_LIMIT", '48'); 84 // Users can't create rounds 5412312421 days before the round starts 85 define("IA_USER_DEFINED_ROUND_DAYSBEFORE_LIMIT", '30'); 86 // Users can't create user defined rounds with too many problems 87 define("IA_USER_DEFINED_ROUND_TASK_LIMIT", '25'); 80 88 81 89 // Windows hack for checkdnsrr function. -
trunk/common/round.php
r1046 r1076 51 51 function round_validate_parameters($round_type, $parameters) { 52 52 $errors = array(); 53 if ($round_type == 'classic' or $round_type == 'user-defined') { 53 if ($round_type == 'classic' or $round_type == 'user-defined' 54 or $round_type == 'archive') { 54 55 // Check duration 55 56 $duration = getattr($parameters, 'duration'); … … 57 58 $errors['duration'] = "Durata trebuie specificata"; 58 59 } 60 61 if ($round_type == 'user-defined') { 62 if ($duration > IA_USER_DEFINED_ROUND_DURATION_LIMIT) { 63 $errors['duration'] = "Durata maxim admisa este de " . 64 IA_USER_DEFINED_ROUND_DURATION_LIMIT . " ore"; 65 } 66 } 67 59 68 if (!is_numeric($duration) || $duration < 0) { 60 69 $errors['duration'] = "Durata trebuie sa fie un numar pozitiv"; 61 70 } 62 } elseif ($round_type == 'archive') {63 // Empty...64 71 } else { 65 72 log_error("Bad round_type"); … … 119 126 if (!is_db_date(getattr($round, 'start_time', db_date_format()))) { 120 127 $errors['start_time'] = "Timpul trebuie specificat ca YYYY-MM-DD HH:MM:SS"; 128 } else { 129 if ($round['type'] == 'user-defined') { 130 $current_time = db_date_parse(date("Y-m-d H:i:s")); 131 $round_time = db_date_parse($round['start_time']); 132 133 if (($round_time - $current_time) > 134 IA_USER_DEFINED_ROUND_DAYSBEFORE_LIMIT * 60 * 60 * 24) { 135 $errors['start_time'] = "Nu poti creea o runda cu mai mult de " 136 . IA_USER_DEFINED_ROUND_DAYSBEFORE_LIMIT . " zile inainte"; 137 } 138 } 121 139 } 122 140
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)