Add handling of email subscriptions

- Translation issue fixes #64

- Adds handler for email subscription requests
This commit is contained in:
Thomas Nilsen 2018-11-25 18:33:25 +01:00
parent 528cb77952
commit 3eccbf529e

View File

@ -1,17 +1,35 @@
<?php
require_once("libs/parsedown/Parsedown.php");
if (!file_exists("config.php")) {
require_once("install.php");
} elseif(isset($_GET['do'])) { // we can add other actions with $_GET['do'] later.
// Fix for translation via _(). We need config.php first...
require_once("config.php");
require_once("template.php");
if (!file_exists("config.php"))
{
require_once("install.php");
} elseif(isset($_GET['do'])){ // we can add other actions with $_GET['do'] later.
if($_GET['do'] == "subscriptions"){
switch ($_GET['do']) {
case 'subscriptions':
require_once("subscriptions.php");
break;
case 'email_subscription':
case 'manage':
case 'unsubscribe';
require_once("email_subscriptions.php");
break;
default:
// TODO : How to handle url invalid/unknown [do] commands
header('Location: index.php');
break;
}
}
else{
} else {
require_once("config.php");
require_once("template.php");
require_once("classes/constellation.php");
$offset = 0;
@ -28,6 +46,10 @@ if (isset($_GET['ajax']))
if (isset($_GET['subscriber_logout'])){
setcookie('tg_user', '');
setcookie('referer', '', time() - 3600);
$_SESSION['subscriber_valid'] = false;
unset($_SESSION['subscriber_userid']);
unset($_SESSION['subscriber_typeid']);
unset($_SESSION['subscriber_id']);
header('Location: index.php');
}