Changeset 345 for trunk/upload.php
- Timestamp:
- Feb 2, 2004, 1:55:18 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upload.php
r150 r345 17 17 * * 18 18 ***************************************************************************/ 19 20 //----------------------------------------------------------- include 21 $phpwg_root_path = './'; 22 include_once( $phpwg_root_path.'common.php' ); 19 23 20 24 //------------------------------------------------------------------- functions … … 95 99 @unlink( $temp_name ); 96 100 } 101 else 102 { 103 @chmod( $temp_name, 0644); 104 } 97 105 return $result; 98 106 } 99 //----------------------------------------------------------- personnal include 100 include_once( './include/init.inc.php' ); 107 101 108 //-------------------------------------------------- access authorization check 102 109 check_login_authorization(); … … 110 117 $page['cat_name'] = $result['name']; 111 118 $page['cat_uploadable'] = $result['uploadable']; 112 } 113 else 114 { 115 $access_forbidden = true; 116 } 117 if ( $access_forbidden == true 118 or $page['cat_site_id'] != 1 119 if ( $page['cat_site_id'] != 1 119 120 or !$conf['upload_available'] 120 121 or !$page['cat_uploadable'] ) … … 125 126 exit(); 126 127 } 128 } 127 129 //----------------------------------------------------- template initialization 128 $vtp = new VTemplate; 130 // 131 // Start output of page 132 // 133 $title= $lang['upload_title']; 134 include('include/page_header.php'); 129 135 $handle = $vtp->Open( './template/'.$user['template'].'/upload.vtp' ); 130 136 initialize_template(); … … 165 171 array_push( $error, $lang['upload_err_username'] ); 166 172 } 167 173 174 $date_creation = ''; 168 175 if ( $_POST['date_creation'] != '' ) 169 176 { … … 190 197 $xml_infos.= ' name="'.htmlspecialchars( $_POST['name'], ENT_QUOTES).'"'; 191 198 $xml_infos.= ' />'; 199 200 if ( !preg_match( '/^[a-zA-Z0-9-_.]+$/', $_FILES['picture']['name'] ) ) 201 { 202 // reload language file with administration labels 203 $isadmin = true; 204 include( './language/'.$user['language'].'.php' ); 205 array_push( $error, $lang['update_wrong_dirname'] ); 206 } 192 207 193 208 if ( sizeof( $error ) == 0 ) … … 196 211 $conf['upload_maxwidth'], 197 212 $conf['upload_maxheight'] ); 198 $upload_type = $result['type'];199 213 for ( $j = 0; $j < sizeof( $result['error'] ); $j++ ) 200 214 { … … 238 252 $conf['upload_maxwidth_thumbnail'], 239 253 $conf['upload_maxheight_thumbnail'] ); 240 $upload_type = $result['type'];241 254 for ( $j = 0; $j < sizeof( $result['error'] ); $j++ ) 242 255 { … … 348 361 $vtp->setGlobalVar( $handle, 'user_mail_address',$user['mail_address'] ); 349 362 // name of the picture 363 if (isset($_POST['name'])) 350 364 $vtp->setVar( $handle, 'fields.name', $_POST['name'] ); 351 365 // author 366 if (isset($_POST['author'])) 352 367 $vtp->setVar( $handle, 'fields.author', $_POST['author'] ); 353 368 // date of creation 369 if (isset($_POST['date_creation'])) 354 370 $vtp->setVar( $handle, 'fields.date_creation', $_POST['date_creation'] ); 355 371 // comment 372 if (isset($_POST['comment'])) 356 373 $vtp->setVar( $handle, 'fields.comment', $_POST['comment'] ); 357 374 … … 374 391 $code = $vtp->Display( $handle, 0 ); 375 392 echo $code; 393 include('include/page_tail.php'); 376 394 ?>
Note: See TracChangeset
for help on using the changeset viewer.