Example #1
0
if (!defined('SF_SECURE_INCLUDE')) {
    die('No Permission on ' . __FILE__);
}
// check user rights to access the list
if (FALSE == earchive_rights::ask_access_to_list()) {
    @header('Location: ' . SF_BASE_LOCATION . '/admin/index.php');
    exit;
}
// init
$B->form_error = FALSE;
// delete list
if ($_POST['dellist'] == 1) {
    // check if the user of this request try to delete a list
    // with rights other than administrator 5.
    //
    if (TRUE == earchive_rights::ask_access_to_delete_list()) {
        $B->earchive->delete_list((int) $_REQUEST['lid']);
        // delete word index of this list
        include_once SF_BASE_DIR . '/admin/include/class.sfWordIndexer.php';
        word_indexer::delete_words('earchive_words_crc32', 'lid', (int) $_REQUEST['lid']);
        @header('Location: index.php?m=EARCHIVE');
        exit;
    } else {
        $B->form_error = 'You cant remove this list';
    }
}
// Modify list data
if (isset($_POST['editlist'])) {
    // check if some fields are empty
    if (empty($_POST['name']) || empty($_POST['emailserver']) || empty($_POST['email'])) {
        $B->form_error = 'You have fill out all fields!';