Ejemplo n.º 1
0
/**
 * Outputs the various admin warning messages
 *
 * @since 2.8
 * 
 * @param string $did_update Contains the update message
 * @param array  $wpmem_settings Array containing the plugin settings
 */
function wpmem_a_do_warnings($did_update, $wpmem_settings)
{
    //$wpmem_settings = get_option( 'wpmembers_settings' );
    $wpmem_dialogs = get_option('wpmembers_dialogs');
    if ($did_update != false) {
        /* if( $chkreq == "err" ) { ?>
        			<div class="error"><p><strong><?php _e('Settings were saved, but you have required fields that are not set to display!', 'wp-members'); ?></strong><br /><br />
        				<?php _e('Note: This will not cause an error for the end user, as only displayed fields are validated.  However, you should still check that your displayed and required fields match up.  Mismatched fields are highlighted below.', 'wp-members'); ?></p></div>
        		<?php } elseif( $add_field_err_msg ) { ?>
                	<div class="error"><p><strong><?php echo $add_field_err_msg; ?></p></div>
                <?php } else { ?> */
        ?>
			<div id="message" class="updated fade"><p><strong><?php 
        echo $did_update;
        ?>
</strong></p></div>
		<?php 
        //}
    }
    /**
     * Warning messages
     */
    // settings allow anyone to register
    if (get_option('users_can_register') != 0 && $wpmem_settings[11] == 0) {
        wpmem_a_warning_msg(1);
    }
    // settings allow anyone to comment
    if (get_option('comment_registration') != 1 && $wpmem_settings[11] == 0) {
        wpmem_a_warning_msg(2);
    }
    // rss set to full text feeds
    if (get_option('rss_use_excerpt') != 1 && $wpmem_settings[11] == 0) {
        wpmem_a_warning_msg(3);
    }
    // holding registrations but haven't changed default successful registration message
    if ($wpmem_settings[11] == 0 && $wpmem_settings[5] == 1 && $wpmem_dialogs[3] == 'Congratulations! Your registration was successful.<br /><br />You may now login using the password that was emailed to you.') {
        wpmem_a_warning_msg(4);
    }
    // turned off registration but also have set to moderate and/or email new registrations
    if ($wpmem_settings[11] == 0 && $wpmem_settings[7] == 1) {
        if ($wpmem_settings[5] == 1 || $wpmem_settings[4] == 1) {
            wpmem_a_warning_msg(5);
        }
    }
    // haven't entered recaptcha api keys
    if ($wpmem_settings[11] == 0 && $wpmem_settings[6] == 1) {
        $wpmem_captcha = get_option('wpmembers_captcha');
        if (!$wpmem_captcha['recaptcha']['public'] || !$wpmem_captcha['recaptcha']['private']) {
            wpmem_a_warning_msg(6);
        }
    }
}
Ejemplo n.º 2
0
/**
 * Outputs the various admin warning messages.
 *
 * @since 2.8
 * 
 * @param string $did_update Contains the update message.
 * @param array  $wpmem_settings Array containing the plugin settings.
 */
function wpmem_a_do_warnings($did_update)
{
    global $wpmem;
    $wpmem_dialogs = get_option('wpmembers_dialogs');
    if ($did_update != false) {
        ?>
		<div id="message" class="updated fade"><p><strong><?php 
        echo $did_update;
        ?>
</strong></p></div><?php 
    }
    /*
     * Warning messages
     */
    // Are warnings turned off?
    $warnings_off = $wpmem->warnings == 0 ? true : false;
    // Settings allow anyone to register.
    if (get_option('users_can_register') != 0 && $warnings_off) {
        wpmem_a_warning_msg(1);
    }
    // Settings allow anyone to comment.
    if (get_option('comment_registration') != 1 && $warnings_off) {
        wpmem_a_warning_msg(2);
    }
    // Rss set to full text feeds.
    if (get_option('rss_use_excerpt') != 1 && $warnings_off) {
        wpmem_a_warning_msg(3);
    }
    // Holding registrations but haven't changed default successful registration message.
    if ($warnings_off && $wpmem->mod_reg == 1 && $wpmem_dialogs[3] == 'Congratulations! Your registration was successful.<br /><br />You may now login using the password that was emailed to you.') {
        wpmem_a_warning_msg(4);
    }
    // Haven't entered recaptcha api keys.
    if ($warnings_off && $wpmem->captcha == 1) {
        $wpmem_captcha = get_option('wpmembers_captcha');
        if (isset($wpmem_captcha['recaptcha'])) {
            if (!$wpmem_captcha['recaptcha']['public'] || !$wpmem_captcha['recaptcha']['private']) {
                wpmem_a_warning_msg(6);
            }
        }
    }
}
Ejemplo n.º 3
0
/**
 * Outputs the various admin warning messages.
 *
 * @since 2.8.0
 * 
 * @param string $did_update     Contains the update message.
 * @param array  $wpmem_settings Array containing the plugin settings.
 */
function wpmem_a_do_warnings($did_update)
{
    global $wpmem;
    $wpmem_dialogs = get_option('wpmembers_dialogs');
    if ($did_update != false) {
        ?>
		<div id="message" class="updated fade"><p><strong><?php 
        echo $did_update;
        ?>
</strong></p></div><?php 
    }
    /*
     * Warning messages
     */
    // Are warnings turned off?
    $warnings_on = $wpmem->warnings == 0 ? true : false;
    // Is there an active warning?
    $warning_active = false;
    // Settings allow anyone to register.
    if (get_option('users_can_register') != 0 && $warnings_on) {
        wpmem_a_warning_msg('users_can_register');
        $warning_active = true;
    }
    // Settings allow anyone to comment.
    if (get_option('comment_registration') != 1 && $warnings_on) {
        wpmem_a_warning_msg('comment_registration');
        $warning_active = true;
    }
    // Rss set to full text feeds.
    if (get_option('rss_use_excerpt') != 1 && $warnings_on) {
        wpmem_a_warning_msg('rss_use_excerpt');
        $warning_active = true;
    }
    // Holding registrations but haven't changed default successful registration message.
    if ($warnings_on && $wpmem->mod_reg == 1 && $wpmem_dialogs['success'] == $wpmem->get_text('success')) {
        wpmem_a_warning_msg('success');
        $warning_active = true;
    }
    // Haven't entered recaptcha api keys.
    if ($warnings_on && $wpmem->captcha > 0) {
        $wpmem_captcha = get_option('wpmembers_captcha');
        if (1 == $wpmem->captcha || 3 == $wpmem->captcha) {
            if (!$wpmem_captcha['recaptcha']['public'] || !$wpmem_captcha['recaptcha']['private']) {
                wpmem_a_warning_msg('wpmembers_captcha');
                $warning_active = true;
            }
        }
    }
    // If there is an active warning, display message about warnings.
    if ($warning_active) {
        wpmem_a_warning_msg('warning_active');
    }
}