forked from howest-wsde/owaes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroup.useradd.php
31 lines (28 loc) · 974 Bytes
/
group.useradd.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
<?php
include "inc.default.php"; // should be included in EVERY file
$oSecurity = security(TRUE);
// if (!$oSecurity->admin()) $oSecurity->doLogout();
$iGroep = intval($_GET["g"]);
$iUser = intval($_GET["u"]);
$oGroep = group($iGroep);
$oMijnRechten = $oGroep->userrights(me());
switch($_GET["action"]) {
case "add":
if ($oMijnRechten->useradd()) {
$oGroep->addUser($iUser);
// echo ("<span class=\"icon icon-addtogroup\"></span><span class=\"title\">Toegevoegd aan " . $oGroep->naam() . "</span>");
} else stop("group");
break;
case "del":
if ($oMijnRechten->userdel()) {
$oGroep->removeUser($iUser);
//echo ("<span class=\"icon icon-addtogroup\"></span><span class=\"title\">Verwijderd uit " . $oGroep->naam() . "</span>");
} else stop("group");
break;
}
if (isset($_GET["ajax"])) {
echo user($iUser)->HTML("userfromlist.html");
} else {
header('Location: ' . $_SERVER['HTTP_REFERER']);
}
?>