-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathunit_del.php
More file actions
61 lines (57 loc) · 1.87 KB
/
unit_del.php
File metadata and controls
61 lines (57 loc) · 1.87 KB
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
<?php
// delete a domain and all users within
// $Id: unit_del.php,v 2.23 2007-02-15 12:07:12 turbo Exp $
//
require("./include/pql_session.inc");
require($_SESSION["path"]."/include/pql_config.inc");
require($_SESSION["path"]."/include/pql_control.inc");
include($_SESSION["path"]."/header.html");
?>
<span class="title1"><?php echo pql_complete_constant($LANG->_('Remove the domain %domain%'), array("domain" => $domain))?></span>
<?php
if($ok != 1) {
?>
<br>
<br>
<img src="images/info.png" width="16" height="16" border="0">
<?php echo $LANG->_('Attention: If you deleted a domain, all users within this domain will be deleted too')?>!
<br>
<br>
<?php echo $LANG->_('Are you really sure')?>?
<br>
<a href="domain_del.php?domain=<?php echo $domain?>&unit=<?php echo $unit?>&ok=1"><?php echo $LANG->_('Yes')?></a>, <a href="javascript:history.back()"><?php echo $LANG->_('No')?></a>
<br>
<?php
} else {
$_pql = new pql($_SESSION["USER_HOST"], $_SESSION["USER_DN"], $_SESSION["USER_PASS"]);
$_pql_control = new pql_control($_SESSION["USER_HOST"], $_SESSION["USER_DN"], $_SESSION["USER_PASS"]);
// delete the unit
if(pql_remove_unit($_pql->ldap_linkid, $domain, $unit)) {
// update locals if control patch is enabled
if(pql_control_update_domains($_REQUEST["rootdn"], $_SESSION["USER_SEARCH_DN_CTR"])) {
// message ??
}
// redirect to home page
$msg = $LANG->_('Successfully removed the domain');
$msg = urlencode($msg);
pql_header("home.php?msg=$msg&rlnb=1");
} else {
$msg = $LANG->_('Failed to remove the domain') . ": " . ldap_error($_pql->ldap_linkid);
// redirect to domain detail page
$msg = urlencode($msg);
pql_header("domain_detail.php?domain=$domain&unit=$unit&msg=$msg");
}
} // end of if
?>
</body>
</html>
<?php
pql_flush();
/*
* Local variables:
* mode: php
* mode: font-lock
* tab-width: 4
* End:
*/
?>