Пример #1
0
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!';
    } else {
        // add new user
        $B->tmp_data = array('name' => $B->db->quoteSmart(commonUtil::stripSlashes($_POST['name'])), 'emailserver' => $B->db->quoteSmart(commonUtil::stripSlashes($_POST['emailserver'])), 'email' => $B->db->quoteSmart(commonUtil::stripSlashes($_POST['email'])), 'description' => $B->db->quoteSmart(commonUtil::stripSlashes($_POST['description'])), 'status' => (int) $_POST['status']);
        // update list data
Пример #2
0
 // Load the available public templates sets from the main folder
 $B->templ = array();
 $directory =& dir(SF_BASE_DIR);
 while (false != ($dirname = $directory->read())) {
     if (FALSE == is_dir(SF_BASE_DIR . '/' . $dirname)) {
         if (preg_match("/(^[^_]+).*\\.tpl\\.php\$/", $dirname, $tmp)) {
             if (!in_array($tmp[1], $B->templ)) {
                 $B->templ[] = $tmp[1];
             }
         }
     }
 }
 $directory->close();
 include_once SF_BASE_DIR . '/admin/include/class.sfWordIndexer.php';
 // get actif bad words languages
 $B->tpl_selected_lang = word_indexer::get_bad_words_lang();
 // Get available language bad word list
 //
 $directory =& dir(SF_BASE_DIR . '/admin/modules/option/bad_word');
 $B->tpl_bad_word_lang = array();
 while (false != ($filename = $directory->read())) {
     if ($filename == "." || $filename == "..") {
         continue;
     }
     // Test filename
     //
     if (TRUE == @is_file(SF_BASE_DIR . '/admin/modules/option/bad_word/' . $filename)) {
         // Extract language from file name
         if (preg_match("/^stop\\.([^\\.]+)/", $filename, $tmp)) {
             // Check if language is installed
             if (FALSE == in_array($tmp[1], $B->tpl_selected_lang)) {
 /**
  * Add language bad words in db table
  *
  * @access privat
  */
 function _update_bad_words_list()
 {
     // insert bad word languages list
     if (isset($_POST['update_main_options_badwordadd']) && !empty($_POST['bad_word_list'])) {
         // Insert bad word list in db table
         $bad_word_file = SF_BASE_DIR . 'modules/option/bad_word/stop.' . $_POST['bad_word_list'] . '.sql';
         if (TRUE == @is_file($bad_word_file)) {
             $bad_word = @file($bad_word_file);
             $alldata = array();
             foreach ($bad_word as $word) {
                 if (!strstr($word, "#")) {
                     $alldata[] = array($word, $_POST['bad_word_list']);
                 }
             }
             $prepared_query = $this->B->db->prepare('INSERT INTO ' . $this->B->sys['db']['table_prefix'] . 'bad_words VALUES(?,?)', array('text', 'text'));
             $result = $this->B->db->executeMultiple($prepared_query, null, $alldata);
             if (MDB2::isError($result)) {
                 trigger_error($result->getMessage() . "\n\nINFO: " . $result->userinfo . "\n\nFILE: " . __FILE__ . "\nLINE: " . __LINE__, E_USER_ERROR);
             }
         } else {
             trigger_error("No " . $bad_word_file . " file for this module!\nFILE: " . __FILE__ . "\nLINE: " . __LINE__, E_USER_ERROR);
         }
     } elseif (isset($_POST['update_main_options_badworddel']) && isset($_POST['selected_lang']) && count($_POST['selected_lang']) > 0) {
         foreach ($_POST['selected_lang'] as $lang) {
             word_indexer::delete_bad_words_lang($lang);
         }
     }
 }