Changeset 1162
- Timestamp:
- 12/15/11 16:00:09 (5 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
tests/utilities.php (modified) (1 diff)
-
www/controllers/account_validator.php (modified) (1 diff)
-
www/controllers/attachment.php (modified) (1 diff)
-
www/controllers/textblock.php (modified) (1 diff)
-
www/views/userwidget.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/utilities.php
r1091 r1162 6 6 require_once(IA_ROOT_DIR."common/db/db.php"); 7 7 require_once(IA_ROOT_DIR."common/db/user.php"); 8 9 if (!IA_DEVELOPMENT_MODE) { 10 // These tests alter the database and can remove user created content 11 // by mistake (it has happened in the past). 12 log_error("You should never run these tests in a production environment"); 13 } 8 14 9 15 // Test with curl. $args format: -
trunk/www/controllers/account_validator.php
r1149 r1162 121 121 122 122 // Security 123 log_print($user['security_level']);124 123 if (!$register && array_key_exists('security_level', $data)) { 125 if ($ user['security_level'] != 'normal' &&126 $user['security_level'] != 'helper' &&127 $user['security_level'] != 'admin' &&128 $user['security_level'] != 'intern') {124 if ($data['security_level'] != 'normal' && 125 $data['security_level'] != 'helper' && 126 $data['security_level'] != 'admin' && 127 $data['security_level'] != 'intern') { 129 128 $errors['security_level'] = "Nivel de securitate invalid"; 130 129 } -
trunk/www/controllers/attachment.php
r1159 r1162 414 414 // Returns attachment model 415 415 function try_attachment_get($page_name, $file_name) { 416 if (!$file_name ) {416 if (!$file_name || !is_attachment_name($file_name)) { 417 417 die_http_error(); 418 418 } -
trunk/www/controllers/textblock.php
r1086 r1162 22 22 $rev_count = textblock_get_revision_count($page_name); 23 23 if ($rev_num && $rev_num != $rev_count) { 24 if (!is_numeric($rev_num) || (int)$rev_num < 1) { 25 flash_error('Revizia "' . $rev_num . '" este invalida.'); 26 redirect(url_textblock($page_name)); 27 } else { 28 $rev_num = (int)$rev_num; 29 } 24 30 identity_require("textblock-history", $crpage); 25 31 $page = textblock_get_revision($page_name, $rev_num); 26 32 27 33 if (!$page) { 28 flash_error( "Revizia \"{$rev_num}\" nu exista.");34 flash_error('Revizia "' . $rev_num . '" nu exista.'); 29 35 redirect(url_textblock($page_name)); 30 36 } -
trunk/www/views/userwidget.php
r1157 r1162 5 5 $my_img = imagecreatefromjpeg (IA_ROOT_DIR . "www/static/images/widget.jpg"); 6 6 $background = imagecolorallocate($my_img, 154, 205, 50); 7 $text_colo ur = imagecolorallocate($my_img, 255, 255, 255);7 $text_color = imagecolorallocate($my_img, 255, 255, 255); 8 8 $rating_value = (int) $view['rating']; 9 9 if($rating_value >= 600) { 10 $line_colour = imagecolorallocate($my_img, 178, 34, 34); 10 $line_color = imagecolorallocate($my_img, 178, 34, 34); 11 } else if ($rating_value >= 520) { 12 $line_color = imagecolorallocate($my_img, 255, 255, 0); 13 } else { 14 $line_color = imagecolorallocate($my_img, 50, 205, 50); 11 15 } 12 else if($rating_value >= 520) { 13 $line_colour = imagecolorallocate($my_img, 255, 255, 0); 14 } 15 else { 16 $line_colour = imagecolorallocate($my_img, 50, 205, 50); 17 } 18 imagestring($my_img, 3, 15, 42, $view['name'], $text_colour); 19 imagestring($my_img, 3, 115, 5, $print_rating, $text_colour); 20 imagestring($my_img, 3, 95, 19, "Succes: " . $view['succes'], $text_colour); 21 imagestring($my_img, 3, 15, 54, "Probleme rezolvate: " . $view['task_data_succes'], $text_colour); 22 imagestring($my_img, 3, 15, 65, "Probleme incercate: " . $view['task_data_failed'], $text_colour); 16 imagestring($my_img, 3, 15, 42, $view['name'], $text_color); 17 imagestring($my_img, 3, 115, 5, $print_rating, $text_color); 18 imagestring($my_img, 3, 95, 19, "Succes: " . $view['succes'], $text_color); 19 imagestring($my_img, 3, 15, 54, "Probleme rezolvate: " . $view['task_data_succes'], $text_color); 20 imagestring($my_img, 3, 15, 65, "Probleme incercate: " . $view['task_data_failed'], $text_color); 23 21 imagesetthickness($my_img, 5); 24 imageline($my_img, 0, 38, 200, 38, $line_colo ur);22 imageline($my_img, 0, 38, 200, 38, $line_color); 25 23 header("Content-type: image/png"); 26 24 imagepng($my_img); 27 imagecolordeallocate($ line_color);28 imagecolordeallocate($ text_color);29 imagecolordeallocate($ background);25 imagecolordeallocate($my_img, $line_color); 26 imagecolordeallocate($my_img, $text_color); 27 imagecolordeallocate($my_img, $background); 30 28 imagedestroy($my_img); 31 ?>29 ?>
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)