Changeset 792 for trunk/admin/configuration.php
- Timestamp:
- Jun 11, 2005, 4:10:04 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r700 r792 54 54 } 55 55 //------------------------------ verification and registration of modifications 56 $errors = array();57 56 if (isset($_POST['submit'])) 58 57 { … … 65 64 if (!preg_match('/^[\w-]*$/', $_POST['prefix_thumbnail'])) 66 65 { 67 array_push($ errors, $lang['conf_prefix_thumbnail_error']);66 array_push($page['errors'], $lang['conf_prefix_thumbnail_error']); 68 67 } 69 68 // mail must be formatted as follows : name@server.com … … 71 70 if (!preg_match($pattern, $_POST['mail_webmaster'])) 72 71 { 73 array_push($ errors, $lang['conf_mail_webmaster_error']);72 array_push($page['errors'], $lang['conf_mail_webmaster_error']); 74 73 } 75 74 break; … … 83 82 or $_POST['nb_comment_page'] > 50) 84 83 { 85 array_push($ errors, $lang['conf_nb_comment_page_error']);84 array_push($page['errors'], $lang['conf_nb_comment_page_error']); 86 85 } 87 86 break; … … 93 92 or $_POST['recent_period'] <= 0) 94 93 { 95 array_push($ errors, $lang['periods_error']);94 array_push($page['errors'], $lang['periods_error']); 96 95 } 97 96 break; … … 104 103 or $_POST['upload_maxfilesize'] > 1000) 105 104 { 106 array_push($ errors, $lang['conf_upload_maxfilesize_error']);105 array_push($page['errors'], $lang['conf_upload_maxfilesize_error']); 107 106 } 108 107 … … 114 113 { 115 114 if (!preg_match($int_pattern, $_POST[$field]) 116 or $_POST[$field] < 10)115 or $_POST[$field] < 10) 117 116 { 118 array_push($ errors, $lang['conf_'.$field.'_error']);117 array_push($page['errors'], $lang['conf_'.$field.'_error']); 119 118 } 120 119 } … … 124 123 125 124 // updating configuration if no error found 126 if (count($errors) == 0) 127 { 125 if (count($page['errors']) == 0) 126 { 127 echo '<pre>'; print_r($_POST); echo '</pre>'; 128 128 $result = pwg_query('SELECT * FROM '.CONFIG_TABLE); 129 129 while ($row = mysql_fetch_array($result)) … … 139 139 } 140 140 } 141 array_push($page['infos'], $lang['conf_confirmation']); 141 142 } 142 143 } … … 150 151 $template->assign_vars( 151 152 array( 152 'L_CONFIRM'=>$lang['conf_confirmation'],153 153 'L_YES'=>$lang['yes'], 154 154 'L_NO'=>$lang['no'], … … 344 344 } 345 345 } 346 //-------------------------------------------------------------- errors display347 if ( sizeof( $errors ) != 0 )348 {349 $template->assign_block_vars('errors',array());350 for ( $i = 0; $i < sizeof( $errors ); $i++ )351 {352 $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i]));353 }354 }355 elseif ( isset( $_POST['submit'] ) )356 {357 $template->assign_block_vars('confirmation' ,array());358 }359 346 //----------------------------------------------------------- sending html code 360 347 $template->assign_var_from_handle('ADMIN_CONTENT', 'config');
Note: See TracChangeset
for help on using the changeset viewer.