mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Update 1.0.62
This commit is contained in:
@@ -10,7 +10,7 @@ class UM_Admin_Enqueue {
|
||||
|
||||
add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'), 9);
|
||||
|
||||
add_filter('admin_body_class', array(&$this, 'admin_body_class'), 9 );
|
||||
add_filter('admin_body_class', array(&$this, 'admin_body_class'), 999 );
|
||||
|
||||
add_filter('enter_title_here', array(&$this, 'enter_title_here') );
|
||||
|
||||
@@ -243,9 +243,10 @@ class UM_Admin_Enqueue {
|
||||
*** @Adds class to our admin pages
|
||||
***/
|
||||
function admin_body_class($classes){
|
||||
if ( $this->is_UM_admin() )
|
||||
$classes .= 'um-admin';
|
||||
return $classes;
|
||||
if ( $this->is_UM_admin() ) {
|
||||
return "$classes um-admin";
|
||||
}
|
||||
return $classes;
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
@@ -176,11 +176,14 @@ p.um-notice {
|
||||
}
|
||||
|
||||
p.um-notice i {
|
||||
position: absolute;
|
||||
right: 14px;
|
||||
top: 1px;
|
||||
font-size: 30px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 14px;
|
||||
font-size: 36px;
|
||||
cursor: pointer;
|
||||
top: 7px;
|
||||
display: block;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
p.um-notice.success {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,6 +1,15 @@
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
jQuery('.um-profile.um-viewing .um-profile-body .um-row').each(function(){
|
||||
var this_row = jQuery(this);
|
||||
if ( this_row.find('.um-field').length == 0 ) {
|
||||
this_row.prev('.um-row-heading').remove();
|
||||
this_row.remove();
|
||||
}
|
||||
});
|
||||
|
||||
if ( jQuery('.um-profile.um-viewing .um-profile-body').length && jQuery('.um-profile.um-viewing .um-profile-body').find('.um-field').length == 0 ) {
|
||||
jQuery('.um-row-heading,.um-row').remove();
|
||||
jQuery('.um-profile-note').show();
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -144,49 +144,73 @@ class UM_Account {
|
||||
switch( $id ) {
|
||||
|
||||
case 'notifications':
|
||||
|
||||
$output = apply_filters("um_account_content_hook_{$id}", $output);
|
||||
return $output;
|
||||
|
||||
break;
|
||||
|
||||
case 'privacy':
|
||||
|
||||
$args = 'profile_privacy,hide_in_members';
|
||||
|
||||
$fields = $ultimatemember->builtin->get_specific_fields( $args );
|
||||
foreach( $fields as $key => $data ){
|
||||
$output .= $ultimatemember->fields->edit_field( $key, $data );
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
$args = 'single_user_password';
|
||||
|
||||
$fields = $ultimatemember->builtin->get_specific_fields( $args );
|
||||
foreach( $fields as $key => $data ){
|
||||
$output .= $ultimatemember->fields->edit_field( $key, $data );
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
break;
|
||||
|
||||
case 'general':
|
||||
|
||||
$args = 'user_login,first_name,last_name,user_email';
|
||||
|
||||
if ( !um_get_option('account_name') ) {
|
||||
$args = 'user_login,user_email';
|
||||
}
|
||||
|
||||
$fields = $ultimatemember->builtin->get_specific_fields( $args );
|
||||
foreach( $fields as $key => $data ){
|
||||
$output .= $ultimatemember->fields->edit_field( $key, $data );
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
break;
|
||||
|
||||
case 'password':
|
||||
|
||||
$args = 'user_password';
|
||||
|
||||
$fields = $ultimatemember->builtin->get_specific_fields( $args );
|
||||
foreach( $fields as $key => $data ){
|
||||
$output .= $ultimatemember->fields->edit_field( $key, $data );
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
||||
break;
|
||||
|
||||
default :
|
||||
|
||||
$output = apply_filters("um_account_content_hook_{$id}", $output);
|
||||
return $output;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -118,9 +118,10 @@
|
||||
if ( !$access_redirect ) $access_redirect = um_get_core_page('login');
|
||||
$redirect_to = $access_redirect;
|
||||
}
|
||||
|
||||
|
||||
if ( is_user_logged_in() && isset( $access_roles ) && !empty( $access_roles ) ){
|
||||
if ( !in_array( um_user('role'), unserialize( $access_roles ) ) ) {
|
||||
if ( !$access_redirect ) $access_redirect = um_get_core_page('login');
|
||||
$redirect_to = $access_redirect;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,19 +60,19 @@
|
||||
function um_submit_account_errors_hook( $args ) {
|
||||
global $ultimatemember;
|
||||
|
||||
if ( strlen(trim( $_POST['first_name'] ) ) == 0 ) {
|
||||
if ( isset($_POST['first_name']) && strlen(trim( $_POST['first_name'] ) ) == 0 ) {
|
||||
$ultimatemember->form->add_error('first_name', __('You must provide your first name','ultimatemember') );
|
||||
}
|
||||
|
||||
if ( strlen(trim( $_POST['last_name'] ) ) == 0 ) {
|
||||
if ( isset($_POST['last_name']) && strlen(trim( $_POST['last_name'] ) ) == 0 ) {
|
||||
$ultimatemember->form->add_error('last_name', __('You must provide your last name','ultimatemember') );
|
||||
}
|
||||
|
||||
if ( strlen(trim( $_POST['user_email'] ) ) == 0 ) {
|
||||
if ( isset($_POST['user_email']) && strlen(trim( $_POST['user_email'] ) ) == 0 ) {
|
||||
$ultimatemember->form->add_error('user_email', __('You must provide your e-mail','ultimatemember') );
|
||||
}
|
||||
|
||||
if ( !is_email( $_POST['user_email'] ) ) {
|
||||
if ( isset($_POST['user_email']) && !is_email( $_POST['user_email'] ) ) {
|
||||
$ultimatemember->form->add_error('user_email', __('Please provide a valid e-mail','ultimatemember') );
|
||||
}
|
||||
|
||||
|
||||
@@ -530,12 +530,17 @@
|
||||
function um_profile_navbar( $args ) {
|
||||
global $ultimatemember;
|
||||
|
||||
if ( !um_get_option('profile_menu') )
|
||||
return;
|
||||
|
||||
// get active tabs
|
||||
$tabs = $ultimatemember->profile->tabs_active();
|
||||
|
||||
$tabs = apply_filters('um_user_profile_tabs', $tabs );
|
||||
|
||||
$ultimatemember->user->tabs = $tabs;
|
||||
|
||||
// need enough tabs to continue
|
||||
if ( count( $tabs ) <= 1 ) return;
|
||||
|
||||
$active_tab = $ultimatemember->profile->active_tab();
|
||||
|
||||
+49
-6
@@ -772,7 +772,7 @@ class UM_Fields {
|
||||
$array['allowed_types'] = implode(',',$array['allowed_types']);
|
||||
}
|
||||
if (!isset($array['upload_text'])) $array['upload_text'] = '';
|
||||
if (!isset($array['button_text'])) $array['button_text'] = __('Upload');
|
||||
if (!isset($array['button_text'])) $array['button_text'] = __('Upload','ultimatemember');
|
||||
if (!isset($array['extension_error'])) $array['extension_error'] = "Sorry this is not a valid image.";
|
||||
if (!isset($array['max_size_error'])) $array['max_size_error'] = "This image is too large!";
|
||||
if (!isset($array['min_size_error'])) $array['min_size_error'] = "This image is too small!";
|
||||
@@ -793,7 +793,7 @@ class UM_Fields {
|
||||
$array['allowed_types'] = implode(',',$array['allowed_types']);
|
||||
}
|
||||
if (!isset($array['upload_text'])) $array['upload_text'] = '';
|
||||
if (!isset($array['button_text'])) $array['button_text'] = __('Upload');
|
||||
if (!isset($array['button_text'])) $array['button_text'] = __('Upload','ultimatemember');
|
||||
if (!isset($array['extension_error'])) $array['extension_error'] = "Sorry this is not a valid file.";
|
||||
if (!isset($array['max_size_error'])) $array['max_size_error'] = "This file is too large!";
|
||||
if (!isset($array['min_size_error'])) $array['min_size_error'] = "This file is too small!";
|
||||
@@ -1202,9 +1202,17 @@ class UM_Fields {
|
||||
|
||||
if ( $this->field_value( $key, $default, $data ) ) {
|
||||
|
||||
$uri = um_user_uploads_uri() . $this->field_value( $key, $default, $data );
|
||||
|
||||
if ( isset( $ultimatemember->form->errors ) && !empty( $ultimatemember->form->errors ) ) {
|
||||
if ( isset( $this->set_mode ) && $this->set_mode == 'register' ) {
|
||||
$uri = $this->field_value( $key, $default, $data );
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '<div class="um-single-image-preview show '. $crop_class .'" data-crop="'.$crop_data.'" data-key="'.$key.'">
|
||||
<a href="#" class="cancel"><i class="um-icon-close"></i></a>
|
||||
<img src="' . um_user_uploads_uri() . $this->field_value( $key, $default, $data ) . '" alt="" />
|
||||
<img src="' . $uri . '" alt="" />
|
||||
</div><a href="#" data-modal="um_upload_single" data-modal-size="'.$modal_size.'" data-modal-copy="1" class="um-button um-btn-auto-width">'. __('Change photo') . '</a>';
|
||||
|
||||
} else {
|
||||
@@ -1372,6 +1380,22 @@ class UM_Fields {
|
||||
$options = $ultimatemember->builtin->get ( 'countries' );
|
||||
}
|
||||
|
||||
// role field
|
||||
if ( $form_key == 'role' ) {
|
||||
|
||||
global $wpdb;
|
||||
foreach($options as $key => $val ) {
|
||||
$val = (string) $val;
|
||||
$val = trim( $val );
|
||||
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'um_role' AND post_title = '$val'");
|
||||
$_role = get_post($post_id);
|
||||
$new_roles[$_role->post_name] = $_role->post_title;
|
||||
wp_reset_postdata();
|
||||
}
|
||||
|
||||
$options = $new_roles;
|
||||
}
|
||||
|
||||
// add an empty option!
|
||||
$output .= '<option value=""></option>';
|
||||
|
||||
@@ -1470,7 +1494,23 @@ class UM_Fields {
|
||||
}
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
|
||||
// role field
|
||||
if ( $form_key == 'role' ) {
|
||||
|
||||
global $wpdb;
|
||||
foreach($options as $key => $val ) {
|
||||
$val = (string) $val;
|
||||
$val = trim( $val );
|
||||
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'um_role' AND post_title = '$val'");
|
||||
$_role = get_post($post_id);
|
||||
$new_roles[$_role->post_name] = $_role->post_title;
|
||||
wp_reset_postdata();
|
||||
}
|
||||
|
||||
$options = $new_roles;
|
||||
}
|
||||
|
||||
// add options
|
||||
$i = 0;
|
||||
|
||||
@@ -2137,7 +2177,10 @@ class UM_Fields {
|
||||
|
||||
// show the heading
|
||||
if ( $heading ) {
|
||||
|
||||
|
||||
$heading_background_color = (isset($heading_background_color))?$heading_background_color:'';
|
||||
$heading_text_color = (isset($heading_text_color))?$heading_text_color:'';
|
||||
|
||||
if ( $heading_background_color ) {
|
||||
$css_heading_background_color = 'background-color: ' . $heading_background_color .';';
|
||||
$css_heading_padding = 'padding: 10px 15px;';
|
||||
@@ -2147,7 +2190,7 @@ class UM_Fields {
|
||||
if ( $borderradius ) $css_heading_borderradius = 'border-radius: ' . $borderradius . ' ' . $borderradius . ' 0px 0px;';
|
||||
|
||||
$output .= '<div class="um-row-heading" style="' . $css_heading_background_color . $css_heading_padding . $css_heading_text_color . $css_heading_borderradius . '">';
|
||||
if ( $icon ) $output .= '<span class="um-row-heading-icon"><i class="' . $icon . '"></i></span>';
|
||||
if ( isset($icon) ) $output .= '<span class="um-row-heading-icon"><i class="' . $icon . '"></i></span>';
|
||||
$output .= $heading_text .'</div>';
|
||||
|
||||
} else {
|
||||
|
||||
@@ -399,6 +399,14 @@ class UM_Setup {
|
||||
|
||||
}
|
||||
|
||||
if ( !get_option('um_hashed_passwords_fix') ) {
|
||||
update_option('um_hashed_passwords_fix', 1);
|
||||
$users = get_users( array('fields' => 'ID') );
|
||||
foreach( $users as $id ) {
|
||||
delete_user_meta( $id, '_um_cool_but_hard_to_guess_plain_pw' );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
+28
-19
@@ -196,30 +196,39 @@ class UM_Shortcodes {
|
||||
function get_templates( $excluded = null ) {
|
||||
|
||||
if ($excluded) {
|
||||
$array[$excluded] = 'Default Template';
|
||||
$array[$excluded] = __('Default Template','ultimatemember');
|
||||
}
|
||||
|
||||
$files = glob( um_path . 'templates/' . '*.php');
|
||||
foreach($files as $file){
|
||||
$paths[] = glob( um_path . 'templates/' . '*.php');
|
||||
|
||||
$clean_filename = $this->get_template_name($file);
|
||||
if ( file_exists( get_stylesheet_directory() . '/ultimate-member/templates/' ) ) {
|
||||
$paths[] = glob( get_stylesheet_directory() . '/ultimate-member/templates/' . '*.php');
|
||||
}
|
||||
|
||||
foreach($paths as $k => $files){
|
||||
|
||||
if (0 === strpos($clean_filename, $excluded)) {
|
||||
|
||||
$source = file_get_contents( $file );
|
||||
$tokens = token_get_all( $source );
|
||||
$comment = array(
|
||||
T_COMMENT, // All comments since PHP5
|
||||
T_DOC_COMMENT // PHPDoc comments
|
||||
);
|
||||
foreach( $tokens as $token ) {
|
||||
if( in_array($token[0], $comment) && $clean_filename != $excluded ) {
|
||||
$txt = $token[1];
|
||||
$txt = str_replace('/* Template: ','',$txt);
|
||||
$txt = str_replace(' */','',$txt);
|
||||
$array[ $clean_filename ] = $txt;
|
||||
foreach( $files as $file ) {
|
||||
|
||||
$clean_filename = $this->get_template_name($file);
|
||||
|
||||
if (0 === strpos($clean_filename, $excluded)) {
|
||||
|
||||
$source = file_get_contents( $file );
|
||||
$tokens = token_get_all( $source );
|
||||
$comment = array(
|
||||
T_COMMENT, // All comments since PHP5
|
||||
T_DOC_COMMENT // PHPDoc comments
|
||||
);
|
||||
foreach( $tokens as $token ) {
|
||||
if( in_array($token[0], $comment) && $clean_filename != $excluded ) {
|
||||
$txt = $token[1];
|
||||
$txt = str_replace('/* Template: ','',$txt);
|
||||
$txt = str_replace(' */','',$txt);
|
||||
$array[ $clean_filename ] = $txt;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -265,9 +265,10 @@ class UM_User {
|
||||
}
|
||||
|
||||
$this->set_status('approved');
|
||||
$this->delete_meta('account_secret_hash');
|
||||
|
||||
$ultimatemember->mail->send( um_user('user_email'), $email_tpl );
|
||||
|
||||
$this->delete_meta('account_secret_hash');
|
||||
$this->delete_meta('_um_cool_but_hard_to_guess_plain_pw');
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
@@ -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.60
|
||||
Version: 1.0.62
|
||||
Author: Ultimate Member
|
||||
Author URI: http://ultimatemember.com/
|
||||
*/
|
||||
|
||||
+21
-3
@@ -5,9 +5,9 @@ Contributors: ultimatemember
|
||||
Donate link:
|
||||
Tags: access control, author, authors, author profile, comments, community, communities, conditional fields, conditional logic, conditional menus, content protection, custom fields, file uploads, form builder, front-end login, front-end registration, hide wp-admin, login, login page, logged-in users, mandrill, member, members, membership, member directory, profile, profiles, profile builder, registration, restriction, restrict content, role creation, role menus, search filters, sign in, sign up, social network, star ratings, toolbar, user, users, user fields, user profiles, user roles
|
||||
Requires at least: 4.1
|
||||
Tested up to: 4.1
|
||||
Tested up to: 4.1.1
|
||||
|
||||
Stable Tag: 1.0.60
|
||||
Stable Tag: 1.0.62
|
||||
|
||||
License: GNU Version 2 or Any Later Version
|
||||
|
||||
@@ -128,7 +128,8 @@ Ultimate Member has been translated into the following languages:
|
||||
* Italiano
|
||||
* Deutsch
|
||||
* Nederlands
|
||||
* Finnish
|
||||
* Suomi
|
||||
* Polski
|
||||
* Türkçe
|
||||
|
||||
== Installation ==
|
||||
@@ -188,6 +189,23 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.0.62: February 20, 2015 =
|
||||
|
||||
* New: added Polish (Polski) language
|
||||
* New: added option to disable Name fields from Account page
|
||||
* New: added support for custom profile templates selectable from template dropdown
|
||||
* Tweak: remove rows with no fields from profile view
|
||||
* Tweak: remove empty rows/row headings from profile
|
||||
* Fixed: removed plain password user meta key from all users
|
||||
* Fixed: issue with image upload when form has errors
|
||||
* Fixed: resolved issue with disabling profile menu / tabs
|
||||
|
||||
= 1.0.61: February 20, 2015 =
|
||||
|
||||
* Tweak: Upload button text is made translatable
|
||||
* Fixed: conflicts with Divi theme
|
||||
* Fixed: issue with Roles dropdown field
|
||||
|
||||
= 1.0.60: February 18, 2015 =
|
||||
|
||||
* Tweak: added a protection to prevent wp-admin lockout for admin users
|
||||
|
||||
@@ -165,6 +165,16 @@ $this->sections[] = array(
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'account_name',
|
||||
'type' => 'switch',
|
||||
'title' => __( 'Add a First & Last Name fields','ultimatemember' ),
|
||||
'default' => 1,
|
||||
'desc' => __('Whether to enable these fields on the user account page by default or hide them.','ultimatemember'),
|
||||
'on' => __('On','ultimatemember'),
|
||||
'off' => __('Off','ultimatemember'),
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'account_require_strongpass',
|
||||
'type' => 'switch',
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@ class UM_API {
|
||||
'it_IT' => 'Italiano',
|
||||
'de_DE' => 'Deutsch',
|
||||
'nl_NL' => 'Nederlands',
|
||||
'fi_FI' => 'Finnish',
|
||||
'fi_FI' => 'Suomi',
|
||||
'pl_PL' => 'Polski',
|
||||
'tr_TR' => 'Türkçe',
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user