$lang ) {
if (isset($_POST['activamail_subj_'.$lang]) && trim( $_POST['activamail_subj_'.$lang] ) != "" ) $activamail_subj[$lang] = stripslashes(trim($_POST['activamail_subj_'.$lang]));
if (isset($_POST['activamail_mail_'.$lang]) && trim( $_POST['activamail_mail_'.$lang] ) != "" ) $activamail_mail[$lang] = stripslashes(trim($_POST['activamail_mail_'.$lang]));
if (isset($_POST['optin_msg_'.$lang]) ) $optin_msg[$lang] = stripslashes(trim($_POST['optin_msg_'.$lang]));
if (isset($_POST['optout_msg_'.$lang]) ) $optout_msg[$lang] = stripslashes(trim($_POST['optout_msg_'.$lang]));
if (isset($_POST['lists_msg_'.$lang]) ) $lists_msg[$lang] = stripslashes(trim($_POST['lists_msg_'.$lang]));
if (isset($_POST['disclaimer_msg_'.$lang]) ) $disclaimer_msg[$lang] = stripslashes(trim($_POST['disclaimer_msg_'.$lang]));
if (isset($_POST['unsub_footer_'.$lang]) ) $unsub_footer[$lang] = stripslashes(trim($_POST['unsub_footer_'.$lang]));
}
if ( count ($activamail_subj) ) update_option('ALO_em_txtpre_activationmail_subj', $activamail_subj );
if ( count ($activamail_mail) ) update_option('ALO_em_txtpre_activationmail_mail', $activamail_mail );
if ( count ($optin_msg) ) update_option('ALO_em_custom_optin_msg', $optin_msg );
if ( count ($optout_msg) ) update_option('ALO_em_custom_optout_msg', $optout_msg );
if ( count ($lists_msg) ) update_option('ALO_em_custom_lists_msg', $lists_msg );
if ( count ($disclaimer_msg) ) update_option('ALO_em_custom_disclaimer_msg', $disclaimer_msg );
if ( count ($unsub_footer) ) update_option('ALO_em_custom_unsub_footer', $unsub_footer );
// --------
// -------- Options permitted ONLY to ADMIN ('manage_options')
if ( current_user_can('manage_options') ) {
if(isset($_POST['content'])) {
$main_content = stripslashes($_REQUEST['content']);
$main_content = str_replace("\n", "
", $main_content);
update_option('ALO_em_template', $main_content);
}
if(isset($_POST['sender_email'])) update_option('ALO_em_sender_email', trim($_POST['sender_email']));
if(isset($_POST['sender_name'])) update_option('ALO_em_sender_name', stripslashes( trim($_POST['sender_name'])) );
if(isset($_POST['lastposts']) && (int)$_POST['lastposts'] > 0) update_option('ALO_em_lastposts', trim($_POST['lastposts']));
if(isset($_POST['dayrate']) && (int)$_POST['dayrate'] >= 300 && (int)$_POST['dayrate'] <= 10000 ) update_option('ALO_em_dayrate', trim($_POST['dayrate']));
if(isset($_POST['batchrate']) && (int)$_POST['batchrate'] >= 10 && (int)$_POST['batchrate'] <= 300 ) update_option('ALO_em_batchrate', trim($_POST['batchrate']));
if(isset($_POST['subsc_page']) && (int)$_POST['subsc_page'] ) update_option('ALO_em_subsc_page', trim($_POST['subsc_page']));
if ( isset($_POST['show_subscripage']) ) {
update_option('ALO_em_show_subscripage', "yes");
} else {
update_option('ALO_em_show_subscripage', "no") ;
}
if ( isset($_POST['embed_css']) ) {
update_option('ALO_em_embed_css', "yes");
} else {
update_option('ALO_em_embed_css', "no") ;
}
if ( isset($_POST['credit_banners']) ) {
update_option('ALO_em_show_credit_banners', "yes");
} else {
update_option('ALO_em_show_credit_banners', "no") ;
}
if ( isset($_POST['delete_on_uninstall']) && isset($_POST['delete_on_uninstall_2']) ) {
update_option('ALO_em_delete_on_uninstall', "yes");
} else {
update_option('ALO_em_delete_on_uninstall', "no") ;
}
// get roles to update cap
$role_author = get_role( 'author' );
$role_editor = get_role( 'editor' );
if ( isset($_POST['can_manage_newsletters']) ) {
switch ( $_POST['can_manage_newsletters'] ) {
case "editor":
$role_editor->add_cap( 'manage_easymail_newsletters' );
$role_editor->add_cap( 'send_easymail_newsletters' );
break;
case "administrator":
default:
$role_editor->remove_cap( 'manage_easymail_newsletters' );
}
}
if ( isset($_POST['can_send_newsletters']) ) {
switch ( $_POST['can_send_newsletters'] ) {
case "author":
$role_author->add_cap( 'send_easymail_newsletters' );
$role_editor->add_cap( 'send_easymail_newsletters' );
break;
case "editor":
$role_editor->add_cap( 'send_easymail_newsletters' );
$role_author->remove_cap( 'send_easymail_newsletters' );
break;
case "administrator":
default:
$role_author->remove_cap( 'send_easymail_newsletters' );
$role_editor->remove_cap( 'send_easymail_newsletters' );
$role_editor->remove_cap( 'manage_easymail_newsletters' );
}
}
if ( isset($_POST['can_manage_subscribers']) ) {
switch ( $_POST['can_manage_subscribers'] ) {
case "editor":
$role_editor->add_cap( 'manage_easymail_subscribers' );
break;
case "administrator":
default:
$role_editor->remove_cap( 'manage_easymail_subscribers' );
}
}
if ( isset($_POST['can_manage_options']) ) {
switch ( $_POST['can_manage_options'] ) {
case "editor":
$role_editor->add_cap( 'manage_easymail_options' );
break;
case "administrator":
default:
$role_editor->remove_cap( 'manage_easymail_options' );
}
}
//echo "
";print_r($wp_roles);echo ""; } // -------- echo '
'. __("Updated", "alo-easymail") .'
'. __("Error during operation.", "alo-easymail") .'
'. __("Updated", "alo-easymail") .'
'. __("Error during operation.", "alo-easymail") .'
'. __("Inputs are incompled or wrong. Please check and try again.", "alo-easymail") .'
'. __("Updated", "alo-easymail") .'
'. __("Error during operation.", "alo-easymail") .'
'. __("Error during operation.", "alo-easymail") .'
: : : ";
echo " ";
echo " ";
echo "";
echo " ";
?>
|
||||