예제 #1
0
$funcToCall = "showTableGroups";
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    if (isset($_GET['users'])) {
        if (isset($_GET['dzest']) && isset($_GET['uid'])) {
            $MailingList->deleteUser($_GET['uid']);
        }
        $MailingList->getUsers();
        $funcToCall = "showTableUsers";
    } elseif (isset($_GET['groups'])) {
        if (isset($_GET['dzest']) && isset($_GET['gid'])) {
            $MailingList->deleteGroup($_GET['gid']);
        }
        $MailingList->getGroups();
        $funcToCall = "showTableGroups";
    } elseif (isset($_GET['uid'])) {
        $MailingList->getUser($_GET['uid']);
        $funcToCall = "showFormUser";
    } elseif (isset($_GET['gid'])) {
        $MailingList->getUsersAndGroup($_GET['gid']);
        $funcToCall = "showFormGroup";
    } else {
        $MailingList->getGroups();
        $funcToCall = "showTableGroups";
    }
} elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (isset($_POST['action'])) {
        if ($_POST['action'] == "user" && !empty($_POST['mail'])) {
            if ($_POST['id'] > 0) {
                $res = $MailingList->editUser($_POST['id'], $_POST['mail'], $_POST['name']);
            } else {
                $res = $MailingList->addUser($_POST['mail'], $_POST['name']);