-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontrol_edit_attribute.php
120 lines (107 loc) · 3.32 KB
/
control_edit_attribute.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
// edit an attribute of a control option
// $Id: control_edit_attribute.php,v 2.37 2007-03-14 12:10:51 turbo Exp $
//
// {{{ Setup session etc
require("./include/pql_session.inc");
require($_SESSION["path"]."/include/pql_config.inc");
require($_SESSION["path"]."/include/pql_control.inc");
require($_SESSION["path"]."/include/pql_control_plugins.inc");
$_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"]);
$url["domain"] = pql_format_urls($_REQUEST["domain"]);
include($_SESSION["path"]."/header.html");
// }}}
// {{{ Initial check
if($_REQUEST["attrib"] == "") {
die("no attribute requested !!");
}
// }}}
// {{{ Get and load the plugin file
$plugin = pql_plugin_get($_REQUEST["attrib"]);
if($plugin) {
$file = $_SESSION["path"]."/include/".pql_plugin_get_filename($plugin);
if(!file_exists($file)) {
echo pql_format_error_span("Configuration error: ");
echo pql_complete_constant($LANG->_('Plugin file for %attrib% does not exists'), array('attrib' => $_REQUEST["attrib"]));
die();
} else
include($file);
} else {
echo pql_format_error_span("Configuration error: ");
echo pql_complete_constant($LANG->_('No plugin defined for %attrib%'), array('attrib' => $_REQUEST["attrib"]));
die();
}
// }}}
// {{{ Forward back to users detail page
function attribute_forward($msg) {
$msg = urlencode($msg);
$cat = pql_plugin_cat($_REQUEST["attrib"]);
if($_REQUEST["mxhost"])
$url = "control_detail.php?mxhost=".$_REQUEST["mxhost"]."&view=".$_REQUEST["view"]."&msg=$msg";
else
$url = "domain_detail.php?rootdn=".$_REQUEST["rootdn"]."&domain=".$_REQUEST["domain"]."&view=".$_REQUEST["view"]."&msg=$msg";
pql_header($url);
}
// }}}
?>
<span class="title1"><?php echo $LANG->_("Change control values")?></span>
<br><br>
<?php
// {{{ Select what to do
if(@$_REQUEST["submit"]) {
if(call_user_func($plugin . "_check", $_REQUEST["type"])) {
call_user_func($plugin . "_save", $_REQUEST["type"], $_REQUEST["mxhost"]);
} else {
call_user_func($plugin . "_print_form", $_REQUEST["mxhost"]);
}
} else {
call_user_func($plugin . "_init", $_REQUEST["mxhost"]);
call_user_func($plugin . "_print_form", $_REQUEST["mxhost"]);
}
// }}}
// {{{ Show the help text frame
if(function_exists($plugin . "_help")) {
?>
<!-- Plugin/Attribute help -->
<table cellspacing="0" cellpadding="3" border="0">
<tr>
<td valign="top">
<table cellspacing="0" cellpadding="3" border="0">
<th>
<tr>
<td valign="middle" class="helptitle"><img src="images/help.png" width="16" height="16" border="0"> help on this attribute</td>
</tr>
<tr>
<td height="0" class="helptext" valign="top">
<?php call_user_func($plugin . "_help"); ?>
</td>
</tr>
<?php if(function_exists($plugin . "_help_cr")) { ?>
<tr>
<td height="0" class="helptextcr" valign="top">
<?php call_user_func($plugin . "_help_cr"); ?>
</td>
</tr>
<?php } ?>
</th>
</table>
</td>
</tr>
</table>
<?php
}
// }}}
?>
</body>
</html>
<?php
pql_flush();
/*
* Local variables:
* mode: php
* mode: font-lock
* tab-width: 4
* End:
*/
?>