Esempio n. 1
0
 */
$result = $gacl_api->get_group_id('passengers', 'Passengers', 'ARO');
if ($outputDebug == TRUE) {
    if ($result !== FALSE) {
        echo "Got 'Passengers' ARO GroupID!<br>\n";
    } else {
        echo "Error getting 'Passengers' ARO GroupID!.<br>\n";
    }
}
$passengersGroupId = $result;
unset($result);
$gacl_api->_DEBUG = true;
/*
 * Now lets delete Obi-Wans and Lukes ARO GROUP ARO connections.
 */
$result = $gacl_api->del_group_object($passengersGroupId, 'passengers', 'obi-wan', 'ARO');
if ($outputDebug == TRUE) {
    if ($result !== FALSE) {
        echo "Deleted 'Passengers > Obi-Wan' ARO Group > ARO Connection!<br>\n";
    } else {
        echo "Error deleting 'Passengers > Obi-Wan' ARO Group > ARO Connection!<br>\n";
    }
}
unset($result);
$result = $gacl_api->del_group_object($passengersGroupId, 'passengers', 'luke', 'ARO');
if ($outputDebug == TRUE) {
    if ($result !== FALSE) {
        echo "Deleted 'Passengers > Luke' ARO Group > ARO Connection!<br>\n";
    } else {
        echo "Error deleting 'Passengers > Luke' ARO Group > ARO Connection!<br>\n";
    }
include_once OOO_LIB . '/phpgacl/gacl_api.class.php';
if (isset($_POST['user'])) {
    $arr_newuser = $_POST['user'];
} else {
    $arr_newuser = 0;
}
$id = $_POST['aro_group_id'];
$gacl_api = new gacl_api($gacl_options);
$arr_olduser = $gacl_api->get_group_objects($id, 'aro');
//aro object value
if (count($arr_olduser) && is_array($arr_newuser)) {
    $arr_add = array_diff($arr_newuser, $arr_olduser['users']);
    $arr_del = array_diff($arr_olduser['users'], $arr_newuser);
    foreach ($arr_add as $value) {
        $gacl_api->add_group_object($id, 'users', $value, 'aro');
    }
    foreach ($arr_del as $value) {
        $gacl_api->del_group_object($id, 'users', $value, 'aro');
    }
} elseif (count($arr_olduser) && !is_array($arr_newuser)) {
    $arr_del = $arr_olduser['users'];
    foreach ($arr_del as $value) {
        $gacl_api->del_group_object($id, 'users', $value, 'aro');
    }
} elseif (!count($arr_olduser) && is_array($arr_newuser)) {
    $arr_add = $arr_newuser;
    foreach ($arr_add as $value) {
        $gacl_api->add_group_object($id, 'users', $value, 'aro');
    }
}
header("Location: index.php?op=grouplist");