From e481bdad8a23e896643b867a6d5bb2d0f91fea0f Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 25 Oct 2004 02:21:26 +0000 Subject: Errors now seem to all work! --- functions/calendar_functions.php | 10 +++---- functions/error.php | 56 ---------------------------------------- functions/init.inc.php | 2 +- 3 files changed, 6 insertions(+), 62 deletions(-) delete mode 100644 functions/error.php (limited to 'functions') diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php index 79883d8..e04883d 100644 --- a/functions/calendar_functions.php +++ b/functions/calendar_functions.php @@ -14,7 +14,7 @@ // returned. function availableCalendars($username, $password, $cal_filename, $admin = false) { // Import globals. - global $allow_login, $calendar_path, $blacklisted_cals, $list_webcals, $locked_cals, $locked_map, $apache_map, $error_path_lang, $error_restrictedcal_lang, $error_invalidcal_lang, $ALL_CALENDARS_COMBINED, $_SERVER; + global $allow_login, $calendar_path, $blacklisted_cals, $list_webcals, $locked_cals, $locked_map, $apache_map, $lang, $ALL_CALENDARS_COMBINED, $_SERVER; // Create the list of available calendars. $calendars = array(); @@ -36,7 +36,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) if ($cal_filename == $ALL_CALENDARS_COMBINED || $admin) { // Add local calendars. $dir_handle = @opendir($calendar_path) - or die(error(sprintf($error_path_lang, $calendar_path), $cal_filename)); + or die(error(sprintf($lang['l_error_path'], $calendar_path), $cal_filename)); while (($file = readdir($dir_handle)) != false) { // Make sure this is not a dot file and it ends with .ics, // and that it is not blacklisted. @@ -80,7 +80,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) // to remove a .ics suffix because it would not have been passed // in the argument. if (in_array($cal_filename, $blacklisted_cals)) - exit(error($error_restrictedcal_lang, $cal_filename)); + exit(error($lang['l_error_restrictedcal'], $cal_filename)); // If HTTP authenticated, make sure this calendar is available // to the user. @@ -88,7 +88,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) if (!in_array($cal_filename, $apache_map[$http_user])) { // Use the invalid calendar message so that the user is // not made aware of locked calendars. - exit(error($error_invalidcal_lang, $cal_filename)); + exit(error($lang['l_error_invalidcal'], $cal_filename)); } } @@ -98,7 +98,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) { // Use the invalid calendar message so that the user is // not made aware of locked calendars. - exit(error($error_invalidcal_lang, $cal_filename)); + exit(error($lang['l_error_invalidcal'], $cal_filename)); } // Add this calendar. diff --git a/functions/error.php b/functions/error.php deleted file mode 100644 index e69c020..0000000 --- a/functions/error.php +++ /dev/null @@ -1,56 +0,0 @@ -replace_tags(array( - 'header' => BASE.'templates/'.$template.'/header.tpl', - 'footer' => BASE.'templates/'.$template.'/footer.tpl', - 'calendar_nav' => BASE.'templates/'.$template.'/calendar_nav.tpl', - 'default_path' => '', - 'template' => $template, - 'cal' => $cal, - 'getdate' => $getdate, - 'calendar_name' => $calendar_name, - 'display_date' => $display_date, - 'rss_powered' => $rss_powered, - 'rss_available' => '', - 'event_js' => '', - 'todo_js' => '', - 'todo_available' => '', - 'rss_valid' => '', - 'error_msg' => $error_msg, - 'error_calendar' => $error_calendar, - 'generated' => $generated, - 'l_powered_by' => $lang['l_powered_by'], - 'l_error_back' => $lang['l_error_back'], - 'l_error_window' => $lang['l_error_window'] - - )); - - $page->output(); - - - -} - -?> \ No newline at end of file diff --git a/functions/init.inc.php b/functions/init.inc.php index d5843ed..6f21282 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -14,7 +14,7 @@ $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; // Pull in the configuration and some functions. if (!defined('BASE')) define('BASE', './'); include_once(BASE.'config.inc.php'); -include_once(BASE.'functions/error.php'); +include_once(BASE.'error.php'); include_once(BASE.'functions/calendar_functions.php'); include_once(BASE.'functions/userauth_functions.php'); if (isset($_COOKIE['phpicalendar'])) { -- cgit v1.2.3