示例#1
0
                            if (!empty($_POST['mailbox_name'])) {
                                if (in_array($_POST['mailbox_name'], UberspaceMM::getUsernames(true))) {
                                    if (UberspaceMM::changeForwards($_POST['mailbox_name'], implode(' ', explode(',', trim($_POST['destinations']))))) {
                                        echo '<div class="alert alert-success"><b>Yay!</b> Changed forwarding destinations for user <b>' . $_POST['mailbox_name'] . '</b>.</div>';
                                    } else {
                                        echo '<div class="alert alert-danger"><b>Fuack!</b> It was impossible for me to change the destinations for the user <b>' . $_POST['mailbox_name'] . '</b>.</div>';
                                    }
                                } else {
                                    echo '<div class="alert alert-danger"><b>Fawk!</b> The user <b>' . $_POST['mailbox_name'] . '</b> does not exist.</div>';
                                }
                            } else {
                                echo '<div class="alert alert-warning"><b>Ey!</b> Please fill out every field.</div>';
                            }
                        } else {
                            if ($path_info[1] == 'SetupVirtualMailboxes') {
                                if (UberspaceMM::setupVirtualMailboxes()) {
                                    echo '<div class="alert alert-success"><b>Yay!</b> Successfully set up virtual mailboxes.</div>';
                                } else {
                                    echo '<div class="alert alert-danger"><b>Fuack!</b> I encountered an error while trying to set virtual mailboxes up.</div>';
                                }
                            } else {
                                echo '<div class="alert alert-warning"><b>Oh noes!</b> This page does not exist.</div>';
                            }
                        }
                    }
                }
            }
        }
    }
}
?>