Version 1.0.49

This commit is contained in:
ultimatemember
2015-02-11 00:50:38 +02:00
parent b4f313e8bc
commit 23c30f6a39
17 changed files with 112 additions and 31 deletions
+4 -1
View File
@@ -39,12 +39,15 @@
$metabox = new UM_Admin_Metabox();
$fields_without_metakey = array('block','shortcode','spacing','divider','group');
$fields_without_metakey = apply_filters('um_fields_without_metakey', $fields_without_metakey );
$fields = $ultimatemember->query->get_attr('custom_fields', $form_id);
$count = 1;
if ( isset( $fields ) && !empty( $fields) ) $count = count($fields)+1;
// set unique meta key
if ( in_array( $field_type, array('block','shortcode','spacing','divider','group') ) && !isset($array['post']['_metakey']) ) {
if ( in_array( $field_type, $fields_without_metakey ) && !isset($array['post']['_metakey']) ) {
$array['post']['_metakey'] = "um_{$field_type}_{$form_id}_{$count}";
}
+1 -1
View File
@@ -457,7 +457,7 @@ class UM_Admin_Metabox {
default:
do_action("um_admin_field_edit_hook__{$attribute}", $attribute);
do_action("um_admin_field_edit_hook{$attribute}", $this->edit_mode_value);
break;
+5
View File
@@ -2,6 +2,11 @@
- Layout
*/
.um-account p.um-notice {
margin: 0 0 20px 0 !important;
padding: 12px 15px !important;
}
.um-account a:focus {
outline: 0 !important; /*removes the dotted border*/
}
+1
View File
@@ -440,6 +440,7 @@ p.um-notice.err {
margin: 0 0 0 36px;
line-height: 24px;
color: #888 !important;
display: inline-block;
}
/*
+1 -1
View File
File diff suppressed because one or more lines are too long
+7 -2
View File
@@ -24,8 +24,13 @@ class UM_Access {
do_action('um_access_post_settings');
if ( $this->redirect_handler && !$this->allow_access ) {
$curr = $ultimatemember->permalinks->get_current_url();
$this->redirect_handler = add_query_arg('redirect_to', $curr, $this->redirect_handler);
// login page add protected page automatically
if ( strstr( $this->redirect_handler, um_get_core_page('login') ) ){
$curr = $ultimatemember->permalinks->get_current_url();
$this->redirect_handler = add_query_arg('redirect_to', $curr, $this->redirect_handler);
}
exit( wp_redirect( $this->redirect_handler ) );
}
+7 -6
View File
@@ -29,18 +29,19 @@
$redirect = um_get_option('access_redirect');
$redirects[] = um_get_core_page('login');
$redirects[] = um_get_option('access_redirect');
$redirects[] = untrailingslashit( um_get_core_page('login') );
$redirects[] = untrailingslashit( um_get_option('access_redirect') );
$exclude_uris = um_get_option('access_exclude_uris');
if ( $exclude_uris ) {
$redirects = array_merge( $redirects, $exclude_uris );
}
$current_url = $ultimatemember->permalinks->get_current_url( get_option('permalink_structure') );
if ( isset( $post->ID ) && in_array( $current_url, $redirects ) ) {
$current_url = untrailingslashit( $current_url );
if ( ( isset( $post->ID ) || is_home() ) && in_array( $current_url, $redirects ) ) {
// allow
} else {
$ultimatemember->access->redirect_handler = $redirect;
+21 -13
View File
@@ -38,11 +38,15 @@
}
}
do_action('um_pre_account_update');
do_action('um_post_account_update');
$tab = ( get_query_var('um_tab') ) ? get_query_var('um_tab') : 'general';
exit( wp_redirect( $ultimatemember->account->tab_link( $tab ) ) );
$url = $ultimatemember->account->tab_link( $tab );
$url = add_query_arg('updated','account',$url);
exit( wp_redirect( $url ) );
}
@@ -78,21 +82,25 @@
} else { // correct password
if ( $_POST['user_password'] != $_POST['confirm_user_password'] && $_POST['user_password'] ) {
$ultimatemember->form->add_error('user_password', 'Your new password does not match');
$ultimatemember->form->add_error('user_password', __('Your new password does not match','ultimatemember') );
$ultimatemember->account->current_tab = 'password';
}
if ( strlen( utf8_decode( $_POST['user_password'] ) ) < 8 ) {
$ultimatemember->form->add_error('user_password', __('Your password must contain at least 8 characters') );
}
if ( strlen( utf8_decode( $_POST['user_password'] ) ) > 30 ) {
$ultimatemember->form->add_error('user_password', __('Your password must contain less than 30 characters') );
}
if ( um_get_option('account_require_strongpass') ) {
if ( strlen( utf8_decode( $_POST['user_password'] ) ) < 8 ) {
$ultimatemember->form->add_error('user_password', __('Your password must contain at least 8 characters','ultimatemember') );
}
if ( !$ultimatemember->validation->strong_pass( $_POST['user_password'] ) ) {
$ultimatemember->form->add_error('user_password', __('Your password must contain at least one lowercase letter, one capital letter and one number','ultimatemember') );
$ultimatemember->account->current_tab = 'password';
if ( strlen( utf8_decode( $_POST['user_password'] ) ) > 30 ) {
$ultimatemember->form->add_error('user_password', __('Your password must contain less than 30 characters','ultimatemember') );
}
if ( !$ultimatemember->validation->strong_pass( $_POST['user_password'] ) ) {
$ultimatemember->form->add_error('user_password', __('Your password must contain at least one lowercase letter, one capital letter and one number','ultimatemember') );
$ultimatemember->account->current_tab = 'password';
}
}
}
+4
View File
@@ -61,6 +61,10 @@
if ( isset( $_REQUEST['updated'] ) && !empty( $_REQUEST['updated'] ) && !$ultimatemember->form->errors ) {
switch( $_REQUEST['updated'] ) {
case 'account':
$success = __('Your account was updated successfully.','ultimatemember');
break;
case 'password_changed':
$success = __('You have successfully changed your password.','ultimatemember');
break;
+13 -3
View File
@@ -908,13 +908,17 @@ class UM_Builtin {
}
/***
*** @predefined + custom fields ( Global, not form wide )
*** @may be used to show a dropdown, or source for user meta
***/
function all_user_fields( $exclude_types = null ) {
global $ultimatemember;
$this->fields_dropdown = array('image','file','password','textarea','rating','block','shortcode','spacing','divider','group');
$fields_without_metakey = array('block','shortcode','spacing','divider','group');
$fields_without_metakey = apply_filters('um_fields_without_metakey', $fields_without_metakey );
$this->fields_dropdown = array('image','file','password','textarea','rating');
$this->fields_dropdown = array_merge( $this->fields_dropdown, $fields_without_metakey );
$custom = $this->custom_fields;
$predefined = $this->predefined_fields;
@@ -923,7 +927,7 @@ class UM_Builtin {
$exclude_types = explode(',', $exclude_types);
}
$all = array( '' => '' );
$all = array( 0 => '' );
if ( is_array( $custom ) ){
$all = $all + array_merge( $predefined, $custom );
@@ -933,6 +937,10 @@ class UM_Builtin {
foreach( $all as $k => $arr ) {
if ( $k == 0 ) {
unset($all[$k]);
}
if ( isset( $arr['title'] ) ){
$all[$k]['title'] = stripslashes( $arr['title'] );
}
@@ -949,6 +957,8 @@ class UM_Builtin {
}
$all = $ultimatemember->fields->array_sort_by_column( $all, 'title');
$all = array( 0 => '') + $all;
return $all;
}
+7
View File
@@ -21,6 +21,7 @@ class UM_Cron {
public function schedule_Events() {
$this->weekly_events();
$this->daily_events();
$this->hourly_events();
}
private function weekly_events() {
@@ -34,5 +35,11 @@ class UM_Cron {
wp_schedule_event( current_time( 'timestamp' ), 'daily', 'um_daily_scheduled_events' );
}
}
private function hourly_events() {
if ( ! wp_next_scheduled( 'um_hourly_scheduled_events' ) ) {
wp_schedule_event( current_time( 'timestamp' ), 'hourly', 'um_hourly_scheduled_events' );
}
}
}
+6
View File
@@ -842,6 +842,12 @@ class UM_Fields {
/* Begin by field type */
switch( $type ) {
/* Default: Integration */
default:
$mode = (isset($this->set_mode))?$this->set_mode:'no_mode';
$output .= apply_filters("um_edit_field_{$mode}_{$type}", $output, $data);
break;
/* Text */
case 'text':
+3 -1
View File
@@ -5,7 +5,9 @@ if ( ! class_exists( 'UM_Menu_Item_Custom_Fields' ) ) :
class UM_Menu_Item_Custom_Fields {
public static function load() {
add_filter( 'wp_edit_nav_menu_walker', array( __CLASS__, '_filter_walker' ), 200 );
if ( um_get_option('disable_menu') == 0 ) {
add_filter( 'wp_edit_nav_menu_walker', array( __CLASS__, '_filter_walker' ), 200 );
}
}
public static function _filter_walker( $walker ) {
+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.48
Version: 1.0.49
Author: Ultimate Member
Author URI: http://ultimatemember.com/
*/
+8 -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.48
Stable Tag: 1.0.49
License: GNU Version 2 or Any Later Version
@@ -186,6 +186,13 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
== Changelog ==
= 1.0.49: February 10, 2015 =
* New: added option to disable UM menu (fixes conflict with mega-menu on some themes/plugins)
* New: added option to disable strong password in Account / Password change tab
* New: added a notice to Account page when user updates account
* Fixed: issue with global access settings
= 1.0.48: February 10, 2015 =
* New: added translation downloader/updater in plugin dashboard
+2
View File
@@ -20,6 +20,8 @@
<?php
do_action('um_before_form', $args);
foreach( $ultimatemember->account->tabs as $k => $arr ) {
foreach( $arr as $id => $info ) { extract( $info );
+21 -1
View File
@@ -111,7 +111,7 @@ $this->sections[] = array(
'icon' => 'um-faicon-cog',
'title' => __( 'Account','ultimatemember'),
'fields' => array(
array(
'id' => 'account_tab_password',
'type' => 'switch',
@@ -164,6 +164,16 @@ $this->sections[] = array(
'textarea_rows' => 6
),
),
array(
'id' => 'account_require_strongpass',
'type' => 'switch',
'title' => __( 'Require a strong password?','ultimatemember' ),
'default' => 0,
'desc' => __('Enable or disable a strong password rules on account page / change password tab','ultimatemember'),
'on' => __('On','ultimatemember'),
'off' => __('Off','ultimatemember'),
),
)
@@ -1673,6 +1683,16 @@ $this->sections[] = array(
'off' => __('Off','ultimatemember'),
),
array(
'id' => 'disable_menu',
'type' => 'switch',
'title' => __( 'Disable Nav Menu Settings','ultimatemember' ),
'default' => 0,
'desc' => __('This can disable the settings that appear in nav menus to apply custom access settings to nav items.','ultimatemember'),
'on' => __('On','ultimatemember'),
'off' => __('Off','ultimatemember'),
),
array(
'id' => 'js_css_exclude',
'type' => 'multi_text',