</div>
					</td>
				</tr>
				<tr>
					<th><?php 
_e('Confirm Password', 'makery');
?>
</th>
					<td>
						<div class="field-wrap">
							<input type="password" name="confirm_password" value="" />
						</div>
					</td>
				</tr>
				<?php 
if (ThemexFacebook::isUpdated(ThemexUser::$data['current']['ID'])) {
    ?>
				<tr>
					<th><?php 
    _e('Current Password', 'makery');
    ?>
</th>
					<td>
						<div class="field-wrap">
							<input type="password" name="current_password" value="" />
						</div>
					</td>
				</tr>
				<?php 
}
?>
Exemplo n.º 2
0
_e('Username', 'makery');
?>
">
		</div>
		<div class="field-wrap">
			<input type="password" name="user_password" value="" placeholder="<?php 
_e('Password', 'makery');
?>
">
		</div>
		<a href="#" class="element-button element-submit"><?php 
_e('Sign In', 'makery');
?>
</a>
		<?php 
if (ThemexFacebook::isActive()) {
    ?>
		<a href="<?php 
    echo home_url('?facebook_login=1');
    ?>
" class="element-button element-facebook square facebook" title="<?php 
    _e('Sign in with Facebook', 'makery');
    ?>
"><span class="fa fa-facebook"></span></a>
		<?php 
}
?>
		<a href="#password_form" class="element-button element-colorbox square" title="<?php 
_e('Password Recovery', 'makery');
?>
"><span class="fa fa-life-ring"></span></a>
Exemplo n.º 3
0
		</div>
		<div class="field-wrapper">
			<input type="password" name="user_password" placeholder="<?php 
_e('Password', 'academy');
?>
" />
		</div>			
		<a href="#" class="element-button submit-button left"><span class="button-icon login"></span><?php 
_e('Sign In', 'academy');
?>
</a>
		<?php 
if (ThemexFacebook::isActive()) {
    ?>
		<a href="<?php 
    echo ThemexFacebook::getURL();
    ?>
" title="<?php 
    _e('Sign in with Facebook', 'academy');
    ?>
" class="element-button facebook-button left">
			<span class="button-icon facebook"></span>
		</a>
		<?php 
}
?>
		<div class="form-loader"></div>
		<input type="hidden" name="user_action" value="login_user" />
		<input type="hidden" name="user_redirect" value="<?php 
echo themex_value($_POST, 'user_redirect');
?>
Exemplo n.º 4
0
 /**
  * Updates user settings
  *
  * @access public
  * @param int $ID
  * @param array $data
  * @return void
  */
 public static function updateSettings($ID, $data)
 {
     $current = get_user_by('id', $ID);
     $facebook = ThemexFacebook::isUpdated($ID);
     $required = false;
     $user = array('ID' => $ID);
     //password
     $new_password = trim(themex_value('new_password', $data));
     if (!empty($new_password)) {
         $confirm_password = trim(themex_value('confirm_password', $data));
         $user['user_pass'] = $new_password;
         $required = true;
         if (strlen($new_password) < 4) {
             ThemexInterface::$messages[] = __('Password must be at least 4 characters long', 'makery');
         } else {
             if (strlen($new_password) > 16) {
                 ThemexInterface::$messages[] = __('Password must be not more than 16 characters long', 'makery');
             } else {
                 if (preg_match("/^([a-zA-Z0-9@#-_\$%^&+=!?]{1,20})\$/", $new_password) == 0) {
                     ThemexInterface::$messages[] = __('Password contains invalid characters', 'makery');
                 } else {
                     if ($new_password != $confirm_password) {
                         ThemexInterface::$messages[] = __('Passwords do not match', 'makery');
                     }
                 }
             }
         }
     }
     //email
     $email = trim(themex_value('email', $data));
     if ($email != $current->user_email) {
         $user['user_email'] = $email;
         $required = true;
         if (!is_email($email)) {
             ThemexInterface::$messages[] = __('Email address is invalid', 'makery');
         }
     }
     //notices
     $notices = themex_value('notices', $data);
     ThemexCore::updateUserMeta($ID, 'notices', $notices);
     $current_password = trim(themex_value('current_password', $data));
     if ($required && $facebook && !wp_check_password($current_password, $current->user_pass, $current->ID)) {
         ThemexInterface::$messages[] = __('Current password is incorrect', 'makery');
     }
     if (empty(ThemexInterface::$messages)) {
         wp_update_user($user);
         if (isset($user['user_pass']) && !$facebook) {
             ThemexFacebook::updateUser($ID);
         }
         ThemexInterface::$messages[] = __('Settings have been successfully saved', 'makery');
         $_POST['success'] = true;
     }
 }