Example #1
0
$langs->load("users");
$langs->load("companies");
$langs->load("ldap");
$form = new Form($db);
/**
 * Actions
 */
if ($_GET["subaction"] == 'addrights' && $canedituser) {
    $edituser = new User($db);
    $edituser->fetch($id);
    $edituser->addrights($_GET["rights"]);
}
if ($_GET["subaction"] == 'delrights' && $canedituser) {
    $edituser = new User($db);
    $edituser->fetch($id);
    $edituser->delrights($_GET["rights"]);
}
if ($action == 'confirm_disable' && $confirm == "yes" && $candisableuser) {
    if ($id != $user->id) {
        $edituser = new User($db);
        $edituser->fetch($id);
        $edituser->setstatus(0);
        Header("Location: " . DOL_URL_ROOT . '/user/fiche.php?id=' . $id);
        exit;
    }
}
if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser) {
    if ($id != $user->id) {
        $message = '';
        $edituser = new User($db);
        $edituser->fetch($id);
Example #2
0
	$edituser->fetch($_GET["id"]);
    $edituser->addrights($_GET["rights"],$module);

	// Si on a touche a ses propres droits, on recharge
	if ($_GET["id"] == $user->id)
	{
		$user->clearrights();
		$user->getrights();
	}
}

if ($_GET["action"] == 'delrights' && $caneditperms)
{
    $edituser = new User($db);
	$edituser->fetch($_GET["id"]);
    $edituser->delrights($_GET["rights"],$module);

	// Si on a touche a ses propres droits, on recharge
	if ($_GET["id"] == $user->id)
	{
		$user->clearrights();
		$user->getrights();
	}
}



/* ************************************************************************** */
/*                                                                            */
/* Visu et edition                                                            */
/*                                                                            */
Example #3
0
        $edituser = new User($db);
        $edituser->fetch($id);
        //$edituser->addrights($rights, $module, '', $entity); // TODO unused for the moment
        $edituser->addrights($rights, $module);
        // Si on a touche a ses propres droits, on recharge
        if ($id == $user->id) {
            $user->clearrights();
            $user->getrights();
            $menumanager->loadMenu();
        }
    }
    if ($action == 'delrights' && $caneditperms) {
        $edituser = new User($db);
        $edituser->fetch($id);
        //$edituser->delrights($rights, $module, '', $entity); // TODO unused for the moment
        $edituser->delrights($rights, $module);
        // Si on a touche a ses propres droits, on recharge
        if ($id == $user->id) {
            $user->clearrights();
            $user->getrights();
            $menumanager->loadMenu();
        }
    }
}
/**
 *	View
 */
llxHeader('', $langs->trans("Permissions"));
$form = new Form($db);
$head = user_prepare_head($object);
$title = $langs->trans("User");