-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathservice-available.php
86 lines (72 loc) · 2.65 KB
/
service-available.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
session_start();
require_once 'classes/class.ldap.php';
$Ldap= new LDAP();
$current_page=basename(__FILE__);
$Ldap->check_login_or_redirect($current_page);
$message='';
require_once('header.php');
//connect and BInd
$ldapconn=$Ldap->connect();
$psw=$Ldap->decrypt_psw();
if ($ldapconn){
$ldapbind=$Ldap->bind($ldapconn,$_SESSION["login"]["dn"],$psw);
}
#TODO: Check user level to show and allow differents permissions
#Level 10= admin : can read and manage all accounts
#Level 4 postmaster (domain administrator) can read and edit all accounts related to his domain excluded VPN
#level 2 : simple user. Can read and edit only his own data (basically email related)
#need LDAP ACL to be set
#
$permissions= $_SESSION["login"]["level"];
//Only admin can see this page
if ($permissions==2){
$Ldap->redirect('404.php');
}
//Check if a custom mail has been set
if ($ldapbind) {
$serv_avail= $Ldap->search($ldapconn, LDAP_SERVICES ,'(&(objectClass=organizationalUnit)(status=disabled)(type=available))');
}
// var_dump($serv_enabled);
// Get current language and swith url
if ($_SESSION["language"]=="en_GB"){
$url = 'https://maadix.net/en/services-available.php';
} else {
$url = 'https://maadix.net/services-available.php';
}
//echo file_get_contents($url);
?>
<div id="admin-content" class="content">
<div class="col-sm-12">
<div class="inner" id="maincol">
<?php
//echo "<h2>" . sprintf(_("Servicios disponibles")) . "</h2>";
echo file_get_contents($url);
//$num_serv=$serv_enabled["count"];
/*for ($c=0; $c<$serv_avail["count"]; $c++) {
$service=$serv_avail[$c]["ou"][0];
$service_data=get_service_data($service);
echo "<div class='row'>";
echo "<div class='col-sm-2'>";
echo "<div class='img service-img'><img src='" . $service_data['image'] . "' /></div>";
echo "</div>";
echo "<div class='col-sm-12'>";
echo "<h3 class='title'>" . $service_data['title'] . "</h3>";
echo "<div class='img service-img'><img src='" . $service_data['image'] . "' /></div>";
echo "<h4>Software: " . $service_data['software'] ."</h4>";
echo "<p>" . $service_data['description'] . "</p>";
echo "</div>";//col-md-10
echo "</div>";//row
echo "<hr>";
;
};*/
?>
<br>
</div><!--change-->
</div><!--ineer-->
</div><!--col-sm-8-->
</div><!--row-->
</div><!--admin-content-->
<?php
ldap_close($ldapconn);
require_once('footer.php');?>