From 22c86fda7abeb600bdb603a868fd513824eaab49 Mon Sep 17 00:00:00 2001 From: SteveD Date: Wed, 20 Mar 2013 22:31:32 +0000 Subject: [PATCH] Fix saving of prefs in mailout (may be similar problem with save_prefs() elsewhere) LAN update in admin log --- e107_admin/admin_log.php | 10 +++++----- e107_admin/mailout.php | 14 +++++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/e107_admin/admin_log.php b/e107_admin/admin_log.php index 364853e62..7f2d4b326 100644 --- a/e107_admin/admin_log.php +++ b/e107_admin/admin_log.php @@ -539,11 +539,11 @@ if(isset($page_title[$action])) 'comments' => array(14, 7, 7, 7, 14, 3, 10, 12, 5, 17, 1, 1, 1), 'online' => array(18, 15, 7, 14, 32, 6, 4, 4)); $col_titles = array( - 'adminlog' => array(RL_LAN_019, RL_LAN_032, RL_LAN_020, RL_LAN_104, RL_LAN_022, RL_LAN_023, RL_LAN_025, RL_LAN_033), - 'auditlog' => array(RL_LAN_019, RL_LAN_020, RL_LAN_104, RL_LAN_022, RL_LAN_023, RL_LAN_025, RL_LAN_033), - 'rolllog' => array(RL_LAN_019, RL_LAN_032, RL_LAN_020, RL_LAN_104, RL_LAN_022, RL_LAN_023, RL_LAN_024, RL_LAN_025, RL_LAN_033), - 'downlog' => array(RL_LAN_019, RL_LAN_020, RL_LAN_104, RL_LAN_022, RL_LAN_068, RL_LAN_069), - 'detailed' => array(LAN_TIME, RL_LAN_096, RL_LAN_098, RL_LAN_032, RL_LAN_020, RL_LAN_104, RL_LAN_022, RL_LAN_023, RL_LAN_025, RL_LAN_033), + 'adminlog' => array(RL_LAN_019, RL_LAN_032, RL_LAN_020, RL_LAN_104, LAN_USER, RL_LAN_023, RL_LAN_025, RL_LAN_033), + 'auditlog' => array(RL_LAN_019, RL_LAN_020, RL_LAN_104, LAN_USER, RL_LAN_023, RL_LAN_025, RL_LAN_033), + 'rolllog' => array(RL_LAN_019, RL_LAN_032, RL_LAN_020, RL_LAN_104, LAN_USER, RL_LAN_023, RL_LAN_024, RL_LAN_025, RL_LAN_033), + 'downlog' => array(RL_LAN_019, RL_LAN_020, RL_LAN_104, LAN_USER, RL_LAN_068, RL_LAN_069), + 'detailed' => array(LAN_TIME, RL_LAN_096, RL_LAN_098, RL_LAN_032, RL_LAN_020, RL_LAN_104, LAN_USER, RL_LAN_023, RL_LAN_025, RL_LAN_033), 'online' => array(RL_LAN_019, RL_LAN_020, LAN_ID, LAN_USER, RL_LAN_116, RL_LAN_117, RL_LAN_118, RL_LAN_116)); diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php index 6aea1d3e3..d1903c2b6 100644 --- a/e107_admin/mailout.php +++ b/e107_admin/mailout.php @@ -673,7 +673,7 @@ function sendProgress() // Update Preferences. (security handled elsewhere) function saveMailPrefs(&$mes) // $emessage to $mes, working? { - $pref = e107::getPref(); + //$pref = e107::getPref(); $e107 = e107::getInstance(); $bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234); @@ -740,9 +740,15 @@ function saveMailPrefs(&$mes) // $emessage to $mes, working? $temp['mailout_enabled'] = implode(',',varset($_POST['mail_mailer_enabled'], '')); $temp['mail_log_options'] = intval($_POST['mail_log_option']).','.intval($_POST['mail_log_email']); - if ($e107->admin_log->logArrayDiffs($temp, $pref, 'MAIL_03')) + foreach ($temp as &$t) { - save_prefs(); // Only save if changes - generates its own message + if ($t === NULL) $t = ''; + } + $pref = e107::pref('core'); // Core Prefs Array. + if (e107::getAdminLog()->logArrayDiffs($temp, $pref, 'MAIL_03')) + { + e107::getConfig()->updatePref($temp); + e107::getConfig()->save(false); // Only save if changes - generates its own message } else { @@ -906,8 +912,6 @@ function show_prefs($mailAdmin) ".LAN_MAILOUT_157." \n"; - - $mes->addDebug("@Steve : email address sources pref are not being saved"); if (isset($pref['e_mailout_list'])) // Allow selection of email address sources {