diff options
| author | Horus3 | 2014-10-28 23:47:28 +0100 |
|---|---|---|
| committer | Horus3 | 2014-10-28 23:47:28 +0100 |
| commit | 44870defdcddbfceede437950fd9e3342f84ebf0 (patch) | |
| tree | f4de13cd94be784ef02975df95d5f0edb50aac90 | |
| parent | 25610c0ccb4c7c99fe0d6d82d6738dbcc40d05e3 (diff) | |
| download | jungegemeinde-44870defdcddbfceede437950fd9e3342f84ebf0.tar.gz | |
Added experimental CDN support.
| -rw-r--r-- | action.php | 14 | ||||
| -rw-r--r-- | bootstrap.php | 9 | ||||
| -rw-r--r-- | cdn/originpull.php | 82 | ||||
| -rw-r--r-- | config-sample.php | 3 | ||||
| -rw-r--r-- | functions.php | 64 | ||||
| -rw-r--r-- | index.php | 2 | ||||
| -rwxr-xr-x | static/footer.php | 2 | ||||
| -rw-r--r-- | static/header.php | 24 | ||||
| -rw-r--r-- | static/modal-delete-gallery.php | 2 | ||||
| -rw-r--r-- | static/modal-edit-gallery.php | 2 | ||||
| -rw-r--r-- | static/modal-new-gallery.php (renamed from static/modal-new-gallery.html) | 2 |
11 files changed, 147 insertions, 59 deletions
@@ -8,7 +8,7 @@ if ( ! isset($_GET["page"]) || $_GET["page"] != "action" ){ if ( ! isset($_GET["task"]) || $_GET["task"] == "" ){ header($_SERVER["SERVER_PROTOCOL"] . "400 Wrong Request"); - header("Location: /?page=index"); + header("Location: ".DOMAIN."?page=index"); ob_clean(); exit; } @@ -27,7 +27,7 @@ switch($_GET["task"]){ } else if ( $user->login($_POST["name"], $_POST["password"]) ){ $goto = preg_replace("/;/", "&", $_GET["goto"]); header($_SERVER["SERVER_PROTOCOL"] . " 302 Moved"); - header("Location: /?page=" . $goto); + header("Location: ".DOMAIN."?page=" . $goto); ob_clean(); exit; } else { @@ -68,7 +68,7 @@ switch($_GET["task"]){ print_login("database"); else { header($_SERVER["SERVER_PROTOCOL"] . " 302 Moved"); - header("Location: /?page=" . $_GET["goto"]); + header("Location: ".DOMAIN."?page=" . $_GET["goto"]); ob_clean(); exit; } @@ -97,7 +97,7 @@ switch($_GET["task"]){ } if ( $result = $db->doQuery($sql) ){ header($_SERVER["SERVER_PROTOCOL"] . " 302 Moved"); - header("Location: /?page=" . $_GET["goto"]); + header("Location: ".DOMAIN."?page=" . $_GET["goto"]); $c->flush(); } } @@ -120,7 +120,7 @@ switch($_GET["task"]){ } if ( $result = $db->doQuery($sql) ){ header($_SERVER["SERVER_PROTOCOL"] . " 302 Moved"); - header("Location: /?page=" . $_GET["goto"]); + header("Location: ".DOMAIN."?page=" . $_GET["goto"]); $c->flush(); } break; @@ -143,7 +143,7 @@ switch($_GET["task"]){ } if ( $result = $db->doQuery($sql) ){ header($_SERVER["SERVER_PROTOCOL"] . " 302 Moved"); - header("Location: /?page=liste"); + header("Location: ".DOMAIN."?page=liste"); $c->flush(); exit; } else { @@ -235,7 +235,7 @@ switch($_GET["task"]){ $body = "Hello, someone requested a new password for '".$result_ar[1]."' on https://jungegemeinde.iamfabulous.de. -The new password is '". $password ."'. Remember to change it immediately at https://jungegemeinde.iamfabulous.de/?page=account after successfull login. +The new password is '". $password ."'. Remember to change it immediately at ".DOMAIN."?page=account after successfull login. Kindly regards, JG Adlershof"; diff --git a/bootstrap.php b/bootstrap.php index 098288b..bb82db1 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -18,12 +18,17 @@ if ( ! defined('SCHEME') ){ # hostname if ( ! defined('HOST') ) define('HOST', $_SERVER['HTTP_HOST']); +if ( ! defined('URI') ) + define('URI', '/'); if ( ! defined('DOMAIN') ) - define('DOMAIN', SCHEME . HOST); + define('DOMAIN', SCHEME . HOST . URI); +if ( ! define('CDN') ){ + define('CDN', DOMAIN); +} define('PROTECTED_BASE', 'protected/'); define('IMAGE_PATH', ABSPATH . PROTECTED_BASE); - define('IMAGE_URL' , DOMAIN . '/images/'); + define('IMAGE_URL' , DOMAIN . 'images/'); # define session name if ( ! defined('SESSION') ) diff --git a/cdn/originpull.php b/cdn/originpull.php new file mode 100644 index 0000000..00f9a03 --- /dev/null +++ b/cdn/originpull.php @@ -0,0 +1,82 @@ +<?php +exit; // REMOVE THIS LINE IN PRODUCTION ENVIRONMENT!!! + +if ( ! isset($_GET['url']) || $_GET['url'] == "" ){ + header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found"); + header('X-Cache: Miss'); + exit; +} +header('X-Cache: Hit'); + +define('ABSP', dirname(__FILE__) . '/'); + +# directory on origin website +define('URI', '/'); + +# origin website +define('ORIGIN', 'https://jungegemeinde.iamfabulous.de' . URI); + +# local directory +define('LOCAL', '/'); + +$basepath = array('js', 'static', 'img', 'static/img'); +$path_parts = pathinfo($_GET['url']); + +function getMime($file){ + $finfo = new finfo(FILEINFO_MIME_TYPE); + $mime = $finfo->file($file); + + # hack to get correct mime type for .css and .js + $ext = pathinfo($file,PATHINFO_EXTENSION); + switch($ext){ + case 'css': + $mime = "text/css"; + break; + case'js': + $mime = "text/javascript"; + break; + default: + break; + } + + return $mime; +} + +foreach($basepath as $dir){ + + if ( URI . $dir . "/" == $path_parts['dirname'] . '/' ){ + + if ( !is_dir(ABSP . $dir) ){ + mkdir(ABSP . $dir, 0744, true); + } + + $request = str_replace(URI . $dir . "/", "",$_GET['url'] ); + $scan = array_diff( scandir($dir), array('.', '..') ); + + if ( in_array($request, $scan) ){ + header("Content-type: " . getMime($dir . '/' . $request)); + header("X-Accel-Redirect: " . LOCAL . $dir . '/' . $request); + exit; + } else { + $ch = curl_init(ORIGIN . $dir . "/" . $request); + curl_setopt($ch, CURLOPT_NOBODY, true); + curl_setopt($ch, CURLOPT_USERAGENT, 'Origin Pull/v0.1'); + curl_exec($ch); + $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + + if ( $httpcode == 200 || $httpcode == 302 ) { + file_put_contents($dir . '/' . $request, file_get_contents(ORIGIN . $dir . "/" . $request) ); + header("Content-type: " . getMime($dir . '/' . $request)); + header("X-Accel-Redirect: " . LOCAL . $dir . '/' . $request); + exit; + } else { + continue; + } + } + } + +} + +header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found"); +header('X-Cache: Miss'); diff --git a/config-sample.php b/config-sample.php index 9535f54..23b947a 100644 --- a/config-sample.php +++ b/config-sample.php @@ -31,7 +31,8 @@ if ( ! defined('SESSION') ) ### hostname # define('HOST', 'jungegemeinde.iamfabulous.de'); -# define('DOMAIN', 'https://jungegemeinde.iamfabulous.de'); +# define('URI', '/jungegemeinde'); +# define('DOMAIN', 'https://jungegemeinde.iamfabulous.de/jg/'); #define('INVITEKEY', 'fadfhaoshfasodfhioadsfhadsofhpf'); define('INVITEKEY', 'secretkey'); diff --git a/functions.php b/functions.php index 17c2ce3..25c22b8 100644 --- a/functions.php +++ b/functions.php @@ -9,7 +9,7 @@ function lredirect($goto){ function redirect($goto){ header($_SERVER["SERVER_PROTOCOL"] . " 302 Moved"); - header("Location: /?page=".$goto); + header("Location: ".DOMAIN."?page=".$goto); ob_clean(); exit; } @@ -49,7 +49,7 @@ if( isset($_GET["goto"]) && $_GET["goto"] != "" ) { redirect("index"); } ?> -<form class="form-horizontal" method="POST" action="/?page=action&task=login&goto=<?php echo $goto; ?>"> +<form class="form-horizontal" method="POST" action="<?php echo DOMAIN; ?>?page=action&task=login&goto=<?php echo $goto; ?>"> <fieldset> <!-- Form Name --> @@ -105,7 +105,7 @@ if( isset($_GET["goto"]) && $_GET["goto"] != "" ) { <p><strong>Mit * markierte Felder sind Pflichtfelder.</strong></p> </div> <div class="row"> -<a href="/?page=recover" title="Recover your password">[Passwort vergessen?]</a> +<a href="<?php echo DOMAIN; ?>?page=recover" title="Recover your password">[Passwort vergessen?]</a> </div> <?php } @@ -117,7 +117,7 @@ function print_logout(){ if ( $user->isLoggedIn() ){ $user->logout(); header($_SERVER["SERVER_PROTOCOL"] . " 301 Moved"); - header("Location: ".DOMAIN."/?page=logout"); + header("Location: ".DOMAIN."?page=logout"); } print_login("logout"); } @@ -129,7 +129,7 @@ function print_index(){ </div> <div class="row"> <div class="ec"> - <img src="/static/kitten-prays-small.jpg" alt="praing kitten" class="img-responsive"> + <img src="<?php echo CDN; ?>static/kitten-prays-small.jpg" alt="praing kitten" class="img-responsive"> </div> </div> <br> @@ -149,7 +149,7 @@ function print_list($option = false){ global $moar; $moar->addHeader('<style>'.file_get_contents("static/tablesorter.min.css").'</style>'); - $moar->addFooter('<script src="/js/tablesorter.min.js" defer></script> + $moar->addFooter('<script src="'.CDN.'js/tablesorter.min.js" defer></script> <script> $(document).ready(function(){ $(function(){ @@ -222,8 +222,8 @@ $(document).ready(function(){ <td>".htmlentities($row['handynummer'])."</td> <td><a href='mailto:".htmlentities($row['email'])."' title='Sende ".htmlentities($row['name'])." eine E-Mail'>".htmlentities($row['email'])."</a></td> <td>".htmlentities($row['geburtstag'])."</td> - <!--td><a href='/?page=update&id=".htmlentities($row['member_id'])."' onclick=\"window.location='/?page=update&id=".htmlentities($row['member_id'])."'\"><input type='checkbox' name='change' value='true'></a></td--> - <td><a href='/?page=update&id=".htmlentities($row['member_id'])."' title='Ändere den Eintrag'><span class='glyphicon glyphicon-pencil'></span></a></td> + <!--td><a href='".DOMAIN."?page=update&id=".htmlentities($row['member_id'])."' onclick=\"window.location='".DOMAIN."?page=update&id=".htmlentities($row['member_id'])."'\"><input type='checkbox' name='change' value='true'></a></td--> + <td><a href='".DOMAIN."?page=update&id=".htmlentities($row['member_id'])."' title='Ändere den Eintrag'><span class='glyphicon glyphicon-pencil'></span></a></td> </tr>"; $count++; } @@ -231,7 +231,7 @@ $(document).ready(function(){ </tbody> </table> </div> - <form method="POST" action="/?page=add&_flush=<?php echo $c->token; ?>"> + <form method="POST" action="<?php echo DOMAIN; ?>?page=add&_flush=<?php echo $c->token; ?>"> <button id="singlebutton" class="btn btn-info" type="submit"><span class="glyphicon glyphicon-ok-sign"></span> Füge jemanden hinzu</button> </form> </div> @@ -257,7 +257,7 @@ function print_update_list($id){ <h1>Änderung für <?php echo htmlentities($row['name']); ?></h1> </div> <div class="row"> - <form method='POST' action='/?page=action&task=update&id=<?php echo htmlentities($row['member_id']); ?>&goto=liste'> + <form method='POST' action='<?php echo DOMAIN; ?>?page=action&task=update&id=<?php echo htmlentities($row['member_id']); ?>&goto=liste'> <div class="table-responsive"> <table class='table'> <thead> @@ -297,7 +297,7 @@ function print_update_list($id){ </form> </div> <br> - <form method="POST" action="/?page=action&task=delete&id=<?php echo htmlentities($_GET["id"]); ?>" class="form-horizontal"> + <form method="POST" action="<?php echo DOMAIN; ?>?page=action&task=delete&id=<?php echo htmlentities($_GET["id"]); ?>" class="form-horizontal"> <fieldset> <legend>Lösche "<?php echo $row["name"]; ?>" von der Liste</legend> <div class="form-group"> @@ -320,7 +320,7 @@ function print_add_entry_to_list(){ <h1>Füge die Daten hinzu</h1> </div> <div class="row"> - <form method='POST' action='/?page=action&task=add&goto=liste&_flush=<?php echo htmlentities($_GET["_flush"]); ?>'> + <form method='POST' action='<?php echo DOMAIN; ?>?page=action&task=add&goto=liste&_flush=<?php echo htmlentities($_GET["_flush"]); ?>'> <div class="table-responsive"> <table class='table'> <thead> @@ -383,9 +383,9 @@ function print_404(){ <div class="embed-responsive embed-responsive-16by9"> <!--video class="embed-responsive-item" src="/static/error.webm" controls autoplay loop></video--> <video class="embed-responsive-item" autoplay loop> - <source src="/static/error.webm" type="video/webm" media="all and (min-width: 720px)"> - <source src="/static/error-480.webm" type="video/webm" media="all and (min-width: 480px)"> - <source src="/static/error-320.webm" type="video/webm" media="all and (max-width: 479px)"> + <source src="<?php echo CDN; ?>static/error.webm" type="video/webm" media="all and (min-width: 720px)"> + <source src="<?php echo CDN; ?>static/error-480.webm" type="video/webm" media="all and (min-width: 480px)"> + <source src="<?php echo CDN; ?>static/error-320.webm" type="video/webm" media="all and (max-width: 479px)"> Tja, tut mir Leid. Leider unterstützt dein Browser keine HTML5 Videos. Schon mal über ein Upgrade nachgedacht? </video> </div> @@ -403,7 +403,7 @@ function print_register($option = false){ } ?> -<form class="form-horizontal" method='POST' action='/?page=action&task=register&goto=account'> +<form class="form-horizontal" method='POST' action='<?php echo DOMAIN; ?>?page=action&task=register&goto=account'> <fieldset> <!-- Form Name --> @@ -504,7 +504,7 @@ function print_account($option = false){ lredirect("account"); global $user; ?> -<form class="form-horizontal" method="POST" action="/?page=action&task=account&goto=account"> +<form class="form-horizontal" method="POST" action="<?php echo DOMAIN; ?>?page=action&task=account&goto=account"> <fieldset> <!-- Form Name --> @@ -589,14 +589,14 @@ function print_account($option = false){ <p><strong>Mit * markierte Felder sind Pflichtfelder.</strong></p> <h3>Log dich aus</h3> <hr> -<a href="/?page=logout" class="btn btn-danger"><span class="glyphicon glyphicon-off"></span> Logout</a> +<a href="<?php echo DOMAIN; ?>?page=logout" class="btn btn-danger"><span class="glyphicon glyphicon-off"></span> Logout</a> </div> <?php } function print_recover($option = false){ ?> -<form class="form-horizontal" method='POST' action='/?page=action&task=recover'> +<form class="form-horizontal" method='POST' action='<?php echo DOMAIN; ?>?page=action&task=recover'> <fieldset> <!-- Form Name --> @@ -654,7 +654,7 @@ function print_download(){ lredirect("download;type=".$type); header($_SERVER["SERVER_PROTOCOL"] . " 302 Moved"); - header("Refresh: 0; ".DOMAIN."/?page=action&task=download&type=".$type); + header("Refresh: 0; ".DOMAIN."?page=action&task=download&type=".$type); ?> <h1>Download</h1> <h4>Der Download der Adressliste (vom Typ 'text/<?php echo $type; ?>') sollte automatisch starten.</h4> @@ -662,7 +662,7 @@ function print_download(){ </div> <div class="row"> <strong><p>Ansonsten klick hier</p></strong> -<a href="/?page=action&task=download&type=<?php echo $type; ?>" class="btn btn-primary" title="Download Link"><span class="glyphicon glyphicon-arrow-down"></span> Download</a> +<a href="<?php echo DOMAIN; ?>?page=action&task=download&type=<?php echo $type; ?>" class="btn btn-primary" title="Download Link"><span class="glyphicon glyphicon-arrow-down"></span> Download</a> </div> <?php } @@ -678,7 +678,7 @@ function show_gallery(){ global $db; $sql = $db->prepare("SELECT name, description, owner, time FROM " . DBPREFIX . "gallery WHERE id = %d ;", $_GET["gallery"]); $res = $db->doQuery($sql); - require 'static/modal-new-gallery.html'; + require 'static/modal-new-gallery.php'; if ( $res->num_rows <= 0 ) { // Start 404 $c->bypassCache=true; @@ -700,7 +700,7 @@ function show_gallery(){ global $moar; $moar->addHeader( "<style>".file_get_contents('static/gallery.min.css')."</style>" ); - $moar->addFooter('<script src="/js/gallery.min.js" defer></script>'); + $moar->addFooter('<script src="'.CDN.'js/gallery.min.js" defer></script>'); if ( isset($_GET["edit"]) ){ $moar->addFooter('<script>$("#modal-edit-gallery").modal("show");</script>'); @@ -753,15 +753,15 @@ function show_gallery(){ } if ( $tab == $_GET["mode"] ) - echo '<li class="active"><a href="/?page=gallery&gallery='.htmlentities($_GET["gallery"]).'&mode='.$tab.'" role="tab">'.$span.$msg.'</a></li>'; + echo '<li class="active"><a href="'.DOMAIN.'?page=gallery&gallery='.htmlentities($_GET["gallery"]).'&mode='.$tab.'" role="tab">'.$span.$msg.'</a></li>'; else - echo '<li><a href="/?page=gallery&gallery='.htmlentities($_GET["gallery"]).'&mode='.$tab.'" role="tab">'.$span.$msg.'</a></li>'; + echo '<li><a href="'.DOMAIN.'?page=gallery&gallery='.htmlentities($_GET["gallery"]).'&mode='.$tab.'" role="tab">'.$span.$msg.'</a></li>'; } ?> <li><a href="#change" role="tab" onclick="$('#modal-edit-gallery').modal('show');"><span class="glyphicon glyphicon-cog"></span> Ändern</a></li> <li><a href="#new" role="tab" onclick="$('#modal-new-gallery').modal('show')"><span class="fa fa-plus"></span> Neu</a></li> <li><a href="#delete" role="tab" onclick="$('#modal-delete-gallery').modal('show')"><span class="glyphicon glyphicon-trash"></span> Löschen</a></li> - <li><a class="download" href="/?page=action&task=downloadGallery&gallery=<?php echo htmlentities($_GET["gallery"]); ?>" role="tab"><i class="fa fa-download"></i> + <li><a class="download" href="<?php echo DOMAIN; ?>?page=action&task=downloadGallery&gallery=<?php echo htmlentities($_GET["gallery"]); ?>" role="tab"><i class="fa fa-download"></i> <?php if ( isset($row['name']) && ! $c->exists2(CACHEPREFIX . $_GET["gallery"]) ) $c->set2(CACHEPREFIX . $_GET["gallery"], $row['name']); ?> Download</a></li> </ul> @@ -835,8 +835,8 @@ function show_gallery(){ </div> <?php } elseif ( $_GET["mode"] == "upload" ){ - $moar->addFooter('<script src="/js/upload.min.js" defer></script>'); - //$moar->addFooter('<script src="/js/upload.js" defer></script>'); + $moar->addFooter('<script src="'.CDN.'js/upload.min.js" defer></script>'); + //$moar->addFooter('<script src="'.CDN.'js/upload.js" defer></script>'); if ( $c->exists2(CACHEPREFIX . "gallery_no_download_" . $_SESSION["gallery"]) ) $moar->addFooter('<script>$(".download").addClass("disabled"); $("body").on("click", "a.disabled", function(event){ @@ -846,7 +846,7 @@ function show_gallery(){ <!-- Start Tab 'Upload' --> <div class="tab-pane active effect" id="upload"> <!-- The file upload form used as target for the file upload widget --> - <form id="fileupload" action="/images/" method="POST" enctype="multipart/form-data"> + <form id="fileupload" action="<?php echo DOMAIN; ?>images/" method="POST" enctype="multipart/form-data"> <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload --> <div class="row fileupload-buttonbar"> <div class="col-lg-7"> @@ -990,7 +990,7 @@ function show_gallery(){ function list_gallery(){ lredirect("foto"); - require 'static/modal-new-gallery.html'; + require 'static/modal-new-gallery.php'; ?> <h1>Liste aller Galerien</h1> <hr width="%0%"> @@ -1021,13 +1021,13 @@ function list_gallery(){ <li> <ul class="list-inline "> <li> - <h2><a href="/?page=gallery&gallery=<?php echo $row["id"]; ?>&mode=show" class="a-restore"><?php echo $span . htmlentities($row["name"]);?></a></h2> + <h2><a href="<?php echo DOMAIN; ?>?page=gallery&gallery=<?php echo $row["id"]; ?>&mode=show" class="a-restore"><?php echo $span . htmlentities($row["name"]);?></a></h2> </li> <li> <h5 class="desc">Erstellt von <u><?php echo htmlentities($name); ?></u> am <?php echo date("j.n.Y", $row["time"]); ?>.</h5> </li> <li> - <a href="/?page=gallery&gallery=<?php echo $row["id"]; ?>&edit=1" class="desc"><span class="glyphicon glyphicon-link font-small"></span>edit</a> + <a href="<?php echo DOMAIN; ?>?page=gallery&gallery=<?php echo $row["id"]; ?>&edit=1" class="desc"><span class="glyphicon glyphicon-link font-small"></span>edit</a> </li> </ul> </li> @@ -53,7 +53,7 @@ if( ! isset($_GET["page"]) || $_GET["page"] == "" ) <!--%%placeholder-head%%--> <noscript><style>.navbar{margin-bottom:0;}</style></noscript> <title>Junge Gemeinde Adlershof | <?php echo htmlentities(ucfirst($_GET["page"])); ?></title> - <link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'> + <link rel='shortcut icon' href='<?php echo CDN ?>favicon.ico' type='image/x-icon'> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <?php $moar->playHeader(); diff --git a/static/footer.php b/static/footer.php index 7c05018..f797d86 100755 --- a/static/footer.php +++ b/static/footer.php @@ -16,4 +16,4 @@ <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <script src="//code.jquery.com/ui/1.11.1/jquery-ui.min.js" defer></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" defer></script> - <script src="/js/functions.js" defer></script> + <script src="<?php echo CDN; ?>js/functions.js" defer></script> diff --git a/static/header.php b/static/header.php index 69a9c4b..824d4c1 100644 --- a/static/header.php +++ b/static/header.php @@ -7,20 +7,20 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand effect" href="/?page=index" title="Startseite"><span class="glyphicon glyphicon-home"></span> Home</a> + <a class="navbar-brand effect" href="<?php echo DOMAIN; ?>?page=index" title="Startseite"><span class="glyphicon glyphicon-home"></span> Home</a> </div> <div class="collapse navbar-collapse" id="navbarCollapse"> <ul class="nav navbar-nav navbar-left effect"> <li> - <!--a href="/?page=foto" title="Übersicht über alle Fotogalerien"><span class="fa fa-camera"></span> Bilder</a--> - <a href="/?page=foto" title="Übersicht über alle Fotogalerien"><span class="glyphicon glyphicon-picture"></span> Bilder</a> + <!--a href="<?php echo DOMAIN; ?>?page=foto" title="Übersicht über alle Fotogalerien"><span class="fa fa-camera"></span> Bilder</a--> + <a href="<?php echo DOMAIN; ?>?page=foto" title="Übersicht über alle Fotogalerien"><span class="glyphicon glyphicon-picture"></span> Bilder</a> </li> <li class="dropdown"> - <a href="/?page=liste" title="Liste aller JG-Mitglieder"><span class="glyphicon glyphicon-th-list"></span> Adressen <span class="caret"></span></a> + <a href="<?php echo DOMAIN; ?>?page=liste" title="Liste aller JG-Mitglieder"><span class="glyphicon glyphicon-th-list"></span> Adressen <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> - <li><a href="/?page=download&task=download&type=plain" title="Download: text/plain"><span class="glyphicon glyphicon-download"></span> Download als Text</a></li> - <!--li><a href="/?page=download&task=download&type=csv" title="Download: text/csv"><span class="glyphicon glyphicon-arrow-down"></span> Download als CSV</a></li--> - <li><a href="/?page=download&task=download&type=csv" title="Download: text/csv"><span class="fa fa-download"></span> Download als CSV</a></li> + <li><a href="<?php echo DOMAIN; ?>?page=download&task=download&type=plain" title="Download: text/plain"><span class="glyphicon glyphicon-download"></span> Download als Text</a></li> + <!--li><a href="<?php echo DOMAIN; ?>?page=download&task=download&type=csv" title="Download: text/csv"><span class="glyphicon glyphicon-arrow-down"></span> Download als CSV</a></li--> + <li><a href="<?php echo DOMAIN; ?>?page=download&task=download&type=csv" title="Download: text/csv"><span class="fa fa-download"></span> Download als CSV</a></li> </ul> </li> <li> @@ -44,25 +44,25 @@ $_title = "Einloggen, registrieren, Profil"; } ?> - <a href="/?page=account" title="<?php echo $_title; ?>"><span class="glyphicon glyphicon-user"></span> <?php echo $_name; ?> <span class="caret"></span></a> + <a href="<?php echo DOMAIN; ?>?page=account" title="<?php echo $_title; ?>"><span class="glyphicon glyphicon-user"></span> <?php echo $_name; ?> <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li> <?php if ( $user->isLoggedIn() ) { ?> - <a href="/?page=account" title="Ändere dein Passwort"><span class="glyphicon glyphicon-user"></span> Profil</a> + <a href="<?php echo DOMAIN; ?>?page=account" title="Ändere dein Passwort"><span class="glyphicon glyphicon-user"></span> Profil</a> </li> <li class="divider"></li> <li> - <a href="/?page=logout" title="Beende die Session"><span class="glyphicon glyphicon-off"></span> Logout</a> + <a href="<?php echo DOMAIN; ?>?page=logout" title="Beende die Session"><span class="glyphicon glyphicon-off"></span> Logout</a> <?php } else { ?> - <a href="/?page=register&goto=index" title="Registriere dich für unbeschränkten Zugang"><span class="glyphicon glyphicon-share-alt"></span> Register</a> + <a href="<?php echo DOMAIN; ?>?page=register&goto=index" title="Registriere dich für unbeschränkten Zugang"><span class="glyphicon glyphicon-share-alt"></span> Register</a> </li> <li class="divider"></li> <li> - <a href="/?page=login&goto=index" title="Login"><span class="glyphicon glyphicon-log-in"></span> Login</a> + <a href="<?php echo DOMAIN; ?>?page=login&goto=index" title="Login"><span class="glyphicon glyphicon-log-in"></span> Login</a> <?php } ?> diff --git a/static/modal-delete-gallery.php b/static/modal-delete-gallery.php index 74471ac..df16d76 100644 --- a/static/modal-delete-gallery.php +++ b/static/modal-delete-gallery.php @@ -1,5 +1,5 @@ <!-- Modal --> -<form class="form-horizontal" method="POST" action="/?page=action&task=deleteGallery&gallery=<?php echo htmlentities($_SESSION['gallery']); ?>"> +<form class="form-horizontal" method="POST" action="<?php echo DOMAIN; ?>?page=action&task=deleteGallery&gallery=<?php echo htmlentities($_SESSION['gallery']); ?>"> <div class="modal fade" id="modal-delete-gallery" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> diff --git a/static/modal-edit-gallery.php b/static/modal-edit-gallery.php index d16e580..d44348c 100644 --- a/static/modal-edit-gallery.php +++ b/static/modal-edit-gallery.php @@ -1,5 +1,5 @@ <!-- Modal --> -<form class="form-horizontal" method="POST" action="/?page=action&task=editGallery&gallery=<?php echo htmlentities($_SESSION['gallery']); ?>"> +<form class="form-horizontal" method="POST" action="<?php echo DOMAIN; ?>?page=action&task=editGallery&gallery=<?php echo htmlentities($_SESSION['gallery']); ?>"> <div class="modal fade" id="modal-edit-gallery" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> diff --git a/static/modal-new-gallery.html b/static/modal-new-gallery.php index 3d0b3f9..cf3f892 100644 --- a/static/modal-new-gallery.html +++ b/static/modal-new-gallery.php @@ -1,5 +1,5 @@ <!-- Modal --> -<form class="form-horizontal" method="POST" action="/?page=action&task=gallery"> +<form class="form-horizontal" method="POST" action="<?php echo DOMAIN; ?>?page=action&task=gallery"> <div class="modal fade" id="modal-new-gallery" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> |
