-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
64 lines (59 loc) · 1.57 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* Created by PhpStorm.
* User: simon
* Date: 05.11.17
* Time: 14:19
*/
session_start();
ini_set("display_errors",true);
error_reporting(-1);
require_once("config.php");
require_once("class/Auth.php");
require_once("class/GetSSL.php");
require_once("class/TaskManager.php");
require_once("class/BackgroundProcess.php");
require_once('libs/smtemplate.php');
$tpl = new SMTemplate();
$pagename = "None";
$data = [];
$data["extrajs"] = "";
$ssl = new GetSSL();
$ssl->setdnsscripts($dnsscripts);
/* Logout */
if(isset($_GET["logout"])){
session_destroy();
header('Location: '.$_SERVER['PHP_SELF']);
die;
}
/* Not Authenticated*/
if(!Auth::isloggedin())
include "inc/pages/login.php";
else{
/* Authenticated */
if (!isset($_GET["p"])){
/* no page given */
header('Location: ?p=dash');
}else{
/* page given */
include("inc/pages/".$_GET["p"].".php");
}
/*Domain list for Sidebar*/
$data['domains'] = $ssl->getdomains();
/* $_GET for Page and Domain access*/
$data['get'] = $_GET;
/* editcert only */
$data['dnsscripts'] = $dnsscripts;
/* show extended info */
$data['showhelp'] = showhelp;
/* validate adddomain*/
if(isset($_POST["adddomain"])){
if($ssl->select($_POST["adddomain"]) != 0){
header("Location: ?p=certedit&d=".$_POST["adddomain"]);
}else{
$data["adddomain"]["value"] = $_POST["adddomain"];
$data["adddomain"]["error"] = "Validen Domainnamen angeben!";
}
}
}
$tpl->render($_GET["p"], $data, 'page', $pagename);