-
Notifications
You must be signed in to change notification settings - Fork 5
/
action-certificates.inc
46 lines (36 loc) · 1.46 KB
/
action-certificates.inc
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
<?php
if (!defined ("LOCAL_SECURITY_KEY"))
die ();
include_once ('include/openvpn-functions.inc');
include_once ('include/openssl-functions.inc');
openvpn_load_server_conf ();
if (!isset ($openvpn['Server'])) html_error ("The OpenVPN server has no configuration file");
openvpn_load_status ();
if (!isset ($openvpn['Server']['Title'])) html_error ("The OpenVPN server has no status file");
openssl_load_database ();
openvpn_find_connected ();
// load Smarty library
require('Smarty.class.php');
$smarty = new Smarty;
// Decoration
$smarty->assign ('Company_Name', $config['Company_Name']);
$smarty->assign ('Company_Logo', $config['Company_Logo']);
$smarty->assign ('URL_Home_Page', $config['URL_Home_Page']);
$smarty->assign ('title', 'OpenVPN Web GUI : OpenSSL certificates [refreshes every minute]');
$smarty->assign ('refresh', '60');
// Status Bar
$smarty->assign ('Server', $openvpn['Server']);
$smarty->assign ('Seconds_Ago', time () - $openvpn['Server']['Time']);
$smarty->assign ('Certificates', $openssl['Database']);
// Action
$smarty->assign ('action', 'CERTIFICATES');
// Action-Specific
if (isset ($openvpn['Client']))
$smarty->assign ('Client', $openvpn['Client']);
// Display
$smarty->assign ('PluginPath', $config['PluginsAbsolutePath']);
$smarty->assign ('Plugins', $config['Plugins']);
$smarty->assign ('Page', 'action-certificates.tpl');
$smarty->display ('page.tpl');
//print_r ($GLOBALS);
?>