-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig_edit_attribute.php
More file actions
91 lines (78 loc) · 2.43 KB
/
config_edit_attribute.php
File metadata and controls
91 lines (78 loc) · 2.43 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
// Edit and set configuration values in the LDAP database
// $Id: config_edit_attribute.php,v 1.30 2007-09-29 21:15:09 turbo Exp $
//
// {{{ Setup session etc
require("./include/pql_session.inc");
require($_SESSION["path"]."/include/pql_config.inc");
$_pql = new pql($_SESSION["USER_HOST"], $_SESSION["USER_DN"], $_SESSION["USER_PASS"]);
if(($_REQUEST["attrib"] == sprintf("%s", pql_get_define("PQL_ATTR_DEBUG_ME"))) and pql_get_define("PQL_CONF_DEBUG_ME")) {
// We're modifying the runInDebugMode, but we're alredy doing that (running in debug mode),
// so we must first turn debugging of - othervise we'll never be able to turn it of (any LDAP modify
// will only show the LDIF).
pql_set_define("PQL_CONF_DEBUG_ME", 'FALSE');
$debugging = 1;
}
include($_SESSION["path"]."/include/attrib.config.inc");
include($_SESSION["path"]."/header.html");
if(@$_REQUEST["view"] == "template") {
include($_SESSION["path"]."/left-head.html");
}
// }}}
// {{{ Forward back to configuration detail page
function attribute_forward($msg, $rlnb = false) {
global $debugging;
$attrib = $_REQUEST["attrib"];
$msg = urlencode($msg);
if(lc($attrib) == 'controlsadministrator') {
if($_REQUEST[$attrib])
$userdn = urlencode($_REQUEST[$attrib]);
elseif(@$_REQUEST["delval"])
$userdn = urlencode($_REQUEST["delval"]);
$url = "user_detail.php?rootdn=" . $_REQUEST["rootdn"]
. "&domain=" . $_REQUEST["domain"] . "&user=$userdn&view=" . $_REQUEST["view"] . "&msg=$msg";
} else {
if(@$_REQUEST["view"] == "template")
$url = "config_detail.php?branch=" . $_REQUEST["rootdn"] . "&view=template&msg=$msg";
elseif(@$_REQUEST["rootdn"])
$url = "config_detail.php?branch=" . $_REQUEST["rootdn"] . "&view=branch&msg=$msg";
else
$url = "config_detail.php?msg=$msg";
}
if($rlnb and pql_get_define("PQL_CONF_AUTO_RELOAD"))
$url .= "&rlnb=1";
if($debugging) {
pql_set_define("PQL_CONF_DEBUG_ME", 'TRUE');
unset($debugging);
}
if($_REQUEST["view"])
$url .= "&view=".$_REQUEST["view"];
pql_header($url);
}
// }}}
// {{{ Select what to do
$attrib = $_REQUEST["attrib"];
if(!empty($_REQUEST["submit"]) or !empty($_REQUEST["toggle"]) or @($_REQUEST["action"] == 'del'))
{
if(attribute_check()) {
attribute_save();
} else {
attribute_print_form();
}
} else {
attribute_print_form();
}
// }}}
?>
</body>
</html>
<?php
pql_flush();
/*
* Local variables:
* mode: php
* mode: font-lock
* tab-width: 4
* End:
*/
?>