Changeset 1076 for trunk/common/round.php
- Timestamp:
- 12/13/09 18:05:25 (2 years ago)
- File:
-
- 1 edited
-
trunk/common/round.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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)