-
Notifications
You must be signed in to change notification settings - Fork 5
/
action-status.inc
40 lines (31 loc) · 1.26 KB
/
action-status.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
<?php
if (!defined ("LOCAL_SECURITY_KEY"))
die ();
include_once ('include/openvpn-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");
// 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 : server status [refreshes every minute]');
$smarty->assign ('refresh', '60');
// Status Bar
$smarty->assign ('Server', $openvpn['Server']);
$smarty->assign ('Seconds_Ago', time () - $openvpn['Server']['Time']);
// Action
$smarty->assign ('action', 'STATUS');
// 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-status.tpl');
$smarty->display ('page.tpl');
?>