changeset 609 | ffa5decbb305 |
parent 593 | 4f9bec0d65c1 |
child 685 | 17ebe24cdf85 |
608:ec9385bb7243 | 609:ffa5decbb305 |
---|---|
47 |
47 |
48 function page_Special_UploadFile() |
48 function page_Special_UploadFile() |
49 { |
49 { |
50 global $db, $session, $paths, $template, $plugins; // Common objects |
50 global $db, $session, $paths, $template, $plugins; // Common objects |
51 global $lang; |
51 global $lang; |
52 global $cache; |
|
52 global $mime_types; |
53 global $mime_types; |
53 if(getConfig('enable_uploads')!='1') { die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('upload_err_disabled_site') . '</p>'); } |
54 if(getConfig('enable_uploads')!='1') { die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('upload_err_disabled_site') . '</p>'); } |
54 if ( !$session->get_permissions('upload_files') ) |
55 if ( !$session->get_permissions('upload_files') ) |
55 { |
56 { |
56 die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('upload_err_disabled_acl') . '</p>'); |
57 die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('upload_err_disabled_acl') . '</p>'); |
146 } |
147 } |
147 else |
148 else |
148 { |
149 { |
149 if(!$db->sql_query('INSERT INTO '.table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace,edit_summary) VALUES('.$utime.', \''.enano_date('d M Y h:i a').'\', \'page\', \'reupload\', \''.$session->username.'\', \''.$filename.'\', \''.'File'.'\', \''.$comments.'\');')) $db->_die('The page log could not be updated.'); |
150 if(!$db->sql_query('INSERT INTO '.table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace,edit_summary) VALUES('.$utime.', \''.enano_date('d M Y h:i a').'\', \'page\', \'reupload\', \''.$session->username.'\', \''.$filename.'\', \''.'File'.'\', \''.$comments.'\');')) $db->_die('The page log could not be updated.'); |
150 } |
151 } |
152 $cache->purge('page_meta'); |
|
151 die_friendly($lang->get('upload_success_title'), '<p>' . $lang->get('upload_success_body', array('file_link' => makeUrlNS('File', $filename))) . '</p>'); |
153 die_friendly($lang->get('upload_success_title'), '<p>' . $lang->get('upload_success_body', array('file_link' => makeUrlNS('File', $filename))) . '</p>'); |
152 } |
154 } |
153 else |
155 else |
154 { |
156 { |
155 $template->header(); |
157 $template->header(); |