/** * Main update script */ function gu_update() { return gu_config::save(); }
gu_config::set('smtp_password', get_post_var('smtp_password')); gu_config::set('use_sendmail', is_post_var('use_sendmail')); gu_config::set('use_phpmail', is_post_var('use_phpmail')); gu_config::set('batch_max_size', (int) get_post_var('batch_max_size')); gu_config::set('batch_time_limit', (int) get_post_var('batch_time_limit')); } elseif ($section == 'messages') { gu_config::set('msg_prefix_subject', is_post_var('msg_prefix_subject')); gu_config::set('msg_coll_name_on_multilist', is_post_var('msg_coll_name_on_multilist')); gu_config::set('msg_append_signature', is_post_var('msg_append_signature')); gu_config::set('msg_admin_copy', is_post_var('msg_admin_copy')); gu_config::set('list_send_welcome', is_post_var('list_send_welcome')); gu_config::set('list_send_goodbye', is_post_var('list_send_goodbye')); gu_config::set('list_subscribe_notify', is_post_var('list_subscribe_notify')); gu_config::set('list_unsubscribe_notify', is_post_var('list_unsubscribe_notify')); } if (gu_config::save()) { gu_success(t('Settings successfully saved')); } } elseif (is_post_var('test_settings')) { // Don't bother if there is no admin email if (gu_config::get('admin_email') != '') { gu_sender_test(); } else { gu_error(t('Administrator email must be set before mail can be sent')); } } function gu_sender_test() { // Get current settings, which may not have been saved $use_smtp = is_post_var('use_smtp'); $smtp_server = get_post_var('smtp_server');