From 12ae38729860172ade2fd1d57ac9b5907cb22102 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 7 Feb 2017 21:37:47 +0100 Subject: [PATCH] Prepare ui for ldap --- include/config.php | 7 +++ include/connect.php | 2 +- include/functions.php | 40 +++++++------ include/grids.php | 10 +++- include/html/grids.php | 73 ++++++++++++++--------- index.php | 19 +++--- js/grids.js | 130 ++++++++++++++++++++++++----------------- migration.php | 6 +- 8 files changed, 173 insertions(+), 114 deletions(-) diff --git a/include/config.php b/include/config.php index 8d6a3de..b6cdc91 100644 --- a/include/config.php +++ b/include/config.php @@ -1,7 +1,14 @@ SQL, true -> LDAP + $useLDAP = false; + $host = 'localhost'; + // 389 if your want to use LDAP $port = '3306'; + + // Unused with LDAP $db = 'openvpn-admin'; + $user = ''; $pass = ''; ?> diff --git a/include/connect.php b/include/connect.php index 0add7e4..f41e8c2 100644 --- a/include/connect.php +++ b/include/connect.php @@ -1,5 +1,5 @@ diff --git a/include/grids.php b/include/grids.php index 2af635d..8155b0c 100644 --- a/include/grids.php +++ b/include/grids.php @@ -4,8 +4,8 @@ if(!isset($_SESSION['admin_id'])) exit -1; - require(dirname(__FILE__) . '/connect.php'); - require(dirname(__FILE__) . '/functions.php'); + require_once(dirname(__FILE__) . '/connect.php'); + require_once(dirname(__FILE__) . '/functions.php'); // ---------------- SELECT ---------------- @@ -37,6 +37,12 @@ } } + else if ($_GET['select'] == "user_ldap") { + // Fake data for now + + echo json_encode([ [ "user_ldap_id" => "blabla", "user_ldap_online" => 1 ] ]); + } + // Select the logs else if($_GET['select'] == "log" && isset($_GET['offset'], $_GET['limit'])){ $offset = intval($_GET['offset']); diff --git a/include/html/grids.php b/include/html/grids.php index 2d7bad1..35291f4 100644 --- a/include/html/grids.php +++ b/include/html/grids.php @@ -1,35 +1,56 @@ - -
-

- OpenVPN Users -

-
+ -