-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsudo_modify.php
More file actions
53 lines (49 loc) · 1.39 KB
/
sudo_modify.php
File metadata and controls
53 lines (49 loc) · 1.39 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
<?php
// Modify Sudo roles
// $Id: sudo_modify.php,v 2.10 2007-03-14 12:10:52 turbo Exp $
// {{{ Setup session etc
// Called directly - as in modifying something with a specific sudo role
require("./include/pql_session.inc");
require($_SESSION["path"]."/include/pql_config.inc");
require($_SESSION["path"]."/include/attrib.sudoers.inc");
include($_SESSION["path"]."/header.html");
// }}}
// {{{ Forward back to users detail page
function attribute_forward($msg) {
$url = "domain_detail.php?rootdn=".urlencode($_REQUEST["rootdn"])."&domain=".urlencode($_REQUEST["domain"]);
$url .= "&view=".$_REQUEST["view"]."&msg=$msg";
pql_header($url);
}
// }}}
// Get the role name for the header
$role_name = $_pql->get_attribute($_REQUEST["sudorole"], pql_get_define("PQL_ATTR_CN"));
?>
<span class="title1"><?php echo pql_complete_constant($LANG->_('Modify sudo role %role%'), array('role' => $role_name))?></span>
<br><br>
<?php
// {{{ Select what to do
if(!@$_REQUEST["action"]) {
attribute_print_view($_REQUEST["sudorole"]);
} else {
if($_REQUEST["action"] == 'del') {
// Remove 'something' ($_REQUEST["type"] and $_REQUEST[$type]) from a sudo role
attribute_save("del");
} else {
if(!attribute_check())
attribute_print_form();
else
attribute_save("mod");
}
}
// }}}
?>
</body>
</html>
<?php
/* Local variables:
* mode: php
* mode: font-lock
* tab-width: 4
* End:
*/
?>