-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathservices.php
71 lines (61 loc) · 2.29 KB
/
services.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
<?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"];
//Check if a custom mail has been set
if ($ldapbind) {
$serv_enabled= $Ldap->search($ldapconn, LDAP_SERVICES ,'(&(objectClass=organizationalUnit)(status=enabled))');
}
/*echo '<pre>';
var_dump($serv_enabled);
echo '</pre>';
*/
?>
<div id="admin-content" class="content">
<div class="col-sm-12">
<div class="inner" id="maincol">
<?php
echo "<h2>" . sprintf(_("Servicios activados")) . "</h2>";
//$num_serv=$serv_enabled["count"];
for ($c=0; $c<$serv_enabled["count"]; $c++) {
$service=$serv_enabled[$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 "<hr>";
echo "</div>";//col-md-10
echo "</div>";//row
};?>
<br>
</div><!--change-->
</div><!--ineer-->
</div><!--col-sm-8-->
</div><!--row-->
</div><!--admin-content-->
<?php
ldap_close($ldapconn);
require_once('footer.php');?>