if ($action == 'delete_id_from_mailq' && $page == 'manager_mailq' && !empty($id_mailq)) { $path_postsuper = exec('locate postsuper | grep bin'); if (trim($path_postsuper) != '' && substr($path_postsuper, 0, 1) == '/') { $result = exec('sudo ' . $path_postsuper . ' -d ' . $id_mailq); } else { $alerte_purge_mailq = "<h4 class='alert_error'>Vous devez passer en mode root et appeler une autre commande pour purger la file des mails en cours.</h4>"; } } $op_true = array('SaveConfig', 'createConfig', 'saveGlobalconfig', 'subscriber_add', 'subscriber_del', 'subscriber_del_temp', 'subscriber_import', 'preview', 'send_preview'); if (in_array($op, $op_true)) { switch ($op) { case 'SaveConfig': $save = saveModele($cnx, $_POST['list_id'], $row_config_globale['table_listsconfig'], $_POST['newsletter_name'], $_POST['from'], $_POST['from_name'], $_POST['subject'], $_POST['header'], $_POST['footer'], $_POST['subscription_subject'], $_POST['subscription_body'], $_POST['welcome_subject'], $_POST['welcome_body'], $_POST['quit_subject'], $_POST['quit_body'], $_POST['preview_addr']); break; case 'createConfig': $new_id = createNewsletter($cnx, $row_config_globale['table_listsconfig'], $_POST['newsletter_name'], $_POST['from'], $_POST['from_name'], $_POST['subject'], $_POST['header'], $_POST['footer'], $_POST['subscription_subject'], $_POST['subscription_body'], $_POST['welcome_subject'], $_POST['welcome_body'], $_POST['quit_subject'], $_POST['quit_body'], $_POST['preview_addr']); if ($new_id > 0) { $list_id = $new_id; $l = 'l'; } break; case 'saveGlobalconfig': $smtp_host = isset($_POST['smtp_host']) ? $_POST['smtp_host'] : ''; $smtp_auth = isset($_POST['smtp_auth']) ? $_POST['smtp_auth'] : 0; $smtp_login = isset($_POST['smtp_login']) ? $_POST['smtp_login'] : ''; $smtp_pass = isset($_POST['smtp_pass']) ? $_POST['smtp_pass'] : ''; $mod_sub = isset($_POST['mod_sub']) ? $_POST['mod_sub'] : 0; $timezone = isset($_POST['timezone']) ? $_POST['timezone'] : ''; if (saveConfig($cnx, $_POST['table_config'], $_POST['admin_pass'], 50, $_POST['base_url'], $_POST['path'], $_POST['language'], $_POST['table_email'], $_POST['table_temp'], $_POST['table_listsconfig'], $_POST['table_archives'], $_POST['sending_method'], $smtp_host, $smtp_auth, $smtp_login, $smtp_pass, $_POST['sending_limit'], $_POST['validation_period'], $_POST['sub_validation'], $_POST['unsub_validation'], $_POST['admin_email'], $_POST['admin_name'], $_POST['mod_sub'], $_POST['table_sub'], $_POST['charset'], $_POST['table_track'], $_POST['table_send'], $_POST['table_sauvegarde'], $_POST['table_upload'])) { $configSaved = true; $row_config_globale = $cnx->SqlRow("SELECT * FROM {$table_global_config}");
<?php require_once dirname(dirname(dirname(__FILE__))) . '/core/system/ajax.php'; require_once dirname(dirname(dirname(__FILE__))) . "/common/php/class/class.user_newsletter.php"; if (isset($_POST['action']) && !empty($_POST['action'])) { $action = $_POST['action']; switch ($action) { case 'createNewsletter': // Acquisition de toutes les variables isset($_POST['email']) && !empty($_POST['email']) ? $email = $_POST['email'] : ($email = null); echo createNewsletter($email); break; } } function createNewsletter($email) { global $bdd; global $_TABLES; global $config; // Ajout ou suppression de l'email de la personne dans la liste de la newsletter $objUserNewsletter = new UserNewsletter($bdd, $_TABLES, $config); $objUserNewsletter->createUserNewsletter($email); // Retour 0 return 0; }