Update 1.0.60

This commit is contained in:
ultimatemember
2015-02-19 00:49:08 +02:00
parent 5effe7c017
commit 11c684fdeb
11 changed files with 85 additions and 42 deletions
+4 -2
View File
@@ -442,7 +442,9 @@ p.um-notice.err {
.um-field-checkbox:hover i, .um-field-radio:hover i {color: #666}
.um-field-checkbox input,
.um-field-radio input{display:none!important}
.um-field-radio input{
opacity: 0 !important;
}
.um-field-checkbox-state,
.um-field-radio-state {
@@ -464,7 +466,7 @@ p.um-notice.err {
.um-field-checkbox-option,
.um-field-radio-option {
margin: 0 0 0 32px;
margin: 0 0 0 22px;
line-height: 24px;
color: #888 !important;
display: inline-block;
+1 -1
View File
File diff suppressed because one or more lines are too long
+27 -1
View File
@@ -6,6 +6,8 @@ class UM_Account {
add_shortcode('ultimatemember_account', array(&$this, 'ultimatemember_account'), 1);
add_filter('um_account_page_default_tabs_hook', array(&$this, 'core_tabs'), 1);
add_action('template_redirect', array(&$this, 'account'), 10001 );
add_action('template_redirect', array(&$this, 'form_init'), 10002);
@@ -14,6 +16,29 @@ class UM_Account {
}
/***
*** @get core account tabs
***/
function core_tabs() {
$tabs[100]['general']['icon'] = 'um-faicon-user';
$tabs[100]['general']['title'] = __('Account','ultimatemember');
$tabs[200]['password']['icon'] = 'um-faicon-asterisk';
$tabs[200]['password']['title'] = __('Change Password','ultimatemember');
$tabs[300]['privacy']['icon'] = 'um-faicon-lock';
$tabs[300]['privacy']['title'] = __('Privacy','ultimatemember');
$tabs[400]['notifications']['icon'] = 'um-faicon-bell';
$tabs[400]['notifications']['title'] = __('Notifications','ultimatemember');
$tabs[500]['delete']['icon'] = 'um-faicon-trash-o';
$tabs[500]['delete']['title'] = __('Delete Account','ultimatemember');
return $tabs;
}
/***
*** @account page form
***/
@@ -160,7 +185,8 @@ class UM_Account {
break;
default :
$args = null;
$output = apply_filters("um_account_content_hook_{$id}", $output);
return $output;
break;
}
+5 -17
View File
@@ -22,6 +22,9 @@
unset( $changes['hide_in_members'] );
}
// fired on account page, just before updating profile
do_action('um_account_pre_update_profile', $changes, um_user('ID') );
$ultimatemember->user->update_profile( $changes );
// delete account
@@ -211,7 +214,6 @@
function um_account_tab__password( $info ) {
global $ultimatemember;
extract( $info );
extract( $info );
$output = $ultimatemember->account->get_tab_output('password');
@@ -235,7 +237,6 @@
function um_account_tab__notifications( $info ) {
global $ultimatemember;
extract( $info );
extract( $info );
$output = $ultimatemember->account->get_tab_output('notifications');
@@ -314,22 +315,9 @@
global $ultimatemember;
extract( $args );
$tabs[100]['general']['icon'] = 'um-faicon-user';
$tabs[100]['general']['title'] = __('Account','ultimatemember');
$ultimatemember->account->tabs = apply_filters('um_account_page_default_tabs_hook', $tabs=array() );
$tabs[200]['password']['icon'] = 'um-faicon-asterisk';
$tabs[200]['password']['title'] = __('Change Password','ultimatemember');
$tabs[300]['privacy']['icon'] = 'um-faicon-lock';
$tabs[300]['privacy']['title'] = __('Privacy','ultimatemember');
$tabs[400]['notifications']['icon'] = 'um-faicon-bell';
$tabs[400]['notifications']['title'] = __('Notifications','ultimatemember');
$tabs[500]['delete']['icon'] = 'um-faicon-trash-o';
$tabs[500]['delete']['title'] = __('Delete Account','ultimatemember');
$ultimatemember->account->tabs = apply_filters('um_account_page_default_tabs_hook', $tabs );
ksort( $ultimatemember->account->tabs );
?>
+28 -10
View File
@@ -93,7 +93,7 @@
$words = array_map("rtrim", explode("\n", $words));
foreach( $fields as $key => $array ) {
if ( isset( $args[$key] ) ) {
if ( isset( $args[$key] ) && !empty( $args[$key] ) ) {
if ( isset($array['validate']) && in_array( $array['validate'], array('unique_username','unique_email','unique_username_or_email') ) ) {
if ( preg_grep( "/".$args[$key]."/i" , $words ) ) {
$ultimatemember->form->add_error( $key, __('You are not allowed to use this word as your username.','ultimatemember') );
@@ -155,11 +155,17 @@
foreach( $fields as $key => $array ) {
if ( $key == 'role_select' || $key == 'role_radio' ) {
if ( isset($args['role']) && empty($args['role']) && isset( $array['required'] ) && $array['required'] == 1 ) {
$ultimatemember->form->add_error($key, __('Please specify account type.','ultimatemember') );
}
}
if ( isset( $args[$key] ) ) {
if ( isset( $array['required'] ) && $array['required'] == 1 ) {
if ( !isset($args[$key]) || $args[$key] == '' ) {
$ultimatemember->form->add_error($key, sprintf( __('%s is required','ultimatemember'), $array['label'] ) );
$ultimatemember->form->add_error($key, sprintf( __('%s is required','ultimatemember'), $array['label'] ) );
}
}
@@ -302,14 +308,26 @@
case 'unique_email':
if ( $args[$key] == '' ) {
$ultimatemember->form->add_error($key, __('You must provide your email','ultimatemember') );
} else if ( $mode == 'register' && email_exists( $args[$key] ) ) {
$ultimatemember->form->add_error($key, __('This email is already linked to an existing account','ultimatemember') );
} else if ( !is_email( $args[$key] ) ) {
$ultimatemember->form->add_error($key, __('This is not a valid email','ultimatemember') );
} else if ( !$ultimatemember->validation->safe_username( $args[$key] ) ) {
$ultimatemember->form->add_error($key, __('Your email contains invalid characters','ultimatemember') );
if ( in_array( $key, array('user_email') ) ) {
if ( $args[$key] == '' && in_array( $key, array('user_email') ) ) {
$ultimatemember->form->add_error($key, __('You must provide your email','ultimatemember') );
} else if ( $mode == 'register' && email_exists( $args[$key] ) ) {
$ultimatemember->form->add_error($key, __('This email is already linked to an existing account','ultimatemember') );
} else if ( !is_email( $args[$key] ) ) {
$ultimatemember->form->add_error($key, __('This is not a valid email','ultimatemember') );
} else if ( !$ultimatemember->validation->safe_username( $args[$key] ) ) {
$ultimatemember->form->add_error($key, __('Your email contains invalid characters','ultimatemember') );
}
} else {
if ( $args[$key] != '' && !is_email($args[$key]) ) {
$ultimatemember->form->add_error($key, __('This is not a valid email','ultimatemember') );
} else if ( $args[$key] != '' && email_exists( $args[$key] ) ) {
$ultimatemember->form->add_error($key, __('This email is already linked to an existing account','ultimatemember') );
}
}
break;
+3 -3
View File
@@ -13,15 +13,15 @@
$mode = $args['mode'];
if ( isset( $args['username'] ) && $args['username'] == '' ) {
$ultimatemember->form->add_error( 'username', __('Please enter your username or email') );
$ultimatemember->form->add_error( 'username', __('Please enter your username or email','ultimatemember') );
}
if ( isset( $args['user_login'] ) && $args['user_login'] == '' ) {
$ultimatemember->form->add_error( 'user_login', __('Please enter your username') );
$ultimatemember->form->add_error( 'user_login', __('Please enter your username','ultimatemember') );
}
if ( isset( $args['user_email'] ) && $args['user_email'] == '' ) {
$ultimatemember->form->add_error( 'user_email', __('Please enter your email') );
$ultimatemember->form->add_error( 'user_email', __('Please enter your email','ultimatemember') );
}
if ( isset( $args['username'] ) ) {
+1 -1
View File
@@ -54,7 +54,7 @@
***/
function um_block_wpadmin_by_user_role(){
global $ultimatemember;
if( is_admin() && !defined('DOING_AJAX') && um_user('ID') && !um_user('can_access_wpadmin')){
if( is_admin() && !defined('DOING_AJAX') && um_user('ID') && !um_user('can_access_wpadmin') && !is_super_admin( um_user('ID') ) ){
um_redirect_home();
}
}
+2 -2
View File
@@ -420,7 +420,7 @@ class UM_Fields {
} else {
if ( isset( $ultimatemember->form->post_form[$key] ) &&$value == $ultimatemember->form->post_form[$key] ) {
if ( isset( $ultimatemember->form->post_form[$key] ) && $value == $ultimatemember->form->post_form[$key] ) {
return true;
}
@@ -1387,7 +1387,7 @@ class UM_Fields {
}
$output .= '<option value="'.$option_value.'" ';
if ( $this->is_selected($key, $option_value, $data) ) {
if ( $this->is_selected($form_key, $option_value, $data) ) {
$output.= 'selected';
}
$output .= '>'.$v.'</option>';
+1 -1
View File
@@ -3,7 +3,7 @@
Plugin Name: Ultimate Member
Plugin URI: http://ultimatemember.com/
Description: Ultimate Member is a powerful community and membership plugin that allows you to create beautiful community and membership sites with WordPress
Version: 1.0.59
Version: 1.0.60
Author: Ultimate Member
Author URI: http://ultimatemember.com/
*/
+10 -1
View File
@@ -7,7 +7,7 @@ Tags: access control, author, authors, author profile, comments, community, comm
Requires at least: 4.1
Tested up to: 4.1
Stable Tag: 1.0.59
Stable Tag: 1.0.60
License: GNU Version 2 or Any Later Version
@@ -188,6 +188,15 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
== Changelog ==
= 1.0.60: February 18, 2015 =
* Tweak: added a protection to prevent wp-admin lockout for admin users
* Tweak: new hook for account page form submitting (for developers)
* Tweak: added a few missing translations
* Fixed: issue with roles dropdown not saving its state
* Fixed: issue with roles dropdown when made required in form
* Fixed: issue with tabbing on form fields
= 1.0.59: February 17, 2015 =
* New added Finnish language (fi_FI)
+3 -3
View File
@@ -23,13 +23,13 @@
do_action('um_before_form', $args);
foreach( $ultimatemember->account->tabs as $k => $arr ) {
foreach( $arr as $id => $info ) { extract( $info );
$current_tab = $ultimatemember->account->current_tab;
if ( um_get_option('account_tab_'.$id ) == 1 || $id == 'general' ) {
?>
<div class="um-account-nav uimob340-show uimob500-show"><a href="#" data-tab="<?php echo $id; ?>" class="<?php if ( $id == $current_tab ) echo 'current'; ?>"><?php echo $title; ?>