From 9e07f4f2019973e0a42d6b1e21534572efee8013 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Tue, 13 May 2003 04:14:22 +0000 Subject: part two of admin.php --- functions/upload_functions.php | 83 ------------------------------------------ 1 file changed, 83 deletions(-) (limited to 'functions') diff --git a/functions/upload_functions.php b/functions/upload_functions.php index 376e3cd..e69de29 100644 --- a/functions/upload_functions.php +++ b/functions/upload_functions.php @@ -1,83 +0,0 @@ -= 4.2.0 - $error = $php_error_lang . " "; - switch($uploaded_file['error']) { - case 0: //no error; possible file attack! - case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini - case 2: //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form - case 3: //uploaded file was only partially uploaded - case 4: //no file was uploaded - $error = $error . $uploaded_file['error'] . ": " . $upload_error_lang[$uploaded_file['error']]; - break; - default: //a default error, just in case! :) - $error = $error . $uploaded_file['error'] . ": " . $upload_error_gen_lang; - break; - } - } - else { - $error = $upload_error_gen_lang; - } - - return $error; -} - -// Check to see that the file has an .ics extension -// -// arg0: string filename -// returns booloean does the filename end in .ics -function is_uploaded_ics ($filename) { - // Check the file extension for .ics. Can also check the the mime type, but it's not reliable so why bother... - if(preg_match("/.ics$/i", $filename)) { - return TRUE; - } - else { - return FALSE; - } -} - -// Get all calendar filenames (not including path) -// -// argo: string path to calendar files -// returns array filenames (not including path) -function get_calendar_files($calendar_path) { - global $error_path_lang; - - $dir_handle = @opendir($calendar_path) or die(error(sprintf($error_path_lang, $calendar_path))); - $filelist = array(); - while ($file = readdir($dir_handle)) { - if (substr($file, -4) == ".ics") { - array_push($filelist, $file); - } - } - closedir($dir_handle); - natcasesort($filelist); - return $filelist; -} - -?> \ No newline at end of file -- cgit v1.2.3