aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2004-10-25 17:16:07 +0000
committerChad Little <clittle@users.sourceforge.net>2004-10-25 17:16:07 +0000
commitf1a377b8f764275248ef91fa84a79576efe84136 (patch)
tree7a910efa078f61c3d84b5aadcb262da633b6e77f /admin
parent3d5388d9730504775b56c7ef9e9776b48c1b1689 (diff)
downloadphpicalendar-f1a377b8f764275248ef91fa84a79576efe84136.tar.gz
phpicalendar-f1a377b8f764275248ef91fa84a79576efe84136.tar.bz2
phpicalendar-f1a377b8f764275248ef91fa84a79576efe84136.zip
More error messages. Fixed default paths everywhere.
Diffstat (limited to 'admin')
-rw-r--r--admin/index.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/admin/index.php b/admin/index.php
index 95f60c7..b2775e8 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -5,12 +5,15 @@ require_once(BASE.'functions/ical_parser.php');
require_once(BASE.'functions/template.php');
header("Content-Type: text/html; charset=$charset");
-$default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/admin/'));
-
-// Redirect if administration is not allowed
-if ($allow_admin != "yes") {
- header("Location: index.php");
- die();
+if (empty($default_path)) {
+ if (isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'on' ) {
+ $default_path = 'https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/admin/'));
+ } else {
+ $default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/admin/'));
+ }
+}
+if ($allow_admin != 'yes') {
+ exit(error('The administration menu has been turned off.', $cal, '../'));
}
// Load variables from forms and query strings into local scope

© 2014-2024 Faster IT GmbH | imprint | privacy policy