Example #1
0
    function wp_login_form($args = array())
    {
        $defaults = array('redirect' => (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'form_id' => uniqid('loginform_'), 'label_username' => __('Username', 'dfd'), 'placeholder_username' => __('Enter your login', 'dfd'), 'label_password' => __('Password', 'dfd'), 'placeholder_password' => __('Enter your password', 'dfd'), 'label_lost_password' => __('Lost password', 'dfd'), 'label_log_in' => __('Log In', 'dfd'), 'id_username' => uniqid('user_login_'), 'id_password' => uniqid('user_pass_'), 'id_submit' => uniqid('wp-submit_'), 'lost_password' => true, 'value_username' => '');
        $args = wp_parse_args($args, apply_filters('login_form_defaults', $defaults));
        $registration_link = '';
        if (get_option('users_can_register')) {
            $registration_link = '
			<a href="' . wp_registration_url() . '"><i class="ios7icon-lock"></i>' . __('Registration', 'dfd') . '</a>
		';
        }
        $form = '
		<form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url(site_url('wp-login.php', 'login_post')) . '" method="post">
			' . apply_filters('login_form_top', '', $args) . '
			<p class="login-username">
				<label for="' . esc_attr($args['id_username']) . '">' . esc_html($args['label_username']) . '</label>
				<input type="text" name="log" id="' . esc_attr($args['id_username']) . '" class="input" value="' . esc_attr($args['value_username']) . '" size="20" placeholder="' . esc_html($args['placeholder_username']) . '" />
			</p>
			<p class="login-password">
				<label for="' . esc_attr($args['id_password']) . '">' . esc_html($args['label_password']) . '</label>
				<input type="password" name="pwd" id="' . esc_attr($args['id_password']) . '" class="input" value="" size="20" placeholder="' . esc_html($args['placeholder_password']) . '" />
			</p>
			<p class="login-submit">
				<button type="submit" name="wp-submit" id="' . esc_attr($args['id_submit']) . '" class="button"><i class="icon-arrow-left-1"></i>' . esc_attr($args['label_log_in']) . '</button>
				<input type="hidden" name="redirect_to" value="' . esc_url($args['redirect']) . '" />
			</p>
			' . ($args['lost_password'] ? '<p class="login-lost-password"><label>' . '<a href="' . wp_lostpassword_url() . '">' . esc_attr($args['label_lost_password']) . '</a></label></p>' : '') . '<p class="login-registration">
				' . $registration_link . '
			</p>' . apply_filters('login_form_bottom', '', $args) . '
		</form>';
        echo $form;
    }
Example #2
0
function ap_scripts_front()
{
    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-form', array('jquery'), false);
    wp_enqueue_script('ap-functions-js', ANSPRESS_URL . 'assets/prod/ap-functions.min.js', array('jquery', 'jquery-form'));
    wp_enqueue_script('ap-anspress_script', ANSPRESS_URL . 'assets/prod/anspress_site.min.js', array('jquery', 'jquery-form'), AP_VERSION);
    wp_enqueue_script('peity-js', ap_get_theme_url('js/jquery.peity.min.js'), 'jquery', AP_VERSION);
    wp_enqueue_script('ap-initial.js', ap_get_theme_url('js/initial.min.js'), 'jquery', AP_VERSION);
    wp_enqueue_script('ap-scrollbar.js', ap_get_theme_url('js/jquery.scrollbar.min.js'), 'jquery', AP_VERSION);
    wp_enqueue_script('ap-js', ap_get_theme_url('prod/ap.min.js'), array('jquery', 'jquery-form'), AP_VERSION);
    wp_enqueue_style('ap-style', ap_get_theme_url('css/main.css'), array(), AP_VERSION);
    $custom_css = '
        #anspress .ap-q-cells{
                margin-left: ' . (ap_opt('avatar_size_qquestion') + 10) . 'px;
        }
        #anspress .ap-a-cells{
                margin-left: ' . (ap_opt('avatar_size_qanswer') + 10) . 'px;
        }#anspress .ap-comment-content{
                margin-left: ' . (ap_opt('avatar_size_qcomment') + 15) . 'px;
        }';
    wp_add_inline_style('ap-style', $custom_css);
    wp_enqueue_style('ap-fonts', ap_get_theme_url('fonts/style.css'), array(), AP_VERSION);
    do_action('ap_enqueue');
    wp_enqueue_style('ap-responsive', ap_get_theme_url('css/responsive.css'), array(), AP_VERSION);
    wp_enqueue_style('ap-overrides', ap_get_theme_url('css/overrides.css'), array(), AP_VERSION);
    echo '<script type="text/javascript">';
    echo 'var ajaxurl = "' . admin_url('admin-ajax.php') . '",';
    echo 'ap_nonce 	= "' . wp_create_nonce('ap_ajax_nonce') . '",';
    echo 'ap_max_tags = "' . ap_opt('max_tags') . '",';
    echo 'disable_hover_card = "' . (ap_opt('disable_hover_card') ? true : false) . '"';
    echo '</script>';
    wp_localize_script('ap-anspress_script', 'aplang', array('password_field_not_macthing' => __('Password not matching', 'ap'), 'password_length_less' => __('Password length must be 6 or higher', 'ap'), 'not_valid_email' => __('Not a valid email', 'ap'), 'username_less' => __('Username length must be 4 or higher', 'ap'), 'username_not_avilable' => __('Username not available', 'ap'), 'email_already_in_use' => sprintf(__('Email already in use. %sDo you want to reset your password?%s', 'ap'), '<a href="' . wp_lostpassword_url() . '">', '</a>'), 'loading' => __('Loading', 'ap'), 'sending' => __('Sending request', 'ap'), 'adding_to_fav' => __('Adding question to your favorites', 'ap'), 'voting_on_post' => __('Sending your vote', 'ap'), 'requesting_for_closing' => __('Requesting for closing this question', 'ap'), 'sending_request' => __('Submitting request', 'ap'), 'loading_comment_form' => __('Loading comment form', 'ap'), 'submitting_your_question' => __('Sending your question', 'ap'), 'submitting_your_answer' => __('Sending your answer', 'ap'), 'submitting_your_comment' => __('Sending your comment', 'ap'), 'deleting_comment' => __('Deleting comment', 'ap'), 'updating_comment' => __('Updating comment', 'ap'), 'loading_form' => __('Loading form', 'ap'), 'saving_labels' => __('Saving labels', 'ap'), 'loading_suggestions' => __('Loading suggestions', 'ap'), 'uploading_cover' => __('Uploading cover', 'ap'), 'saving_profile' => __('Saving profile', 'ap'), 'sending_message' => __('Sending message', 'ap'), 'loading_conversation' => __('Loading conversation', 'ap'), 'loading_new_message_form' => __('Loading new message form', 'ap'), 'loading_more_conversations' => __('Loading more conversations', 'ap'), 'searching_conversations' => __('Searching conversations', 'ap'), 'loading_message_edit_form' => __('Loading message form', 'ap'), 'updating_message' => __('Updating message', 'ap'), 'deleting_message' => __('Deleting message', 'ap'), 'uploading' => __('Uploading', 'ap'), 'error' => ap_icon('error'), 'warning' => ap_icon('warning'), 'success' => ap_icon('success'), 'not_valid_response' => __('Something went wrong in server side, not a valid response.', 'ap')));
    wp_localize_script('ap-site-js', 'apoptions', array('ajaxlogin' => ap_opt('ajax_login')));
}
function v_forcelogin()
{
    if (!is_user_logged_in() && (v_getUrl() != wp_login_url() && v_getUrl() != wp_registration_url() && v_getUrl() != wp_lostpassword_url())) {
        wp_redirect(wp_login_url(), 302);
        exit;
    }
}
    public function enqueue_api_scripts()
    {
        if (!$this->_data->get_option('accept_api_logins')) {
            return false;
        }
        $domain = get_bloginfo('name');
        $domain = $domain ? $domain : __('WordPress', Eab_EventsHub::TEXT_DOMAIN);
        $show_facebook = !$this->_data->get_option('api_login-hide-facebook');
        $show_twitter = !$this->_data->get_option('api_login-hide-twitter');
        $show_google = !$this->_data->get_option('api_login-hide-google');
        $registration_msg = '';
        $registration_services = array();
        if ($show_facebook) {
            $registration_services[] = 'Facebook';
        }
        if ($show_twitter) {
            $registration_services[] = 'Twitter';
        }
        if ($show_google) {
            $registration_services[] = 'Google';
        }
        // Properly enumerate supported service IDs and construct the registration supplement message.
        if (!empty($registration_services)) {
            if (count($registration_services) > 1) {
                $supported_ids = sprintf(_x('%s or %s', 'Supported registration services: the first variable can be single service or comma-separated enumeration', Eab_EventsHub::TEXT_DOMAIN), join(', ', array_slice($registration_services, 0, count($registration_services) - 1)), end($registration_services));
            } else {
                $supported_ids = end($registration_services);
            }
            $registration_msg = sprintf(_x(' - or just click cancel to register using your %s ID', 'Registration supplemental message part', Eab_EventsHub::TEXT_DOMAIN), $supported_ids);
        }
        wp_enqueue_script('eab_api_js', plugins_url('events-and-bookings/js/eab-api.js'), array('jquery'), Eab_EventsHub::CURRENT_VERSION);
        wp_localize_script('eab_api_js', 'l10nEabApi', apply_filters('eab-javascript-api_vars', array('facebook' => __('Login with Facebook', Eab_EventsHub::TEXT_DOMAIN), 'twitter' => __('Login with Twitter', Eab_EventsHub::TEXT_DOMAIN), 'google' => __('Login with Google', Eab_EventsHub::TEXT_DOMAIN), 'wordpress' => sprintf(__('Login with %s', Eab_EventsHub::TEXT_DOMAIN), $domain), 'cancel' => __('Cancel', Eab_EventsHub::TEXT_DOMAIN), 'please_wait' => __('Please, wait...', Eab_EventsHub::TEXT_DOMAIN), 'wp_register' => __('Register', Eab_EventsHub::TEXT_DOMAIN), 'wp_registration_msg' => sprintf(_x('Create a username in order to register for this event %s', 'The variable is registration supplemental part', Eab_EventsHub::TEXT_DOMAIN), $registration_msg), 'wp_login' => __('Log in', Eab_EventsHub::TEXT_DOMAIN), 'wp_login_msg' => sprintf(_x('Login with your existing username in order to register for this event %s', 'The variable is registration supplemental part', Eab_EventsHub::TEXT_DOMAIN), $registration_msg), 'wp_username' => __('Username', Eab_EventsHub::TEXT_DOMAIN), 'wp_password' => __('Password', Eab_EventsHub::TEXT_DOMAIN), 'wp_email' => __('Email', Eab_EventsHub::TEXT_DOMAIN), 'wp_toggle_on' => __('Already a member? Log in here', Eab_EventsHub::TEXT_DOMAIN), 'wp_toggle_off' => __('Click here to register', Eab_EventsHub::TEXT_DOMAIN), 'wp_lost_pw_text' => __('Forgot your password', Eab_EventsHub::TEXT_DOMAIN), 'wp_lost_pw_url' => wp_lostpassword_url(), 'wp_submit' => __('Submit', Eab_EventsHub::TEXT_DOMAIN), 'wp_cancel' => __('Cancel', Eab_EventsHub::TEXT_DOMAIN), 'data' => array('show_facebook' => $show_facebook, 'show_twitter' => $show_twitter, 'show_google' => $show_google, 'show_wordpress' => !$this->_data->get_option('api_login-hide-wordpress'), 'gg_client_id' => $this->_data->get_option('google-client_id')), 'wp_missing_username_password' => __('Username and password are required!', Eab_EventsHub::TEXT_DOMAIN), 'wp_username_pass_invalid' => __('Invalid username or password!', Eab_EventsHub::TEXT_DOMAIN), 'wp_missing_user_email' => __('Username and email are required!', Eab_EventsHub::TEXT_DOMAIN), 'wp_signup_error' => __('Your email/username is already taken or email is invalid!', Eab_EventsHub::TEXT_DOMAIN))));
        if (!$this->_data->get_option('facebook-no_init')) {
            if (defined('EAB_INTERNAL_FLAG__FB_INIT_ADDED')) {
                return false;
            }
            add_action('wp_footer', create_function('', "echo '" . sprintf('<div id="fb-root"></div><script type="text/javascript">
				window.fbAsyncInit = function() {
					FB.init({
					  appId: "%s",
					  status: true,
					  cookie: true,
					  xfbml: true,
					  version    : "v2.5"
					});
				};
				// Load the FB SDK Asynchronously
				(function(d){
					var js, id = "facebook-jssdk"; if (d.getElementById(id)) {return;}
					js = d.createElement("script"); js.id = id; js.async = true;
					js.src = "//connect.facebook.net/en_US/all.js";
					d.getElementsByTagName("head")[0].appendChild(js);
				}(document));
				</script>', $this->_data->get_option('facebook-app_id')) . "';"));
            define('EAB_INTERNAL_FLAG__FB_INIT_ADDED', true, true);
        }
    }
Example #5
0
/**
 * Generate a password recovery link.
 *
 * @since 2.0.2
 */
function accesspress_password_recovery_link_shortcode($atts)
{
    $atts = shortcode_atts(array('text' => __('Lost Password?', 'premise')), $atts);
    if (is_user_logged_in()) {
        return;
    }
    $redirect = add_query_arg('just-logged-in', 'true', get_permalink(accesspress_get_option('login_page')));
    return sprintf('<a href="%s">%s</a>', wp_lostpassword_url(esc_url_raw($redirect)), current_user_can('unfiltered_html') ? $atts['text'] : esc_html($atts['text']));
}
Example #6
0
 /**
  * Widget
  * Display the widget in the sidebar
  * Save output to the cache if empty
  *
  * @param  array  sidebar arguments
  * @param  array  instance
  */
 public function widget($args, $instance)
 {
     extract($args);
     // Print the widget wrapper
     echo $before_widget;
     if (is_user_logged_in()) {
         // Get current user instance
         global $current_user;
         // Print title
         $title = $instance['title_user'] ? $instance['title_user'] : __('Hey %s!', 'jigoshop');
         if ($title) {
             echo $before_title . sprintf($title, ucwords($current_user->display_name)) . $after_title;
         }
         // Create the default set of links
         $links = apply_filters('jigoshop_widget_logout_user_links', array(__('My Account', 'jigoshop') => get_permalink(jigoshop_get_page_id('myaccount')), __('Change Password', 'jigoshop') => get_permalink(jigoshop_get_page_id('change_password')), __('Logout', 'jigoshop') => wp_logout_url(home_url())));
     } else {
         // Print title
         $title = $instance['title_guest'] ? $instance['title_guest'] : __('Login', 'jigoshop');
         if ($title) {
             echo $before_title . $title . $after_title;
         }
         do_action('jigoshop_widget_login_before_form');
         // Get redirect URI
         $redirect_to = apply_filters('jigoshop_widget_login_redirect', get_permalink(jigoshop_get_page_id('myaccount')));
         $fields = array();
         // Support for other plugins which uses GET parameters
         $fields = apply_filters('jigoshop_get_hidden_fields', $fields);
         echo "<form action='" . esc_url(wp_login_url($redirect_to)) . "' method='post' class='jigoshop_login_widget'>";
         foreach ($fields as $key => $value) {
             echo '<input type="hidden" name="' . $key . '" value="' . $value . '" />';
         }
         // Username
         echo "\n\t\t\t<p>\n\t\t\t\t<label for='log'>" . __('Username', 'jigoshop') . "</label>\n\t\t\t\t<input type='text' name='log' id='log' class='input-text username' />\n\t\t\t</p>\n\t\t\t";
         // Password
         echo "\n\t\t\t<p>\n\t\t\t\t<label for='pwd'>" . __('Password', 'jigoshop') . "</label>\n\t\t\t\t<input type='password' name='pwd' id='pwd' class='input-text password' />\n\t\t\t</p>\n\t\t\t";
         echo "\n\t\t\t<p>\n\t\t\t\t<input type='submit' name='submit' value='" . __('Login', 'jigoshop') . "' class='input-submit' />\n\t\t\t\t<a class='forgot' href='" . esc_url(wp_lostpassword_url($redirect_to)) . "'>" . __('Forgot it?', 'jigoshop') . "</a>\n\t\t\t</p>\n\t\t\t";
         if (Jigoshop_Base::get_options()->get('jigoshop_enable_signup_form') == 'yes') {
             echo '<p class="register">';
             wp_register(__('New user?', 'jigoshop') . ' ', '');
             echo '</p>';
         }
         echo "</form>";
         do_action('jigoshop_widget_login_after_form');
         $links = apply_filters('jigoshop_widget_login_user_links', array());
     }
     // Loop & print out the links
     if ($links) {
         echo "\n\t\t\t<nav role='navigation'>\n\t\t\t\t<ul class='pagenav'>";
         foreach ($links as $title => $href) {
             $href = esc_url($href);
             echo "<li><a title='Go to {$title}' href='{$href}'>{$title}</a></li>";
         }
         echo "\n\t\t\t\t</ul>\n\t\t\t</nav>";
     }
     // Print closing widget wrapper
     echo $after_widget;
 }
 /**
  * @param $page
  */
 function get_url($page)
 {
     switch ($page) {
         case 'lostpassword':
             return esc_url(wp_lostpassword_url());
         case 'logout':
             return wp_logout_url(get_permalink());
     }
 }
Example #8
0
/**
 * Return ProfilePress password reset url.
 *
 * @return bool|string
 */
function pp_password_reset_url()
{
    $data = pp_db_data();
    $db_url = $data['set_lost_password_url'];
    if (!empty($db_url)) {
        return get_permalink($db_url);
    } else {
        return wp_lostpassword_url();
    }
}
/**
 * Adds "Remind Password" link to WPJB login forms.
 *
 * This function uses wpjb_shortcode_login filter to create and insert
 * remind password link.
 *
 * @param Daq_View View object to be updated
 * @return Daq_View Updated View object
 */
function wpjb_snipp_password_reminder_link(Daq_View $view)
{
    $buttons = $view->buttons;
    // Add another button (technically this can be any HTML tag)
    $buttons[] = array("tag" => "a", "href" => wp_lostpassword_url(), "html" => "Remind Password");
    // Note you cannot modify $view->buttons array directly,
    // you can only assign value to it.
    $view->buttons = $buttons;
    return $view;
}
/**
 * Forgot Password/Register links
 *
 * Append helpful links to the bottom of the login form.
 *
 * @since Astoundify Crowdfunding 1.0
 *
 * @return $form
 */
function atcf_shortcode_login_form_bottom()
{
    global $edd_options;
    $add = '<p>
		<a href="' . wp_lostpassword_url() . '">' . __('Forgot Password', 'atcf') . '</a> ';
    if (isset($edd_options['register_page'])) {
        $add .= _x('or', 'login form action divider', 'atcf');
        $add .= ' <a href="' . esc_url(get_permalink($edd_options['register_page'])) . '">' . __('Register', 'atcf') . '</a>';
    }
    $add .= '</p>';
    return $add;
}
Example #11
0
/**
 * Include the reset password link template
 * @param  string $label   	Link text. Default: 'Reset Password'
 * @param  string $classes 	Classes to add to the <a> tag. Default: 'reset-password'
 */
function tpl_link_reset_password($label = null, $classes = 'reset-password')
{
    if (is_null($label)) {
        $label = __('Reset Password', 'theme');
    }
    if (Settings::frontend_login_enabled()) {
        $url = home_url('reset-password');
    } else {
        $url = wp_lostpassword_url();
    }
    tpl('link', 'reset-password', array('url' => $url, 'label' => $label, 'classes' => $classes));
}
    /**
     * load widget
     *
     * @name    widget
     * @author  Marcelo Mesquita <*****@*****.**>
     * @since   2012-05-09
     * @updated 2012-05-10
     * @param   array $args - widget structure
     * @param   array $instance - widget data
     * @return  void
     */
    function widget($args, $instance)
    {
        global $wpdb;
        print $args['before_widget'];
        if (!empty($instance['title'])) {
            print $args['before_head'];
            print $args['before_title'] . $instance['title'] . $args['after_title'];
            print $args['after_head'];
        }
        print $args['before_body'];
        if (is_user_logged_in()) {
            global $current_user;
            ?>
				<div class="greetings">
					<p>Olá, <?php 
            print $current_user->display_name;
            ?>
 <a href="<?php 
            print wp_logout_url(site_url());
            ?>
" title="sair">sair</a></p>
				</div>
				<div class="clear"></div>
			<?php 
        } else {
            ?>
				<div class="login">
					<form action="<?php 
            print wp_login_url(site_url());
            ?>
" method="post">
						<input type="text" id="user_login" name="log" value="CPF" class="memory" />
						<input type="password" id="user_pass" name="pwd" value="senha" /><button type="submit" name="wp-submit" id="wp-submit" value="Login">OK</button>
						<a href="<?php 
            print wp_lostpassword_url();
            ?>
" title="Esqueceu a senha?" class="forget">Esqueceu a senha?</a>
					</form>
				</div>
				<div class="register">
					<a href="<?php 
            print site_url('/cadastro/');
            ?>
" title="Ainda não possuo cadastro">Ainda <span>não</span> possuo cadastro.</a>
				</div>
				<div class="clear"></div>
			<?php 
        }
        print $args['after_body'];
        print $args['after_widget'];
    }
Example #13
0
function cws_do_login_form()
{
    // Get login status and username
    $loggedin = is_user_logged_in();
    $user = wp_get_current_user();
    // If already logged in, output pleasent message with logout option.
    // The logout option will redirect back to this custom login/logout page.
    if ($loggedin) {
        ?>

		<h3>You are already logged in!</h3>
		<p>Hello <?php 
        echo $user->user_firstname;
        ?>
! Looks like you are already signed in. No need to log in again.</p>
		<p><a href="/">Go to Homepage</a> or <a href="<?php 
        echo wp_logout_url(get_permalink() . "/login");
        ?>
">Log Out</a></p>

	<?php 
    } else {
        // Set up array to pass to login function
        $args = array('form_id' => 'loginform', 'redirect' => get_bloginfo('url'), 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'label_username' => __('Username'), 'label_password' => __('Password'), 'label_remember' => __('Remember Me'), 'label_log_in' => __('Log In'));
        ?>
<!--
	Create content for custom login page.
	Format the login page and provide instructions to visitor.
	Offer links to website front page and password retreival.
	Call WP funciton to display UI.
	Display lost password link.
-->
		<center><h1>Website Login Page</h1><hr>
		<h5>Enter your username and password to access <br>the administrative area of your website,<br>
		<a href="/">or click here for the website Front Page</a></h5>
		<hr>
		Use the '<strong>Lost your password?</strong>' link below <br>to have a password reset link sent to you by email.
		<br><hr><br>
		</center>
		<?php 
        wp_login_form($args);
        ?>
		<a href="<?php 
        echo wp_lostpassword_url();
        ?>
" title="Lost Password">Lost your password?</a>
		<?php 
    }
}
Example #14
0
 /**
  * (non-PHPdoc)
  *
  * @see \Widgets\WidgetBase::widget()
  */
 public function widget($args, $instance)
 {
     /*
      * Put all special URLs
      */
     $instance['logoutUrl'] = wp_logout_url(home_url());
     $instance['loginUrl'] = wp_login_url(home_url());
     $instance['registrationUrl'] = wp_registration_url();
     $instance['lostPasswordUrl'] = wp_lostpassword_url();
     $instance['postsUrl'] = '/wp-admin/edit.php';
     /*
      * And call the widget func from the parent class WidgetBase.
      */
     parent::widget($args, $instance);
 }
function mo2f_wp_authenticate_username_password($user, $username, $password)
{
    if (is_a($user, 'WP_User')) {
        return $user;
    }
    if (empty($username) || empty($password)) {
        $error = new WP_Error();
        if (empty($username)) {
            $error->add('empty_username', __('<strong>ERROR</strong>: The username field is empty.'));
        }
        if (empty($password)) {
            $error->add('empty_password', __('<strong>ERROR</strong>: The password field is empty.'));
        }
        return $error;
    }
    $userdata = get_user_by('login', $username);
    if (!$userdata) {
        return new WP_Error('invalid_username', sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), wp_lostpassword_url()));
    }
    if (is_multisite()) {
        // Is user marked as spam?
        if (1 == $userdata->spam) {
            return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Your account has been marked as a spammer.'));
        }
        // Is a user's blog marked as spam?
        if (!is_super_admin($userdata->ID) && isset($userdata->primary_blog)) {
            $details = get_blog_details($userdata->primary_blog);
            if (is_object($details) && $details->spam == 1) {
                return new WP_Error('blog_suspended', __('Site Suspended.'));
            }
        }
    }
    $userdata = apply_filters('wp_authenticate_user', $userdata, $password);
    if (is_wp_error($userdata)) {
        return $userdata;
    }
    if (!wp_check_password($password, $userdata->user_pass, $userdata->ID)) {
        return new WP_Error('incorrect_password', sprintf(__('<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?'), $username, wp_lostpassword_url()));
    }
    $user = new WP_User($userdata->ID);
    return $user;
}
Example #16
0
function et_fb_backend_helpers()
{
    global $post, $paged;
    $layout_type = '';
    $post_type = isset($post->post_type) ? $post->post_type : false;
    $post_id = isset($post->ID) ? $post->ID : false;
    $post_status = isset($post->post_status) ? $post->post_status : false;
    if ('et_pb_layout' === $post_type) {
        $layout_type = et_fb_get_layout_type($post_id);
    }
    $google_fonts = array_merge(array('Default' => array()), et_builder_get_google_fonts());
    $current_user = wp_get_current_user();
    $current_url = (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $export_url = add_query_arg(array('et_core_portability' => true, 'context' => 'et_builder', 'name' => 'temp_name', 'nonce' => wp_create_nonce('et_core_portability_nonce')), admin_url());
    $fb_modules_array = apply_filters('et_fb_modules_array', ET_Builder_Element::get_modules_array($post_type, true, true));
    $helpers = array('debug' => true, 'postId' => $post_id, 'postStatus' => $post_status, 'postType' => $post_type, 'layoutType' => $layout_type, 'publishCapability' => is_page() && !current_user_can('publish_pages') || !is_page() && !current_user_can('publish_posts') ? 'no_publish' : 'publish', 'shortcodeObject' => array(), 'ajaxUrl' => admin_url('admin-ajax.php'), 'tinymceSkinUrl' => ET_FB_ASSETS_URI . '/vendors/tinymce-skin', 'tinymceCSSFiles' => esc_url(includes_url('js/tinymce') . '/skins/wordpress/wp-content.css'), 'images_uri' => ET_BUILDER_URI . '/images', 'generalFields' => array(), 'advancedFields' => array(), 'customCssFields' => array(), 'moduleParentShortcodes' => ET_Builder_Element::get_parent_shortcodes($post_type), 'moduleChildShortcodes' => ET_Builder_Element::get_child_shortcodes($post_type), 'moduleChildSlugs' => ET_Builder_Element::get_child_slugs($post_type), 'moduleRawContentShortcodes' => ET_Builder_Element::get_raw_content_shortcodes($post_type), 'modules' => $fb_modules_array, 'modulesCount' => count($fb_modules_array), 'modulesWithChildren' => ET_Builder_Element::get_shortcodes_with_children($post_type), 'structureModules' => ET_Builder_Element::get_structure_modules($post_type), 'et_builder_css_media_queries' => ET_Builder_Element::get_media_quries('for_js'), 'commentsModuleMarkup' => et_fb_get_comments_markup(), 'shortcode_tags' => et_fb_shortcode_tags(), 'getFontIconSymbols' => et_pb_get_font_icon_symbols(), 'failureNotification' => et_builder_get_failure_notification_modal(), 'exitNotification' => et_builder_get_exit_notification_modal(), 'getTaxonomies' => apply_filters('et_fb_taxonomies', array('category' => get_categories(), 'project_category' => get_categories(array('taxonomy' => 'project_category')), 'product_category' => class_exists('WooCommerce') ? get_terms('product_cat') : '')), 'googleAPIKey' => et_pb_is_allowed('theme_options') ? get_option('et_google_api_settings') : '', 'googleFontsList' => array_keys($google_fonts), 'googleFonts' => $google_fonts, 'gutterWidth' => et_get_option('gutter_width', 3), 'fontIcons' => et_pb_get_font_icon_symbols(), 'fontIconsDown' => et_pb_get_font_down_icon_symbols(), 'widgetAreas' => et_builder_get_widget_areas_list(), 'site_url' => get_site_url(), 'etBuilderAccentColor' => et_builder_accent_color(), 'gmt_offset_string' => et_pb_get_gmt_offset_string(), 'et_builder_fonts_data' => et_builder_get_fonts(), 'currentUserDisplayName' => $current_user->display_name, 'locale' => get_locale(), 'roleSettings' => et_pb_get_role_settings(), 'currentRole' => et_pb_get_current_user_role(), 'exportUrl' => $export_url, 'urls' => array('loginFormUrl' => esc_url(site_url('wp-login.php', 'login_post')), 'forgotPasswordUrl' => esc_url(wp_lostpassword_url()), 'logoutUrl' => esc_url(wp_logout_url()), 'logoutUrlRedirect' => esc_url(wp_logout_url($current_url)), 'themeOptionsUrl' => esc_url(et_pb_get_options_page_link()), 'builderPreviewStyle' => ET_BUILDER_URI . '/styles/preview.css'), 'nonces' => array('moduleContactFormSubmit' => wp_create_nonce('et-pb-contact-form-submit'), 'et_admin_load' => wp_create_nonce('et_admin_load_nonce'), 'computedProperty' => wp_create_nonce('et_pb_process_computed_property_nonce'), 'renderShortcode' => wp_create_nonce('et_pb_render_shortcode_nonce'), 'backendHelper' => wp_create_nonce('et_fb_backend_helper_nonce'), 'renderSave' => wp_create_nonce('et_fb_save_nonce'), 'prepareShortcode' => wp_create_nonce('et_fb_prepare_shortcode_nonce'), 'processImportedData' => wp_create_nonce('et_fb_process_imported_data_nonce'), 'retrieveLibraryModules' => wp_create_nonce('et_fb_retrieve_library_modules_nonce'), 'saveLibraryModules' => wp_create_nonce('et_fb_save_library_modules_nonce'), 'preview' => wp_create_nonce('et_pb_preview_nonce')), 'conditionalTags' => et_fb_conditional_tag_params(), 'currentPage' => et_fb_current_page_params(), 'appPreferences' => et_fb_app_preferences(), 'classNames' => array('hide_on_mobile_class' => 'et-hide-mobile'), 'columnLayouts' => et_builder_get_columns(), 'pageSettingsFields' => et_pb_get_builder_settings_configurations(), 'pageSettingsValues' => et_pb_get_builder_settings_values(), 'splitTestSubjects' => false !== ($all_subjects_raw = get_post_meta($post_id, '_et_pb_ab_subjects', true)) ? explode(',', $all_subjects_raw) : array(), 'defaults' => array('contactFormInputs' => et_fb_process_shortcode(sprintf('[et_pb_contact_field field_title="%1$s" field_type="input" field_id="Name" required_mark="on" fullwidth_field="off" /][et_pb_contact_field field_title="%2$s" field_type="email" field_id="Email" required_mark="on" fullwidth_field="off" /][et_pb_contact_field field_title="%3$s" field_type="text" field_id="Message" required_mark="on" fullwidth_field="on" /]', esc_attr__('Name', 'et_builder'), esc_attr__('Email Address', 'et_builder'), esc_attr__('Message', 'et_builder')))), 'all_modules_default_attrs' => ET_Builder_Element::get_all_modules_default_fields($post_type), 'saveModuleLibraryCategories' => et_fb_prepare_library_cats(), 'columnSettingFields' => array('advanced' => array('bg_img_%s' => array('label' => esc_html__('Column %s Background Image', 'et_builder'), 'type' => 'upload', 'option_category' => 'basic_option', 'upload_button_text' => esc_attr__('Upload an image', 'et_builder'), 'choose_text' => esc_attr__('Choose a Background Image', 'et_builder'), 'update_text' => esc_attr__('Set As Background', 'et_builder'), 'description' => esc_html__('If defined, this image will be used as the background for this module. To remove a background image, simply delete the URL from the settings field.', 'et_builder'), 'tab_slug' => 'advanced'), 'parallax_%s' => array('label' => esc_html__('Column %s Parallax Effect', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array('on' => esc_html__('Yes', 'et_builder'), 'off' => esc_html__('No', 'et_builder')), 'affects' => array('parallax_method_%s'), 'description' => esc_html__('Here you can choose whether or not use parallax effect for the featured image', 'et_builder'), 'tab_slug' => 'advanced'), 'parallax_method_%s' => array('label' => esc_html__('Column %s Parallax Method', 'et_builder'), 'type' => 'select', 'option_category' => 'configuration', 'options' => array('off' => esc_html__('CSS', 'et_builder'), 'on' => esc_html__('True Parallax', 'et_builder')), 'depends_show_if' => 'on', 'depends_to' => array('parallax_%s'), 'description' => esc_html__('Here you can choose which parallax method to use for the featured image', 'et_builder'), 'tab_slug' => 'advanced'), 'background_color_%s' => array('label' => esc_html__('Column %s Background Color', 'et_builder'), 'type' => 'color-alpha', 'custom_color' => true, 'tab_slug' => 'advanced'), 'padding_%s' => array('label' => esc_html__('Column %s Custom Padding', 'et_builder'), 'type' => 'custom_padding', 'mobile_options' => true, 'option_category' => 'layout', 'description' => esc_html__('Adjust padding to specific values, or leave blank to use the default padding.', 'et_builder'), 'tab_slug' => 'advanced')), 'css' => array('module_id_%s' => array('label' => esc_html__('Column %s CSS ID', 'et_builder'), 'type' => 'text', 'option_category' => 'configuration', 'tab_slug' => 'custom_css', 'option_class' => 'et_pb_custom_css_regular'), 'module_class_%s' => array('label' => esc_html__('Column %s CSS Class', 'et_builder'), 'type' => 'text', 'option_category' => 'configuration', 'tab_slug' => 'custom_css', 'option_class' => 'et_pb_custom_css_regular'), 'custom_css_before_%s' => array('label' => esc_html__('Column %s before', 'et_builder'), 'no_space_before_selector' => true, 'selector' => ':before'), 'custom_css_main_%s' => array('label' => esc_html__('Column %s Main Element', 'et_builder')), 'custom_css_after_%s' => array('label' => esc_html__('Column %s After', 'et_builder'), 'no_space_before_selector' => true, 'selector' => ':after'))));
    // Internationalization.
    $helpers['i18n'] = array('modules' => array('audio' => array('meta' => _x('by <strong>%1$s</strong>', 'Audio Module meta information', 'et_builder')), 'contactForm' => array('thankYou' => esc_html__('Thanks for contacting us', 'et_builder'), 'submit' => esc_attr__('Submit', 'et_builder')), 'countdownTimer' => array('dayFull' => esc_html__('Day(s)', 'et_builder'), 'dayShort' => esc_html__('Day', 'et_builder'), 'hourFull' => esc_html__('Hour(s)', 'et_builder'), 'hourShort' => esc_html__('Hrs', 'et_builder'), 'minuteFull' => esc_html__('Minute(s)', 'et_builder'), 'minuteShort' => esc_html__('Min', 'et_builder'), 'secondFull' => esc_html__('Second(s)', 'et_builder'), 'secondShort' => esc_html__('Sec', 'et_builder')), 'signup' => array('emailAddress' => esc_attr__('Email Address', 'et_builder'), 'firstName' => esc_attr__('First Name', 'et_builder'), 'lastName' => esc_attr__('Last Name', 'et_builder'), 'name' => esc_attr__('Name', 'et_builder'), 'email' => esc_attr__('Email', 'et_builder')), 'filterablePortfolio' => array('all' => esc_html__('All', 'et_builder')), 'login' => array('loginAs' => sprintf(esc_html__('Login as %s', 'et_builder'), $current_user->display_name), 'login' => esc_html__('Login', 'et_builder'), 'logout' => esc_html__('Log out', 'et_builder'), 'forgotPassword' => esc_html__('Forgot your password?', 'et_builder'), 'username' => esc_html__('Username', 'et_builder'), 'password' => esc_html__('Password', 'et_builder')), 'search' => array('submitButtonText' => esc_html__('Search', 'et_builder'), 'searchfor' => esc_html__('Search for:', 'et_builder')), 'fullwidthPostSlider' => array('by' => esc_html('by ', 'et_builder'))), 'saveButtonText' => esc_attr__('Save', 'et_builder'), 'saveDraftButtonText' => esc_attr__('Save Draft', 'et_builder'), 'publishButtonText' => is_page() && !current_user_can('publish_pages') || !is_page() && !current_user_can('publish_posts') ? esc_attr__('Submit', 'et_builder') : esc_attr__('Publish', 'et_builder'), 'controls' => array('tinymce' => array('visual' => esc_html__('Visual', 'et_builder'), 'text' => esc_html__('Text', 'et_builder')), 'moduleItem' => array('addNew' => esc_html__('Add New Item', 'et_builder')), 'upload' => array('buttonText' => esc_html__('Upload', 'et_builder')), 'insertMedia' => array('buttonText' => esc_html__('Add Media', 'et_builder'), 'modalTitleText' => esc_html__('Insert Media', 'et_builder')), 'inputMargin' => array('top' => esc_html__('Top', 'et_builder'), 'right' => esc_html__('Right', 'et_builder'), 'bottom' => esc_html__('Bottom', 'et_builder'), 'left' => esc_html__('Left', 'et_builder')), 'colorpicker' => array('clear' => esc_html__('Clear', 'et_builder')), 'uploadGallery' => array('uploadButtonText' => esc_html__('Update Gallery', 'et_builder')), 'centerMap' => array('updateMapButtonText' => esc_html__('Find', 'et_builder'), 'geoCodeError' => esc_html__('Geocode was not successful for the following reason', 'et_builder'), 'geoCodeError_2' => esc_html__('Geocoder failed due to', 'et_builder'), 'noResults' => esc_html__('No results found', 'et_builder'), 'mapPinAddressInvalid' => esc_html__('Invalid Pin and address data. Please try again.', 'et_builder')), 'tabs' => array('general' => esc_html__('General', 'et_builder'), 'design' => esc_html__('Design', 'et_builder'), 'css' => esc_html__('CSS', 'et_builder')), 'additionalButton' => array('changeApiKey' => esc_html__('Change API Key', 'et_builder'), 'generateImageUrlFromVideo' => esc_html__('Generate From Video', 'et_builder'))), 'rightClickMenuItems' => array('undo' => esc_html__('Undo', 'et_builder'), 'redo' => esc_html__('Redo', 'et_builder'), 'lock' => esc_html__('Lock', 'et_builder'), 'unlock' => esc_html__('Unlock', 'et_builder'), 'copy' => esc_html__('Copy', 'et_builder'), 'paste' => esc_html__('Paste', 'et_builder'), 'copyStyle' => esc_html__('Copy Style', 'et_builder'), 'pasteStyle' => esc_html__('Paste Style', 'et_builder'), 'disable' => esc_html__('Disable', 'et_builder'), 'enable' => esc_html__('Enable', 'et_builder'), 'save' => esc_html__('Save to Library', 'et_builder'), 'moduleType' => array('module' => esc_html__('Module', 'et_builder'), 'row' => esc_html__('Row', 'et_builder'), 'section' => esc_html__('Section', 'et_builder')), 'disableGlobal' => esc_html__('Disable Global', 'et_builder')), 'tooltips' => array('insertModule' => esc_html__('Insert Module', 'et_builder'), 'insertColumn' => esc_html__('Insert Columns', 'et_builder'), 'insertSection' => esc_html__('Insert Section', 'et_builder'), 'insertRow' => esc_html__('Insert Row', 'et_builder'), 'newModule' => esc_html__('New Module', 'et_builder'), 'newRow' => esc_html__('New Row', 'et_builder'), 'newSection' => esc_html__('New Section', 'et_builder'), 'addFromLibrary' => esc_html__('Add From Library', 'et_builder'), 'addToLibrary' => esc_html__('Add to Library', 'et_builder'), 'loading' => esc_html__('loading...', 'et_builder'), 'regular' => esc_html__('Regular', 'et_builder'), 'fullwidth' => esc_html__('Fullwidth', 'et_builder'), 'specialty' => esc_html__('Specialty', 'et_builder'), 'changeRow' => esc_html__('Choose Layout', 'et_builder'), 'clearLayout' => esc_html__('Clear Layout', 'et_builder'), 'clearLayoutText' => esc_html__('All of your current page content will be lost. Do you wish to proceed?', 'et_builder'), 'yes' => esc_html__('Yes', 'et_builder'), 'loadLayout' => esc_html__('Load From Library', 'et_builder'), 'predefinedLayout' => esc_html__('Predefined Layouts', 'et_builder'), 'replaceLayout' => esc_html__('Replace existing content.', 'et_builder'), 'search' => esc_html__('Search', 'et_builder') . '...', 'portability' => esc_html__('Portability', 'et_builder'), 'export' => esc_html__('Export', 'et_builder'), 'import' => esc_html__('Import', 'et_builder'), 'exportText' => esc_html__('Exporting your Divi Builder Layout will create a JSON file that can be imported into a different website.', 'et_builder'), 'exportName' => esc_html__('Export File Name', 'et_builder'), 'exportButton' => esc_html__('Export Divi Builder Layout', 'et_builder'), 'importText' => esc_html__('Importing a previously-exported Divi Builder Layout file will overwrite all content currently on this page.', 'et_builder'), 'importField' => esc_html__('Select File To Import', 'et_builder'), 'importBackUp' => esc_html__('Download backup before importing', 'et_builder'), 'importButton' => esc_html__('Import Divi Builder Layout', 'et_builder'), 'noFile' => esc_html__('No File Selected', 'et_builder'), 'chooseFile' => esc_html__('Choose File', 'et_builder')), 'saveModuleLibraryAttrs' => array('general' => esc_html__('Include General Settings', 'et_builder'), 'advanced' => esc_html__('Include Advanced Design Settings', 'et_builder'), 'css' => esc_html__('Include Custom CSS', 'et_builder'), 'selectCategoriesText' => esc_html__('Select category(ies) for new template or type a new name ( optional )', 'et_builder'), 'templateName' => esc_html__('Template Name', 'et_builder'), 'selectiveSync' => esc_html__('Selective Sync', 'et_builder'), 'selectiveError' => esc_html__('Please select at least 1 tab to save', 'et_builder'), 'globalTitle' => esc_html__('Save as Global', 'et_builder'), 'globalText' => esc_html__('Make this a global item', 'et_builder'), 'createCatText' => esc_html__('Create New Category', 'et_builder'), 'addToCatText' => esc_html__('Add To Categories', 'et_builder'), 'descriptionText' => esc_html__('Here you can add the current item to your Divi Library for later use.', 'et_builder'), 'descriptionTextLayout' => esc_html__('Save your current page to the Divi Library for later use.', 'et_builder'), 'saveText' => esc_html__('Save to Library', 'et_builder'), 'allCategoriesText' => esc_html__('All Categories', 'et_builder')), 'modals' => array('tabItemTitles' => array('general' => esc_html__('General', 'et_builder'), 'design' => esc_html__('Design', 'et_builder'), 'css' => esc_html__('CSS', 'et_builder')), 'pageSettings' => array('title' => esc_html__('Page Settings', 'et_builder'))), 'history' => array('modal' => array('title' => esc_html__('Editing History', 'et_builder'), 'tabs' => array('states' => esc_html__('History States', 'et_builder'))), 'meta' => et_pb_history_localization()), 'help' => array('modal' => array('title' => esc_html__('Divi Builder Helper', 'et_builder'), 'tabs' => array('shortcut' => esc_html__('Shortcuts', 'et_builder'))), 'shortcuts' => array('page_title' => esc_html__('Page Shortcuts', 'et_builder'), 'page' => array('undo' => array('kbd' => array('super', 'z'), 'desc' => esc_html__('Undo', 'et_builder')), 'redo' => array('kbd' => array('super', 'y'), 'desc' => esc_html__('Redo', 'et_builder')), 'save' => array('kbd' => array('super', 's'), 'desc' => esc_html__('Save Page', 'et_builder')), 'save_as_draft' => array('kbd' => array('super', 'shift', 's'), 'desc' => esc_html__('Save Page As Draft', 'et_builder')), 'exit' => array('kbd' => array('super', 'e'), 'desc' => esc_html__('Exit Visual Builder', 'et_builder')), 'exit_to_backend_builder' => array('kbd' => array('super', 'shift', 'e'), 'desc' => esc_html__('Exit To Backend Builder', 'et_builder')), 'toggle_settings_bar' => array('kbd' => array('t'), 'desc' => esc_html__('Toggle Settings Bar', 'et_builder')), 'open_page_settings' => array('kbd' => array('o'), 'desc' => esc_html__('Open Page Settings', 'et_builder')), 'open_history' => array('kbd' => array('h'), 'desc' => esc_html__('Open History Window', 'et_builder')), 'open_portability' => array('kbd' => array('p'), 'desc' => esc_html__('Open Portability Window', 'et_builder')), 'zoom_in' => array('kbd' => array('super', '+'), 'desc' => esc_html__('Responsive Zoom In', 'et_builder')), 'zoom_out' => array('kbd' => array('super', '-'), 'desc' => esc_html__('Responsive Zoom Out', 'et_builder')), 'help' => array('kbd' => array('?'), 'desc' => esc_html__('List All Shortcuts', 'et_builder'))), 'inline_title' => esc_html__('Inline Editor Shortcuts', 'et_builder'), 'inline' => array('escape' => array('kbd' => array('esc'), 'desc' => esc_html__('Exit Inline Editor', 'et_builder'))), 'module_title' => esc_html__('Module Shortcuts', 'et_builder'), 'module' => array('module_copy' => array('kbd' => array('super', 'c'), 'desc' => esc_html__('Copy Module', 'et_builder')), 'module_cut' => array('kbd' => array('super', 'x'), 'desc' => esc_html__('Cut Module', 'et_builder')), 'module_paste' => array('kbd' => array('super', 'v'), 'desc' => esc_html__('Paste Module', 'et_builder')), 'module_copy_styles' => array('kbd' => array('super', 'alt', 'c'), 'desc' => esc_html__('Copy Module Styles', 'et_builder')), 'module_paste_styles' => array('kbd' => array('super', 'alt', 'v'), 'desc' => esc_html__('Paste Module Styles', 'et_builder')), 'module_lock' => array('kbd' => array('l'), 'desc' => esc_html__('Lock Module', 'et_builder')), 'module_disable' => array('kbd' => array('d'), 'desc' => esc_html__('Disable Module', 'et_builder')), 'drag_auto_copy' => array('kbd' => array('alt', 'module move'), 'desc' => esc_html__('Move and copy module into dropped location', 'et_builder')), 'column_change_structure' => array('kbd' => array('c', array('1', '2', '3', '4')), 'desc' => esc_html__('Change Column Structure', 'et_builder')), 'row_make_fullwidth' => array('kbd' => array('r', 'f'), 'desc' => esc_html__('Make Row Fullwidth', 'et_builder')), 'row_edit_gutter' => array('kbd' => array('g', array('1', '2', '3', '4')), 'desc' => esc_html__('Change Gutter Width', 'et_builder')), 'add_new_row' => array('kbd' => array('r', array('1', '2', '3', '4')), 'desc' => esc_html__('Add New Row', 'et_builder')), 'add_new_section' => array('kbd' => array('s', array('1', '2', '3')), 'desc' => esc_html__('Add New Section', 'et_builder')), 'resize_padding_auto_opposite' => array('kbd' => array('shift', 'Drag Padding'), 'desc' => esc_html__('Restrict padding to 10px increments', 'et_builder')), 'resize_padding_limited' => array('kbd' => array('alt', 'Drag Padding'), 'desc' => esc_html__('Padding limited to opposing value', 'et_builder')), 'resize_padding_10' => array('kbd' => array('shift', 'alt', 'Drag Padding'), 'desc' => esc_html__('Mirror padding on both sides', 'et_builder')), 'increase_padding_row' => array('kbd' => array('r', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Increase Row Padding', 'et_builder')), 'decrease_padding_row' => array('kbd' => array('r', 'alt', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Decrease Row Padding', 'et_builder')), 'increase_padding_section' => array('kbd' => array('s', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Increase Section Padding', 'et_builder')), 'decrease_padding_section' => array('kbd' => array('s', 'alt', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Decrease Section Padding', 'et_builder')), 'increase_padding_row_10' => array('kbd' => array('r', 'shift', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Increase Row Padding By 10px', 'et_builder')), 'decrease_padding_row_10' => array('kbd' => array('r', 'alt', 'shift', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Decrease Row Padding By 10px', 'et_builder')), 'increase_padding_section_10' => array('kbd' => array('s', 'shift', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Increase Section Padding By 10px', 'et_builder')), 'decrease_padding_section_10' => array('kbd' => array('s', 'alt', 'shift', array('left', 'right', 'up', 'down')), 'desc' => esc_html__('Decrease Section Padding By 10px', 'et_builder'))), 'modal_title' => esc_html__('Modal Shortcuts', 'et_builder'), 'modal' => array('escape' => array('kbd' => array('esc'), 'desc' => esc_html__('Close Modal', 'et_builder')), 'save_changes' => array('kbd' => array('enter'), 'desc' => esc_html__('Save Changes', 'et_builder')), 'undo' => array('kbd' => array('super', 'z'), 'desc' => esc_html__('Undo', 'et_builder')), 'redo' => array('kbd' => array('super', 'shift', 'z'), 'desc' => esc_html__('Redo', 'et_builder')), 'switch_tabs' => array('kbd' => array('shift', 'tab'), 'desc' => esc_html__('Switch Tabs', 'et_builder')), 'toggle_expand' => array('kbd' => array('super', 'enter'), 'desc' => esc_html__('Expand Modal Fullscreen', 'et_builder')), 'toggle_snap' => array('kbd' => array('super', array('left', 'right')), 'desc' => esc_html__('Snap Modal Left / Right', 'et_builder'))))), 'sortable' => array('has_no_ab_permission' => esc_html__('You do not have permission to edit the module, row or section in this split test.', 'et_builder'), 'cannot_move_goal_into_subject' => esc_html__('A split testing goal cannot be moved inside of a split testing subject. To perform this action you must first end your split test.', 'et_builder'), 'cannot_move_subject_into_goal' => esc_html__('A split testing subject cannot be moved inside of a split testing goal. To perform this action you must first end your split test.', 'et_builder'), 'cannot_move_row_goal_out_from_subject' => esc_html__('Once set, a goal that has been placed inside a split testing subject cannot be moved outside the split testing subject. You can end your split test and start a new one if you would like to make this change.', 'et_builder'), 'section_only_row_dragged_away' => esc_html__('The section should have at least one row.', 'et_builder'), 'global_module_alert' => esc_html__('You cannot add global modules into global sections or rows', 'et_builder'), 'cannot_move_module_goal_out_from_subject' => esc_html__('Once set, a goal that has been placed inside a split testing subject cannot be moved outside the split testing subject. You can end your split test and start a new one if you would like to make this change.', 'et_builder'), 'stop_dropping_3_col_row' => esc_html__('3 column row can\'t be used in this column.', 'et_builder')), 'tooltip' => array('pageSettingsBar' => array('responsive' => array('zoom' => esc_html__('Zoom Out', 'et_builder'), 'desktop' => esc_html__('Desktop View', 'et_builder'), 'tablet' => esc_html__('Tablet View', 'et_builder'), 'phone' => esc_html__('Phone View', 'et_builder')), 'main' => array('loadLibrary' => esc_html__('Load From Library', 'et_builder'), 'saveToLibrary' => esc_html__('Save To Library', 'et_builder'), 'clearLayout' => esc_html__('Clear Layout', 'et_builder'), 'pageSettingsModal' => esc_html__('Page Settings', 'et_builder'), 'history' => esc_html__('Editing History', 'et_builder'), 'portability' => esc_html__('Portability', 'et_builder'), 'open' => esc_html__('Expand Settings', 'et_builder'), 'close' => esc_html__('Collapse Settings', 'et_builder')), 'save' => array('saveDraft' => esc_html__('Save as Draft', 'et_builder'), 'save' => esc_html__('Save', 'et_builder'), 'publish' => esc_html__('Publish', 'et_builder'))), 'modal' => array('expandModal' => esc_html__('Expand Modal', 'et_builder'), 'contractModal' => esc_html__('Contract Modal', 'et_builder'), 'resize' => esc_html__('Resize Modal', 'et_builder'), 'snapModal' => esc_html__('Snap to Left', 'et_builder'), 'separateModal' => esc_html__('Separate Modal', 'et_builder'), 'redo' => esc_html__('Redo', 'et_builder'), 'undo' => esc_html__('Undo', 'et_builder'), 'cancel' => esc_html__('Discard All Changes', 'et_builder'), 'save' => esc_html__('Save Changes', 'et_builder')), 'inlineEditor' => array('back' => esc_html__('Go Back', 'et_builder'), 'increaseFontSize' => esc_html__('Decrease Font Size', 'et_builder'), 'decreaseFontSize' => esc_html__('Increase Font Size', 'et_builder'), 'bold' => esc_html__('Bold Text', 'et_builder'), 'italic' => esc_html__('Italic Text', 'et_builder'), 'underline' => esc_html__('Underline Text', 'et_builder'), 'link' => esc_html__('Insert Link', 'et_builder'), 'quote' => esc_html__('Insert Quote', 'et_builder'), 'alignment' => esc_html__('Text Alignment', 'et_builder'), 'centerText' => esc_html__('Center Text', 'et_builder'), 'rightText' => esc_html__('Right Text', 'et_builder'), 'leftText' => esc_html__('Left Text', 'et_builder'), 'justifyText' => esc_html__('Justify Text', 'et_builder'), 'list' => esc_html__('List Settings', 'et_builder'), 'indent' => esc_html__('Indent List', 'et_builder'), 'undent' => esc_html__('Undent List', 'et_builder'), 'orderedList' => esc_html__('Insert Ordered List', 'et_builder'), 'unOrderedList' => esc_html__('Insert Unordered List', 'et_builder'), 'text' => esc_html__('Text Settings', 'et_builder'), 'textColor' => esc_html__('Text Color', 'et_builder'), 'heading' => array('one' => esc_html__('Insert Heading One', 'et_builder'), 'two' => esc_html__('Insert Heading Two', 'et_builder'), 'three' => esc_html__('Insert Heading Three', 'et_builder'), 'four' => esc_html__('Insert Heading Four', 'et_builder'))), 'section' => array('tab' => array('move' => esc_html__('Move Section', 'et_builder'), 'settings' => esc_html__('Section Settings', 'et_builder'), 'duplicate' => esc_html__('Duplicate Section', 'et_builder'), 'addToLibrary' => esc_html__('Save Section To Library', 'et_builder'), 'delete' => esc_html__('Delete Section', 'et_builder')), 'addButton' => esc_html__('Add New Section', 'et_builder')), 'row' => array('tab' => array('move' => esc_html__('Move Row', 'et_builder'), 'settings' => esc_html__('Row Settings', 'et_builder'), 'duplicate' => esc_html__('Duplicate Row', 'et_builder'), 'addToLibrary' => esc_html__('Save Row To Library', 'et_builder'), 'delete' => esc_html__('Delete Row', 'et_builder'), 'update' => esc_html__('Change Column Structure', 'et_builder')), 'addButton' => esc_html__('Add New Row', 'et_builder')), 'module' => array('tab' => array('move' => esc_html__('Move Module', 'et_builder'), 'settings' => esc_html__('Module Settings', 'et_builder'), 'duplicate' => esc_html__('Duplicate Module', 'et_builder'), 'addToLibrary' => esc_html__('Save Module To Library', 'et_builder'), 'delete' => esc_html__('Delete Module', 'et_builder')), 'addButton' => esc_html__('Add New Module', 'et_builder'))), 'unsavedConfirmation' => esc_html__('Unsaved changes will be lost if you leave the Divi Builder at this time.', 'et_builder'), 'libraryLoadError' => esc_html__('Error loading Library items from server. Please refresh the page and try again.', 'et_builder'));
    // Pass helpers via localization.
    wp_localize_script('et-frontend-builder', 'ETBuilderBackend', $helpers);
}
function jobman_display_register()
{
    global $jobman_register_failed, $wp_query;
    $options = get_option('jobman_options');
    $page = get_post($options['register_page']);
    $content = '';
    $register_html = '<div id="jobman_register">';
    $register_html .= '<form action="" method="post">';
    $register_html .= '<input type="hidden" name="jobman_register" value="1" />';
    $register_html .= '<table>';
    if (4 == $jobman_register_failed) {
        $register_html .= '<tr><td>&nbsp;</td><td class="error">' . __('Please fill in all fields.', 'jobman') . '</td></tr>';
    }
    if (1 == $jobman_register_failed) {
        $register_html .= '<tr><td>&nbsp;</td><td class="error">' . __('This username has already been registered.', 'jobman') . '</td></tr>';
    }
    $register_html .= '<tr><th scope="row"><label class="username" for="jobman_username">' . __('Username', 'jobman') . '</label>:</th>';
    $register_html .= '<td><input class="username" type="text" name="jobman_username" id="jobman_username" value="';
    $register_html .= array_key_exists('jobman_username', $wp_query->query_vars) ? $wp_query->query_vars['jobman_username'] : '';
    $register_html .= '" /></td></tr>';
    if (2 == $jobman_register_failed) {
        $register_html .= '<tr><td>&nbsp;</td><td class="error">' . __('Passwords do not match.', 'jobman') . '</td></tr>';
    }
    $register_html .= '<tr><th scope="row"><label class="password" for="jobman_password">' . __('Password', 'jobman') . '</label>:</th>';
    $register_html .= '<td><input class="password" type="password" name="jobman_password" id="jobman_password" /></td></tr>';
    $register_html .= '<tr><th scope="row"><label class="password" for="jobman_password2">' . __('Password Again', 'jobman') . '</label>:</th>';
    $register_html .= '<td><input class="password" type="password" name="jobman_password2" id="jobman_password2" /></td></tr>';
    if (3 == $jobman_register_failed) {
        $register_html .= '<tr><td>&nbsp;</td><td class="error">' . sprintf(__("This email address has already been registered. If you've previously registered but don't remember your password, please visit the <a href='%1s'>password reset page</a>.", 'jobman'), wp_lostpassword_url(jobman_current_url())) . '</td></tr>';
    }
    $register_html .= '<tr><th scope="row"><label class="email" for="jobman_email">' . __('Email Address', 'jobman') . '</label>:</th>';
    $register_html .= '<td><input class="email" type="text" name="jobman_email" id="jobman_email" value="';
    $register_html .= array_key_exists('jobman_email', $wp_query->query_vars) ? $wp_query->query_vars['jobman_email'] : '';
    $register_html .= '" /></td></tr>';
    $register_html .= '<tr><td colspan="2"><input class="submit" type="submit" name="submit" value="' . __('Register', 'jobman') . '" /></td></tr>';
    $register_html .= '</table></form></div>';
    $content .= apply_filters('jobman_register_html', $register_html);
    $page->post_content = $content;
    return array($page);
}
Example #18
0
function form_login()
{
    $logo = get_bloginfo('template_url') . "/dist/images/logo.png";
    $register = get_bloginfo('url') . "/register";
    $forgot = wp_lostpassword_url(get_permalink());
    $html = '<div class="login-box">';
    $html .= '<form id="login-form" action="login" method="post">';
    $html .= '<img src="' . $logo . '">';
    $html .= '<h5>Login to order <br> Herbal Products</h5>';
    $html .= '<div class="status"></div>';
    //$html.='<label for="username">Username</label>';
    $html .= '<input type="text" id="username" name="username" placeholder="Username" />';
    //$html.='<label for="password">Password</label>';
    $html .= '<input type="password" id="password" name="password" placeholder="Password" />';
    $html .= '<input type="submit" class="submit_button" value="Login" name="submit" />';
    $html .= wp_nonce_field('ajax-login-nonce', 'security', true, false);
    $html .= '</form>';
    $html .= '<a class="lost" href="' . $forgot . '">Forgot your password?</a>';
    $html .= '<a class="register" href="' . $register . '">New? Register</a>';
    $html .= '</div>';
    echo $html;
}
Example #19
0
 /**
  * Display the widget in the sidebar.
  *
  * @param array $args     Sidebar arguments.
  * @param array $instance The instance.
  *
  * @return bool|void
  */
 public function widget($args, $instance)
 {
     $accountUrl = get_permalink(self::$options->getPageId(Pages::ACCOUNT));
     if (is_user_logged_in()) {
         global $current_user;
         $title = !empty($instance['title_user']) ? $instance['title_user'] : __('Hey %s!', 'jigoshop');
         $links = apply_filters('jigoshop_widget_logout_user_links', array(__('My Account', 'jigoshop') => $accountUrl, __('My Orders', 'jigoshop') => Api::getEndpointUrl('orders', '', $accountUrl), __('Change Password', 'jigoshop') => Api::getEndpointUrl('change-password', '', $accountUrl), __('Logout', 'jigoshop') => wp_logout_url(home_url())));
         /** @noinspection PhpUndefinedFieldInspection */
         Render::output('widget/user_login/logged_in', array_merge($args, array('title' => sprintf($title, ucwords($current_user->display_name)), 'links' => $links)));
     } else {
         // Print title
         $title = $instance['title_guest'] ? $instance['title_guest'] : __('Login', 'jigoshop');
         $links = apply_filters('jigoshop_widget_login_user_links', array());
         $url = apply_filters('jigoshop_widget_login_redirect', $accountUrl);
         $loginUrl = wp_login_url($url);
         $passwordUrl = wp_lostpassword_url($url);
         // TODO: Support for other widgets
         //			$fields = array();
         //			// Support for other plugins which uses GET parameters
         //			$fields = apply_filters('jigoshop_get_hidden_fields', $fields);
         Render::output('widget/user_login/log_in', array_merge($args, array('title' => $title, 'links' => $links, 'loginUrl' => $loginUrl, 'passwordUrl' => $passwordUrl)));
     }
 }
function rjw_login_form_anywhere($atts, $content = null)
{
    ?>

<style>
/*Sets password box width*/
#user_pass {
    width: 95%;
}
/*Sets Login box width*/
#user_login {
    width: 95%;
}

</style>

<?php 
    extract(shortcode_atts(array('redirect' => ''), $atts));
    if (!is_user_logged_in()) {
        $postid = get_the_ID();
        $redirect_url = get_page_link($postid);
        $form = wp_login_form(array('echo' => false, 'redirect' => $redirect_url));
        $forgotpasslink = '<a href="' . wp_lostpassword_url() . '">Forgot Password</a>';
    } else {
        /*If user is logged in hide the h2 title for login*/
        ?>
		<style>
		.login-box-title{
			display:none;
		}
		</style>
<?php 
    }
    $a = "<h2 class='login-box-title'>Already have an account? Login below:</h2>" . $form;
    $a .= $forgotpasslink;
    return $a;
}
Example #21
0
/**
 * Authenticate the user using the username and password.
 *
 * @since 2.8.0
 *
 * @param WP_User|WP_Error|null $user     WP_User or WP_Error object from a previous callback. Default null.
 * @param string                $username Username for authentication.
 * @param string                $password Password for authentication.
 * @return WP_User|WP_Error WP_User on success, WP_Error on failure.
 */
function wp_authenticate_username_password($user, $username, $password)
{
    if ($user instanceof WP_User) {
        return $user;
    }
    if (empty($username) || empty($password)) {
        if (is_wp_error($user)) {
            return $user;
        }
        $error = new WP_Error();
        if (empty($username)) {
            $error->add('empty_username', __('<strong>ERROR</strong>: The username field is empty.'));
        }
        if (empty($password)) {
            $error->add('empty_password', __('<strong>ERROR</strong>: The password field is empty.'));
        }
        return $error;
    }
    $user = get_user_by('login', $username);
    if (!$user) {
        return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Invalid username.') . ' <a href="' . wp_lostpassword_url() . '">' . __('Lost your password?') . '</a>');
    }
    /**
     * Filter whether the given user can be authenticated with the provided $password.
     *
     * @since 2.5.0
     *
     * @param WP_User|WP_Error $user     WP_User or WP_Error object if a previous
     *                                   callback failed authentication.
     * @param string           $password Password to check against the user.
     */
    $user = apply_filters('wp_authenticate_user', $user, $password);
    if (is_wp_error($user)) {
        return $user;
    }
    if (!wp_check_password($password, $user->user_pass, $user->ID)) {
        return new WP_Error('incorrect_password', sprintf(__('<strong>ERROR</strong>: The password you entered for the username %s is incorrect.'), '<strong>' . $username . '</strong>') . ' <a href="' . wp_lostpassword_url() . '">' . __('Lost your password?') . '</a>');
    }
    return $user;
}
Example #22
0
</form>

<?php 
        if (!$interim_login) {
            ?>
<p id="nav">
<?php 
            if (!isset($_GET['checkemail']) || !in_array($_GET['checkemail'], array('confirm', 'newpass'))) {
                if (get_option('users_can_register')) {
                    $registration_url = sprintf('<a href="%s">%s</a>', esc_url(wp_registration_url()), __('Register'));
                    /** This filter is documented in wp-includes/general-template.php */
                    echo apply_filters('register', $registration_url) . ' | ';
                }
                ?>
	<a href="<?php 
                echo esc_url(wp_lostpassword_url());
                ?>
"><?php 
                _e('Lost your password?');
                ?>
</a>
<?php 
            }
            ?>
</p>
<?php 
        }
        ?>

<script type="text/javascript">
function wp_attempt_focus(){
Example #23
0
                               name="log" required="" placeholder="Email/ID" type="text">
                        <input kl_virtual_keyboard_secure_input="on" id="user_pass" class="form-control"
                               name="pwd" required="" placeholder="Password" type="password">
                        <div class="row">
                            <div class="checkboxes clearfix">
                                <div class="col-sm-6 text-left">
                                    <label class="remember" for="rememberme">
                                        <input id="rememberme" class="regular-checkbox" type="checkbox" value="forever">
                                        <span class="checkbox-box"></span><?php 
echo __(' Remember me', _NP_TEXT_DOMAIN);
?>
                                    </label>
                                </div>
                                <div class="col-sm-6 text-right">
                                    <a href="<?php 
echo wp_lostpassword_url(get_the_permalink());
?>
"> <?php 
echo __('Forgot Password', _NP_TEXT_DOMAIN);
?>
</a>
                                </div>
                            </div>
                            <div class="btn-wrap clearfix">
                                <div class="col-md-5 login-btn">
                                    <input class="btn btn-submit" name="wp-submit" value="LOG IN"
                                           type="submit">
                                </div>
                                <div class="col-md-7 register-btn">
                                    <a href="<?php 
echo get_site_url('/register-jobsboss');
Example #24
0
    ?>
		</p>
	<?php 
}
?>

	<?php 
if ($attributes['registered']) {
    ?>
		<p class="login-info">
			<?php 
    printf(__('You have successfully registered to <strong>%s</strong>. We have emailed your password to the email address you entered.', 'onex-login'), get_bloginfo('name'));
    ?>
		</p>
	<?php 
}
?>

	<?php 
wp_login_form(array('label_username' => __('Username', 'onex-login'), 'label_log_in' => __('Sign In', 'onex-login'), 'redirect' => $attributes['redirect']));
?>

	<a class="forgot-password" href="<?php 
echo wp_lostpassword_url();
?>
" >
		<?php 
_e('Forgot your password?', 'onex-login');
?>
	</a>
</div>
Example #25
0
    }
}
?>
<div class="container">
	<div class="row">
		<div class="col-lg-8 col-lg-offset-2 centered">
		<?php 
wp_login_form($args);
?>
 
		<!-- redirect to page after password is reset---->
		<?php 
$url = get_home_url() . "/login/";
?>
		<a href="<?php 
echo wp_lostpassword_url($url());
?>
" title="Lost Password">Lost Password</a>
		</div>
	</div>
</div>









function wsl_process_login_new_users_gateway($provider, $redirect_to, $hybridauth_user_profile)
{
    // HOOKABLE:
    do_action("wsl_process_login_new_users_gateway_start", $provider, $redirect_to, $hybridauth_user_profile);
    $assets_base_url = WORDPRESS_SOCIAL_LOGIN_PLUGIN_URL . '/assets/img/16x16/';
    // remove wsl widget
    remove_action('register_form', 'wsl_render_auth_widget_in_wp_register_form');
    $hybridauth_user_email = sanitize_email($hybridauth_user_profile->email);
    $hybridauth_user_login = sanitize_user($hybridauth_user_profile->displayName, true);
    $hybridauth_user_avatar = $hybridauth_user_profile->photoURL;
    $hybridauth_user_website = $hybridauth_user_profile->webSiteURL;
    $hybridauth_user_link = $hybridauth_user_profile->profileURL;
    $hybridauth_user_login = trim(str_replace(array(' ', '.'), '_', $hybridauth_user_login));
    $hybridauth_user_login = trim(str_replace('__', '_', $hybridauth_user_login));
    $requested_user_email = isset($_REQUEST["user_email"]) ? trim($_REQUEST["user_email"]) : $hybridauth_user_email;
    $requested_user_login = isset($_REQUEST["user_login"]) ? trim($_REQUEST["user_login"]) : $hybridauth_user_login;
    $requested_user_email = apply_filters('wsl_new_users_gateway_alter_requested_email', $requested_user_email);
    $requested_user_login = apply_filters('wsl_new_users_gateway_alter_requested_login', $requested_user_login);
    $user_id = 0;
    $shall_pass = false;
    $bouncer_account_linking = false;
    $account_linking_errors = array();
    $bouncer_profile_completion = false;
    $profile_completion_errors = array();
    $linking_enabled = get_option('wsl_settings_bouncer_accounts_linking_enabled');
    // $linking_enabled = 2; // overide linking_enabled
    if (isset($_REQUEST["bouncer_account_linking"])) {
        if ($linking_enabled == 2) {
            return wsl_process_login_render_notice_page(_wsl__("Not tonight.", 'wordpress-social-login'));
        }
        $bouncer_account_linking = true;
        $username = isset($_REQUEST["user_login"]) ? trim($_REQUEST["user_login"]) : '';
        $password = isset($_REQUEST["user_password"]) ? trim($_REQUEST["user_password"]) : '';
        # http://codex.wordpress.org/Function_Reference/wp_authenticate
        $user = wp_authenticate($username, $password);
        // WP_Error object?
        if (is_wp_error($user)) {
            // we give no useful hint.
            $account_linking_errors[] = sprintf(_wsl__('<strong>ERROR</strong>: Invalid username or incorrect password. <a href="%s">Lost your password</a>?', 'wordpress-social-login'), wp_lostpassword_url(home_url()));
        } elseif (is_a($user, 'WP_User')) {
            $user_id = $user->ID;
            $shall_pass = true;
        }
    } elseif (isset($_REQUEST["bouncer_profile_completion"])) {
        $require_email = get_option('wsl_settings_bouncer_profile_completion_require_email');
        $change_username = get_option('wsl_settings_bouncer_profile_completion_change_username');
        $extra_fields = get_option('wsl_settings_bouncer_profile_completion_hook_extra_fields');
        // Bouncer::Profile Completion enabled?
        // > if not enabled we just let the user pass
        if ($require_email == 2 && $change_username == 2 && $extra_fields == 2) {
            $shall_pass = true;
        } else {
            $bouncer_profile_completion = true;
            /**
             * Code based on wpmu_validate_user_signup()
             *
             * Ref: http://codex.wordpress.org/Function_Reference/wpmu_validate_user_signup
             */
            # {{{ validate usermail
            if ($require_email == 1) {
                if (empty($requested_user_email)) {
                    $profile_completion_errors[] = _wsl__('<strong>ERROR</strong>: Please type your e-mail address.', 'wordpress-social-login');
                }
                if (!is_email($requested_user_email)) {
                    $profile_completion_errors[] = _wsl__('<strong>ERROR</strong>: Please enter a valid email address.', 'wordpress-social-login');
                }
                if (wsl_wp_email_exists($requested_user_email)) {
                    $profile_completion_errors[] = _wsl__('<strong>ERROR</strong>: Sorry, that email address is already used!', 'wordpress-social-login');
                }
            }
            # }}} validate usermail
            # {{{ validate username (called login in wsl)
            if ($change_username == 1) {
                $illegal_names = array('www', 'web', 'root', 'admin', 'main', 'invite', 'administrator');
                $illegal_names = apply_filters('wsl_new_users_gateway_alter_illegal_names', $illegal_names);
                if (in_array($requested_user_login, $illegal_names) == true) {
                    $profile_completion_errors[] = _wsl__('<strong>ERROR</strong>: That username is not allowed.', 'wordpress-social-login');
                }
                if (strlen($requested_user_login) < 4) {
                    $profile_completion_errors[] = _wsl__('<strong>ERROR</strong>: Username must be at least 4 characters.', 'wordpress-social-login');
                }
                if (strpos(' ' . $requested_user_login, '_') != false) {
                    $profile_completion_errors[] = _wsl__('<strong>ERROR</strong>: Sorry, usernames may not contain the character &#8220;_&#8221;!', 'wordpress-social-login');
                }
                if (preg_match('/^[0-9]*$/', $requested_user_login)) {
                    $profile_completion_errors[] = _wsl__('<strong>ERROR</strong>: Sorry, usernames must have letters too!', 'wordpress-social-login');
                }
                if (username_exists($requested_user_login)) {
                    $profile_completion_errors[] = _wsl__('<strong>ERROR</strong>: Sorry, that username already exists!', 'wordpress-social-login');
                }
            }
            # }}} validate username
            # ... well, that was a lot of sorries.
            # {{{ extra fields
            if ($extra_fields == 1) {
                $errors = new WP_Error();
                $errors = apply_filters('registration_errors', $errors, $requested_user_login, $requested_user_email);
                if ($errors = $errors->get_error_messages()) {
                    foreach ($errors as $error) {
                        $profile_completion_errors[] = $error;
                    }
                }
            }
            # }}} extra fields
            $profile_completion_errors = apply_filters('wsl_new_users_gateway_alter_profile_completion_errors', $profile_completion_errors);
            // all check?
            if (!$profile_completion_errors) {
                $shall_pass = true;
            }
        }
    }
    if ($shall_pass == false) {
        ?>
 
<!DOCTYPE html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title><?php 
        echo get_bloginfo('name');
        ?>
</title>
		<style type="text/css"> 
			html, body {
				height: 100%;
				margin: 0;
				padding: 0;
			}
			body {
				background: none repeat scroll 0 0 #f1f1f1;
				font-size: 14px;
				color: #444;
				font-family: "Open Sans",sans-serif;
			}
			hr {
				border-color: #eeeeee;
				border-style: none none solid;
				border-width: 0 0 1px;
				margin: 2px 0 0;
			}
			h4 {
				font-size: 14px;
				margin-bottom: 10px;
			}
			#login { 
				width: 616px;
				margin: auto;
				padding: 114px 0 0;
			}
			#login-panel {
				background: none repeat scroll 0 0 #fff;
				box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
				margin: 2em auto;
				box-sizing: border-box;
				display: inline-block;
				padding: 70px 0 15px;
				position: relative;
				text-align: center;
				width: 100%;
			}
			#avatar {
				margin-left: -76px;
				top: -80px;
				left: 50%;
				padding: 4px;
				position: absolute;
			}
			#avatar img {
				background: none repeat scroll 0 0 #fff;
				border: 3px solid #f1f1f1;
				border-radius: 75px !important;
				box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
				height: 145px;
				width: 145px;
			}
			#welcome {
				height: 55px;
				margin: 15px 20px 35px;
			}
			#idp-icon {
				position: absolute;
				margin-top: 2px;
				margin-left: -19px;
			}
			#login-form{
				margin: 0;
				padding: 0;
			}
			.button-primary {
				background-color: #21759b;
				background-image: linear-gradient(to bottom, #2a95c5, #21759b);
				border-color: #21759b #21759b #1e6a8d;
				border-radius: 3px;
				border-style: solid;
				border-width: 1px;
				box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset;
				box-sizing: border-box;
				color: #fff;
				cursor: pointer;
				display: inline-block;
				float: none;
				font-size: 12px;
				height: 36px;
				line-height: 23px;
				margin: 0;
				padding: 0 10px 1px;
				text-decoration: none;
				text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
				white-space: nowrap;
			}
			button-primary.focus, .button-primary:hover{
				background:#1e8cbe;
				border-color:#0074a2;
				-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);
				box-shadow:inset 0 1px 0 rgba(120,200,230,.6);
				color:#fff
			}
			input[type="text"]{
				border: 1px solid #e5e5e5;
				box-shadow: 1px 1px 2px rgba(200, 200, 200, 0.2) inset;
				color: #555;
				font-size: 17px;
				height: 30px;
				line-height: 1;
				margin-bottom: 16px;
				margin-right: 6px;
				margin-top: 2px;
				outline: 0 none;
				padding: 3px;
				width: 100%;
			}
			input[type="text"]:focus{
				border-color:#5b9dd9;
				-webkit-box-shadow:0 0 2px rgba(30,140,190,.8);
				box-shadow:0 0 2px rgba(30,140,190,.8)
			}
			input[type="submit"]{
				float:right;
			}
			label{
				color:#777;
				font-size:14px;
				cursor:pointer;
				vertical-align:middle;
				text-align: left;
			}
			table {
				width:355px;
				margin-left:auto; 
				margin-right:auto;
			}
			#mapping-options {
				width:555px;
			}
			#mapping-authenticate {
				display:none;
			}
			#mapping-complete-info {
				display:none;
			}
			.error {
				display:none;
				background-color: #fff;
				border-left: 4px solid #dd3d36;
				box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
				margin: 0 21px;
				padding: 12px;	
				text-align:left;
			}
			.back-to-options {
				float: left;
				margin: 7px 0px;
			}
			.back-to-home {
				font-size: 12px;
				margin-top: -18px;
			}
			.back-to-home a {
				color: #999;
				text-decoration: none;
			}
			<?php 
        if ($linking_enabled == 2) {
            ?>
					#login {width: 400px;}
					#welcome, #mapping-options, #errors-account-linking, #mapping-complete-info {display: none;}
					#errors-profile-completion, #mapping-complete-info {display: block;}
					<?php 
        } elseif ($bouncer_account_linking) {
            ?>
					#login {width: 400px;}
					#welcome, #mapping-options, #errors-profile-completion, #mapping-complete-info {display: none;}
					#errors-account-linking, #mapping-authenticate {display: block;}
					<?php 
        } elseif ($bouncer_profile_completion) {
            ?>
					#login {width: 400px;}
					#welcome, #mapping-options, #errors-account-linking, #mapping-complete-info {display: none;}
					#errors-profile-completion, #mapping-complete-info {display: block;}
					<?php 
        }
        ?>
		</style>
		<script>
			// good old time
			function toggleEl( el, display )
			{
				if( el = document.getElementById( el ) )
				{
					el.style.display = display;
				}
			}

			function toggleWidth( el, width )
			{
				if( el = document.getElementById( el ) )
				{
					el.style.width = width;
				}
			}

			function display_mapping_options()
			{
				toggleWidth( 'login', '616px' );

				toggleEl( 'welcome'        , 'block' );
				toggleEl( 'mapping-options', 'block' );
				
				toggleEl( 'errors-profile-completion', 'none' );
				toggleEl( 'mapping-authenticate'     , 'none' );

				toggleEl( 'errors-account-linking', 'none' );
				toggleEl( 'mapping-complete-info' , 'none' );
			}

			function display_mapping_authenticate()
			{
				toggleWidth( 'login', '400px' );

				toggleEl( 'welcome'        , 'none' );
				toggleEl( 'mapping-options', 'none' );

				toggleEl( 'errors-account-linking', 'block' ); 
				toggleEl( 'mapping-authenticate'  , 'block' );

				toggleEl( 'errors-profile-completion', 'none' );
				toggleEl( 'mapping-complete-info'    ,'none' );
			}

			function display_mapping_complete_info()
			{
				toggleWidth( 'login', '400px' );

				toggleEl( 'welcome'        , 'none' );
				toggleEl( 'mapping-options', 'none' );

				toggleEl( 'errors-account-linking', 'none' );
				toggleEl( 'mapping-authenticate'  , 'none' );

				toggleEl( 'errors-profile-completion', 'block' );
				toggleEl( 'mapping-complete-info'    , 'block' );
			}
		</script>
	</head>
	<body>
		<div id="login">
			<div id="login-panel">
				<div id="avatar">
					<img src="<?php 
        echo $hybridauth_user_avatar;
        ?>
">
				</div>

				<div id="welcome">
					<img id="idp-icon" src="<?php 
        echo $assets_base_url . $provider;
        ?>
.png" > 
					<b><?php 
        printf(_wsl__("Hi %s", 'wordpress-social-login'), htmlentities($hybridauth_user_profile->displayName));
        ?>
</b>
					<p><?php 
        printf(_wsl__("You're now signed in with your %s account but you still one step away of getting into our website", 'wordpress-social-login'), $provider);
        ?>
.</p>

					<hr />
				</div>

				<table id="mapping-options" border="0">
					<tr>
						<?php 
        if ($linking_enabled == 1) {
            ?>
							<td valign="top"  width="50%" style="text-align:center;">
								<h4><?php 
            _wsl_e("Already have an account", 'wordpress-social-login');
            ?>
?</h4>
								<p style="font-size: 12px;"><?php 
            printf(_wsl__("Link your existing account on our website to your %s ID.", 'wordpress-social-login'), $provider);
            ?>
</p>
							</td>
						<?php 
        }
        ?>
						<td valign="top"  width="50%" style="text-align:center;">
							<h4><?php 
        _wsl_e("New to our website", 'wordpress-social-login');
        ?>
?</h4>
							<p style="font-size: 12px;"><?php 
        printf(_wsl__("Create a new account and it will be associated with your %s ID.", 'wordpress-social-login'), $provider);
        ?>
</p>
						</td>
					</tr>
					
					<tr>
						<?php 
        if ($linking_enabled == 1) {
            ?>
							<td valign="top"  width="50%" style="text-align:center;">
								<input type="button" value="<?php 
            _wsl_e("Link my account", 'wordpress-social-login');
            ?>
" class="button-primary" onclick="display_mapping_authenticate();" > 
							</td>
						<?php 
        }
        ?>
						<td valign="top"  width="50%" style="text-align:center;">
							<input type="button" value="<?php 
        _wsl_e("Create a new account", 'wordpress-social-login');
        ?>
" class="button-primary" onclick="display_mapping_complete_info();" > 
						</td>
					</tr>
				</table> 

				<?php 
        if ($account_linking_errors) {
            echo '<div id="errors-account-linking" class="error">';
            foreach ($account_linking_errors as $error) {
                ?>
<p><?php 
                echo $error;
                ?>
</p><?php 
            }
            echo '</div>';
        }
        if ($profile_completion_errors) {
            echo '<div id="errors-profile-completion" class="error">';
            foreach ($profile_completion_errors as $error) {
                ?>
<p><?php 
                echo $error;
                ?>
</p><?php 
            }
            echo '</div>';
        }
        ?>

				<form method="post" action="<?php 
        echo site_url('wp-login.php', 'login_post');
        ?>
" id="login-form">
					<table id="mapping-authenticate" border="0"> 
						<tr>
							<td valign="top"  width="50%" style="text-align:center;">
								<h4><?php 
        _wsl_e("Already have an account", 'wordpress-social-login');
        ?>
?</h4> 

								<p><?php 
        printf(_wsl__("Please enter your username and password of your existing account on our website. Once verified, it will linked to your % ID", 'wordpress-social-login'), ucfirst($provider));
        ?>
.</p>
							</td>
						</tr> 
						<tr>
							<td valign="bottom"  width="50%" style="text-align:left;">
								<label>
									<?php 
        _wsl_e("Username", 'wordpress-social-login');
        ?>
									<br />
									<input type="text" name="user_login" class="input" value=""  size="25" placeholder="" />
								</label>

								<label>
									<?php 
        _wsl_e("Password", 'wordpress-social-login');
        ?>
									<br />
									<input type="text" name="user_password" class="input" value="" size="25" placeholder="" />
								</label> 

								<input type="submit" value="<?php 
        _wsl_e("Continue", 'wordpress-social-login');
        ?>
" class="button-primary" > 
								
								<a href="javascript:void(0);" onclick="display_mapping_options();" class="back-to-options"><?php 
        _wsl_e("Back", 'wordpress-social-login');
        ?>
</a>
							</td>
						</tr>
					</table> 

					<input type="hidden" id="redirect_to" name="redirect_to" value="<?php 
        echo $redirect_to;
        ?>
"> 
					<input type="hidden" id="provider" name="provider" value="<?php 
        echo $provider;
        ?>
"> 
					<input type="hidden" id="action" name="action" value="wordpress_social_account_linking">
					<input type="hidden" id="bouncer_account_linking" name="bouncer_account_linking" value="1">
				</form>

				<form method="post" action="<?php 
        echo site_url('wp-login.php', 'login_post');
        ?>
" id="login-form"> 
					<table id="mapping-complete-info" border="0">
						<tr>
							<td valign="top"  width="50%" style="text-align:center;">
								<?php 
        if ($linking_enabled == 1) {
            ?>
									<h4><?php 
            _wsl_e("New to our website", 'wordpress-social-login');
            ?>
?</h4>
								<?php 
        }
        ?>

								<p><?php 
        printf(_wsl__("Please fill in your information in the form below. Once completed, you will be able to automatically sign into our website through your %s ID", 'wordpress-social-login'), ucfirst($provider));
        ?>
.</p>
							</td>
						</tr>
						<tr>
							<td valign="bottom"  width="50%" style="text-align:left;">
								<label>
									<?php 
        _wsl_e("Username", 'wordpress-social-login');
        ?>
									<br />
									<input type="text" name="user_name" class="input" value="<?php 
        echo $requested_user_login;
        ?>
" size="25" placeholder="" />
								</label>

								<label>
									<?php 
        _wsl_e("E-mail", 'wordpress-social-login');
        ?>
									<br />
									<input type="text" name="user_email" class="input" value="<?php 
        echo $requested_user_email;
        ?>
" size="25" placeholder="" />
								</label> 

								<?php 
        /**
         * Fires following the 'E-mail' field in the user registration form.
         *
         * hopefully, this won't become a pain in future
         *
         * Ref: http://codex.wordpress.org/Plugin_API/Action_Reference/register_form
         */
        $extra_fields = get_option('wsl_settings_bouncer_profile_completion_hook_extra_fields');
        if ($extra_fields == 1) {
            do_action('register_form');
        }
        ?>

								<input type="submit" value="<?php 
        _wsl_e("Continue", 'wordpress-social-login');
        ?>
" class="button-primary" > 

								<?php 
        if ($linking_enabled == 1) {
            ?>
									<a href="javascript:void(0);" onclick="display_mapping_options();" class="back-to-options"><?php 
            _wsl_e("Back", 'wordpress-social-login');
            ?>
</a>
								<?php 
        }
        ?>
							</td>
						</tr>
					</table> 

					<input type="hidden" id="redirect_to" name="redirect_to" value="<?php 
        echo $redirect_to;
        ?>
"> 
					<input type="hidden" id="provider" name="provider" value="<?php 
        echo $provider;
        ?>
"> 
					<input type="hidden" id="action" name="action" value="wordpress_social_account_linking">
					<input type="hidden" id="bouncer_profile_completion" name="bouncer_profile_completion" value="1">
				</form>
			</div>

			<p class="back-to-home">
				<a href="<?php 
        echo site_url();
        ?>
">&#8592; <?php 
        printf(_wsl__("Back to %s", 'wordpress-social-login'), get_bloginfo('name'));
        ?>
</a>
			</p>
		</div>

		<?php 
        // Development mode on?
        if (get_option('wsl_settings_development_mode_enabled')) {
            wsl_display_dev_mode_debugging_area();
        }
        ?>
 
	</body>
</html>
<?php 
        die;
    }
    return array($shall_pass, $user_id, $requested_user_login, $requested_user_email);
}
Example #27
0
function et_pb_login($atts, $content = null)
{
    extract(shortcode_atts(array('module_id' => '', 'module_class' => '', 'title' => '', 'background_color' => et_get_option('accent_color', '#7EBEC5'), 'background_layout' => 'dark', 'text_orientation' => 'left', 'use_background_color' => 'on', 'current_page_redirect' => 'off'), $atts));
    $redirect_url = 'on' === $current_page_redirect ? (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] : '';
    if (is_user_logged_in()) {
        global $current_user;
        get_currentuserinfo();
        $content .= sprintf('<br/>%1$s <a href="%2$s">%3$s</a>', sprintf(__('Logged in as %1$s', 'Divi'), esc_html($current_user->display_name)), esc_url(wp_logout_url($redirect_url)), esc_html__('Log out', 'Divi'));
    }
    $class = " et_pb_bg_layout_{$background_layout} et_pb_text_align_{$text_orientation}";
    $form = '';
    if (!is_user_logged_in()) {
        $username = __('Username', 'Divi');
        $password = __('Password', 'Divi');
        $form = sprintf('
			<div class="et_pb_newsletter_form et_pb_login_form">
				<form action="%7$s" method="post">
					<p>
						<label class="et_pb_contact_form_label" for="user_login" style="display: none;">%3$s</label>
						<input id="user_login" placeholder="%4$s" class="input" type="text" value="" name="log" />
					</p>
					<p>
						<label class="et_pb_contact_form_label" for="user_pass" style="display: none;">%5$s</label>
						<input id="user_pass" placeholder="%6$s" class="input" type="password" value="" name="pwd" />
					</p>
					<p class="et_pb_forgot_password"><a href="%2$s">%1$s</a></p>
					<p>
						<button type="submit" class="et_pb_newsletter_button">%8$s</button>
						%9$s
					</p>
				</form>
			</div>', __('Forgot your password?', 'Divi'), esc_url(wp_lostpassword_url()), esc_html($username), esc_attr($username), esc_html($password), esc_attr($password), esc_url(site_url('wp-login.php')), __('Login', 'Divi'), 'on' === $current_page_redirect ? sprintf('<input type="hidden" name="redirect_to" value="%1$s" />', $redirect_url) : '');
    }
    $output = sprintf('<div%6$s class="et_pb_newsletter et_pb_login clearfix%4$s%7$s"%5$s>
			<div class="et_pb_newsletter_description">
				%1$s
				%2$s
			</div>
			%3$s
		</div>', '' !== $title ? '<h2>' . esc_html($title) . '</h2>' : '', do_shortcode(et_pb_fix_shortcodes($content)), $form, esc_attr($class), 'on' === $use_background_color ? sprintf(' style="background-color: %1$s;"', esc_attr($background_color)) : '', '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '');
    return $output;
}
Example #28
0
 /**
  * @param array $params
  * @param $errors
  * @param string $emailName
  */
 public function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email')
 {
     $config = CRM_Core_Config::singleton();
     $dao = new CRM_Core_DAO();
     $name = $dao->escape(CRM_Utils_Array::value('name', $params));
     $email = $dao->escape(CRM_Utils_Array::value('mail', $params));
     if (!empty($params['name'])) {
         if (!validate_username($params['name'])) {
             $errors['cms_name'] = ts("Your username contains invalid characters");
         } elseif (username_exists(sanitize_user($params['name']))) {
             $errors['cms_name'] = ts('The username %1 is already taken. Please select another username.', array(1 => $params['name']));
         }
     }
     if (!empty($params['mail'])) {
         if (!is_email($params['mail'])) {
             $errors[$emailName] = "Your email is invaid";
         } elseif (email_exists($params['mail'])) {
             $errors[$emailName] = ts('The email address %1 already has an account associated with it. <a href="%2">Have you forgotten your password?</a>', array(1 => $params['mail'], 2 => wp_lostpassword_url()));
         }
     }
 }
Example #29
0
		<label for="password"><?php 
_e('Password', 'woocommerce');
?>
 <span class="required">*</span></label>
		<input class="input-text" type="password" name="password" id="password" />
	</p>
	<div class="clear"></div>

	<p class="form-row">
		<?php 
$woocommerce->nonce_field('login', 'login');
?>
		<input type="submit" class="button" name="login" value="<?php 
_e('Login', 'woocommerce');
?>
" />
		<input type="hidden" name="redirect" value="<?php 
echo esc_url($redirect);
?>
" />
		<a class="lost_password" href="<?php 
echo esc_url(wp_lostpassword_url(home_url('/')));
?>
"><?php 
_e('Lost Password?', 'woocommerce');
?>
</a>
	</p>

	<div class="clear"></div>
</form>
Example #30
0
function px_verify_view_registration_form($errors = '', $verified = array())
{
    login_header(__('Registration Form'), '<p class="message register">' . __('Register An Account') . '</p>', $errors);
    if ($verified) {
        ?>
		<div class="message success">
			<h3>Purchase Information</h3><br/>
			<p><strong>Buyer: </strong><?php 
        echo $verified['px_envato_username'];
        ?>
</p>
			<p><strong>Item: </strong><?php 
        echo $verified['px_envato_item'];
        ?>
</p>
			<p><strong>License: </strong><?php 
        echo $verified['px_envato_license'];
        ?>
</p>
			<p><strong>Purchase Code: </strong><?php 
        echo $verified['px_envato_purchase_code'];
        ?>
</p>
		</div>
		<?php 
    }
    ?>

	<form name="registerform" id="registerform" action="<?php 
    echo esc_url(site_url('wp-login.php?action=register', 'login_post'));
    ?>
" method="post">
		<input type="hidden" name="purchase_code" value="<?php 
    echo $verified['px_envato_purchase_code'];
    ?>
" />

		<p>
			<label for="user_login"><?php 
    _e('Username');
    ?>
<br />
			<input type="text" name="user_login" id="user_login" class="input" value="<?php 
    echo $verified['px_envato_username'];
    ?>
" size="20" tabindex="10" /></label>
		</p>
		<p>
			<label for="user_email"><?php 
    _e('E-mail');
    ?>
<br />
			<input type="email" name="user_email" id="user_email" class="input" value="" size="25" tabindex="20" /></label>
		</p>

		<p id="reg_passmail"><?php 
    _e('A password will be e-mailed to you.');
    ?>
</p>
		<br class="clear" />
		<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php 
    esc_attr_e('Register');
    ?>
" tabindex="100" /></p>
	</form>

	<p id="nav">
	<a href="<?php 
    echo esc_url(wp_login_url());
    ?>
"><?php 
    _e('Log in');
    ?>
</a> |
	<a href="<?php 
    echo esc_url(wp_lostpassword_url());
    ?>
" title="<?php 
    esc_attr_e('Password Lost and Found');
    ?>
"><?php 
    _e('Lost your password?');
    ?>
</a>
	</p>

	<?php 
    login_footer('user_login');
}