From f6f28f72894b5d54e9ded8c72c927bc8168e336f Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sun, 30 Mar 2003 00:31:38 +0000 Subject: Initial check-in for Administration controls. --- admin.php | 259 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 admin.php (limited to 'admin.php') diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..aadf7c0 --- /dev/null +++ b/admin.php @@ -0,0 +1,259 @@ +$invalid_login_lang"; + $is_loged_in = FALSE; + } + } + + if ($is_loged_in == FALSE) { + setcookie("username",""); + setcookie("password",""); + setcookie("md5_password",""); + } +} + +?> + + + + + + <?php echo "$admin_header_lang"; ?> + "> + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + +
  + + + + + + + + + + + + + + + + + + +
{$username_lang}:
{$password_lang}:
 
{$login_error} 
+ +EOT; + + + echo " +
+
"; + + include (BASE.'includes/footer.inc.php'); + + echo " +
+ + "; + + die(); +} + + +// The user is logged in if we get here + + + +// Add or Update a calendar +if ($action == "addupdate") { + $addupdate_success = FALSE; + if (!is_uploaded_file_v4($HTTP_POST_FILES['calfile']['tmp_name'])) { + $upload_error = get_upload_error($HTTP_POST_FILES['calfile']); + } + elseif (!is_uploaded_ics($HTTP_POST_FILES['calfile']['name'])) { + $upload_error = $upload_error_type_lang; + } + // copy() should be replaced with move_uploaded_file(), but only if we can require PHP 4 >= 4.0.3 + elseif (!copy($HTTP_POST_FILES['calfile']['tmp_name'], $calendar_path . "/" . $HTTP_POST_FILES['calfile']['name'])) { + $upload_error = $copy_error_lang . " " . $HTTP_POST_FILES['calfile']['tmp_name'] . " - " . $calendar_path . "/" . $HTTP_POST_FILES['calfile']['name']; + } + else { + $addupdate_success = TRUE; + } +} + +// Delete a calendar +// Not at all secure - need to strip out path info if used by users besides admin in the future +if ($action == "delete") { + $delete_success = FALSE; + + if (!unlink($calendar_path . "/" . urldecode($delete_calendar))) { + $delete_error = $delete_error_lang . " " . $calendar_path . "/" . urldecode($delete_calendar); + } + else { + $delete_success = TRUE; + } +} + +?> + + +

+

+
> + + + + + + + + + + + + + +
:
 
{$action_success_lang}"; } ?> 
+
+ +

+
> + + + + + + + + + + + + + +
: + \n"; + $filelist = get_calendar_files($calendar_path); + foreach ($filelist as $file) { + $cal_filename_tmp = substr($file,0,-4); + $cal_tmp = urlencode($file); + $cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp); + print "\n"; + } + print "\n"; + ?> +
 
{$action_success_lang}"; } ?> 
+
+ + + + + + + +"; + +include (BASE.'includes/footer.inc.php'); + +echo " + + "; +?> + -- cgit v1.2.3