Update 1.1.6

This commit is contained in:
ultimatemember
2015-04-07 20:10:23 +02:00
parent 89722448cb
commit 5e281fbeaf
69 changed files with 820 additions and 222 deletions
+3 -12
View File
@@ -11,10 +11,7 @@ class UM_ADDON_bp_avatar_transfer {
add_action('um_admin_addon_hook', array(&$this, 'um_admin_addon_hook') );
}
/***
*** @extends the admin menu
***/
function admin_menu() {
global $ultimatemember;
@@ -22,10 +19,7 @@ class UM_ADDON_bp_avatar_transfer {
add_submenu_page('ultimatemember', $this->addon[0], $this->addon[0], 'manage_options', 'bp_avatar_transfer', array(&$this, 'content') );
}
/***
*** @Runs a custom hook
***/
function um_admin_addon_hook( $hook ) {
global $ultimatemember;
switch( $hook ) {
@@ -63,10 +57,7 @@ class UM_ADDON_bp_avatar_transfer {
break;
}
}
/***
*** @Change admin content
***/
function admin_init() {
if ( isset( $_REQUEST['um-addon-hook'] ) ) {
$hook = $_REQUEST['um-addon-hook'];
+164
View File
@@ -0,0 +1,164 @@
<?php
class UM_ADDON_multi_language {
function __construct() {
add_action('admin_menu', array(&$this, 'admin_menu'), 1001);
add_action('admin_init', array(&$this, 'admin_init'), 1);
add_filter('locale', array(&$this, 'locale'), 10 );
add_filter('um_pre_args_setup', array(&$this, 'um_pre_args_setup'), 99 );
add_action('um_after_form_fields', array(&$this, 'um_after_form_fields'), 1);
add_action('um_after_everything_output', array(&$this, 'um_after_everything_output'), 1);
}
function um_after_form_fields( $args ) {
if ( !isset( $args['locale'] ) ) return; ?>
<input type="hidden" name="lang" id="lang" value="<?php echo $args['locale']; ?>" />
<?php
}
function um_after_everything_output() {
remove_filter('locale', array(&$this, 'locale'), 10 );
}
function locale( $locale ) {
if ( isset($_GET['lang']) && !empty($_GET['lang']) ) {
$locale = $_GET['lang'];
} else {
$browser_loc = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$browser_loc = explode(',', $browser_loc);
$locale = $browser_loc[0];
$locale = str_replace( '-', '_', $locale );
}
return $locale;
}
function um_pre_args_setup( $args ) {
$assigned = get_option('um_multi_language');
$locale = get_locale();
$mode = ( isset( $args['mode'] ) ) ? $args['mode'] : 'undefined';
if ( isset( $assigned[$mode][$locale] ) ) {
$args['locale'] = $locale;
$args['form_id'] = $assigned[$mode][$locale];
}
return $args;
}
function admin_menu() {
global $ultimatemember;
$this->addon = $ultimatemember->addons['multi_language'];
add_submenu_page('ultimatemember', $this->addon[0], $this->addon[0], 'manage_options', 'multi_language', array(&$this, 'content') );
}
function admin_init() {
if ( isset( $_POST['multi-language'] ) && current_user_can('manage_options') ) {
$sync = '';
$lang = $_POST['lang'];
$form = $_POST['form'];
$array = array('register','login','profile');
foreach( $array as $arrays ) {
foreach( $lang[$arrays] as $k => $v ) {
if ( $v ) {
$sync[$arrays][$v] = $form[$arrays][$k];
}
}
}
if ( isset( $sync ) ) {
update_option('um_multi_language', $sync );
}
}
}
function content() {
global $ultimatemember;
$this->process_link = add_query_arg('um-addon-hook','multi_language');
$sync = get_option('um_multi_language');
?>
<div class="wrap">
<h2>Ultimate Member <sup style="font-size:15px"><?php echo ultimatemember_version; ?></sup></h2>
<h3><?php echo $this->addon[0]; ?></h3>
<form method="post" action="">
<p><?php _e('To make a form appear in a specific language, enter the locale then select a form to assign to. Clear the locale and save changes to delete an assigned translation.','ultimatemember'); ?></p>
<?php $array = array(
'register' => __('Register Forms','ultimatemember'),
'login' => __('Login Forms','ultimatemember'),
'profile' => __('Profile Forms','ultimatemember')
); ?>
<?php foreach( $array as $slug => $label ) { ?>
<h2><?php echo $label; ?></h2>
<table class="form-table">
<?php if ( isset( $sync[$slug] ) && !empty( $sync[$slug] ) ) { ?>
<?php foreach( $sync[$slug] as $locale => $form_id ) { ?>
<tr>
<th scope="row"><input name="lang[<?php echo $slug; ?>][]" type="text" id="lang" value="<?php echo $locale; ?>" class="regular-text" /></th>
<td>
<select name="form[<?php echo $slug; ?>][]" id="form">
<?php foreach( $ultimatemember->query->forms() as $id => $title ) { ?>
<option value="<?php echo $id; ?>" <?php selected( $id, $form_id ); ?> ><?php echo $title; ?></option>
<?php } ?>
</select>
</td>
</tr>
<?php } ?>
<?php } ?>
<tr>
<th scope="row"><input name="lang[<?php echo $slug; ?>][]" type="text" id="lang" value="" class="regular-text" /></th>
<td>
<select name="form[<?php echo $slug; ?>][]" id="form">
<?php foreach( $ultimatemember->query->forms() as $id => $title ) { ?>
<option value="<?php echo $id; ?>"><?php echo $title; ?></option>
<?php } ?>
</select>
</td>
</tr>
</table>
<?php } ?>
<p class="submit"><input type="submit" name="multi-language" id="multi-language" class="button button-primary" value="<?php _e('Save Changes','ultimatemember'); ?>" /></p>
</form>
</div><div class="clear"></div>
<?php
}
}
$UM_ADDON_multi_language = new UM_ADDON_multi_language();
+2 -4
View File
@@ -54,16 +54,14 @@
.um-admin-txtspace {margin: 0 0 0 10px;}
.um-adm-ico {
font-size: 20px;
width: 20px;
font-size: 18px;
width: 18px;
text-align: center;
margin-top: 5px;
display: inline-block;
color: #7ACF58;
}
.um-adm-ico.inactive {color: #C74A4A}
.um-adm-ico.pointer {cursor: pointer}
.um-admin-icontext i {
+44
View File
@@ -0,0 +1,44 @@
.um-admin-yesno span.yes, .um-admin-yesno span.no {
padding: 0 10px 0 0;
}
.um-admin-drag-ctrls-demo.um-admin-drag-ctrls {
left: 12px;
right: auto;
}
.um-admin-drag-row-icons {
left: 0;
right: auto;
}
.um-admin-drag-ctrls.columns {
right: 0 !important;
left: auto;
}
.um-admin-drag-ctrls.columns a {
float: right;
}
.um-admin-drag-rowsub-icons {
right: auto;
left: 0;
}
.um-admin-drag-row-icons a {
float: right;
}
.um-admin-drag-fld-icons a {
float: right;
}
.um-admin-drag-fld-icons {
float: left;
}
.um-admin-drag-fld-title, .um-admin-drag-fld-type {
float: right;
margin: 0 20px 0 0;
}
+2
View File
@@ -90,6 +90,8 @@ class UM_Admin_Access {
function add_metabox_form() {
global $ultimatemember;
if ( um_get_option('access_widget_admin_only') && !current_user_can( 'edit_users' ) ) return;
$types = $ultimatemember->query->get_post_types;
foreach($types as $post_type) {
+2 -2
View File
@@ -6,7 +6,7 @@
add_action('um_admin_do_action__delete_users', 'um_admin_do_action__delete_users');
function um_admin_do_action__delete_users( $action ){
global $ultimatemember;
if ( !is_admin() || !current_user_can('manage_options') ) die();
if ( !is_admin() || !current_user_can( 'edit_users' ) ) die();
$redirect = admin_url('users.php');
@@ -219,7 +219,7 @@
add_action('um_admin_do_action__user_action', 'um_admin_do_action__user_action');
function um_admin_do_action__user_action( $action ){
global $ultimatemember;
if ( !is_admin() || !current_user_can('manage_options') ) die();
if ( !is_admin() || !current_user_can( 'edit_users' ) ) die();
if ( !isset( $_REQUEST['sub'] ) ) die();
if ( !isset($_REQUEST['user_id']) ) die();
+7
View File
@@ -68,6 +68,8 @@ class UM_Admin_Dashboard {
add_meta_box('um-metaboxes-contentbox-1', __('Users Overview','ultimatemember'), array(&$this, 'users_overview'), $this->pagehook, 'core', 'core');
add_meta_box('um-metaboxes-mainbox-1', __('Latest from our blog','ultimatemember'), array(&$this, 'um_news'), $this->pagehook, 'normal', 'core');
add_meta_box('um-metaboxes-sidebox-1', __('Purge Temp Files','ultimatemember'), array(&$this, 'purge_temp'), $this->pagehook, 'side', 'core');
if ( $this->language_avaialable_not_installed() ) {
@@ -98,6 +100,11 @@ class UM_Admin_Dashboard {
include_once um_path . 'admin/templates/dashboard/language-contrib.php';
}
function um_news() {
global $ultimatemember;
include_once um_path . 'admin/templates/dashboard/feed.php';
}
function users_overview() {
global $ultimatemember;
include_once um_path . 'admin/templates/dashboard/users.php';
+5
View File
@@ -271,6 +271,11 @@ class UM_Admin_Enqueue {
$this->load_core_wp();
$this->load_ajax_js();
$this->load_custom_scripts();
if ( is_rtl() ) {
wp_register_style('um_admin_rtl', um_url . 'admin/assets/css/um-admin-rtl.css' );
wp_enqueue_style('um_admin_rtl');
}
}
+3 -6
View File
@@ -32,19 +32,16 @@ class UM_Admin_Users {
$user_id = $user_object->ID;
um_fetch_user( $user_id );
$actions = array();
unset( $actions['edit'] );
unset( $actions['delete'] );
$actions['backend_profile'] = "<a class='' href='" . admin_url('user-edit.php?user_id='. $user_id ) . "'>" . __( 'Edit','ultimatemember' ) . "</a>";
$actions['frontend_profile'] = "<a class='' href='" . um_user_profile_url() . "'>" . __( 'Edit in frontend','ultimatemember') . "</a>";
if ( um_user('submitted') ) {
$actions['view_info'] = '<a href="#" data-modal="UM_preview_registration" data-modal-size="smaller" data-dynamic-content="um_admin_review_registration" data-arg1="'.$user_id.'" data-arg2="edit_registration">' . __('Info','ultimatemember') . '</a>';
$actions['view_info'] = '<a href="#" data-modal="UM_preview_registration" data-modal-size="smaller" data-dynamic-content="um_admin_review_registration" data-arg1="'.$user_id.'" data-arg2="edit_registration">' . __('Info','ultimatemember') . '</a>';
}
return $actions;
}
/***
+18
View File
@@ -0,0 +1,18 @@
<?php
echo '<div class="rss-widget">';
wp_widget_rss_output(array(
'url' => 'https://ultimatemember.com/blog/feed/',
'title' => 'Latest From Ultimate Member',
'items' => 4,
'show_summary' => 0,
'show_author' => 0,
'show_date' => 1,
));
echo "</div>";
echo "<style type='text/css'>#um-metaboxes-mainbox-1 a.rsswidget {font-weight: 400}#um-metaboxes-mainbox-1 .rss-widget span.rss-date{ color: #777; margin-left: 12px;}</style>";
?>
+1
View File
@@ -58,6 +58,7 @@
<option value="last_name" <?php selected('last_name', $ultimatemember->query->get_meta_value('_um_sortby') ); ?>>Last Name</option>
<option value="random" <?php selected('random', $ultimatemember->query->get_meta_value('_um_sortby') ); ?>>Random</option>
<option value="other" <?php selected('other', $ultimatemember->query->get_meta_value('_um_sortby') ); ?>>Other (custom field)</option>
<?php do_action('um_admin_directory_sort_users_select', '_um_sortby'); ?>
</select>
</span>
+6 -2
View File
@@ -29,6 +29,10 @@
<?php
$custom_search = apply_filters('um_admin_custom_search_filters', array() );
$searchable_fields = $ultimatemember->builtin->all_user_fields('date,time,url');
$searchable_fields = $searchable_fields + $custom_search;
$meta_test = get_post_meta( get_the_ID(), '_um_search_fields', true );
$i = 0;
if ( is_array( $meta_test ) ) {
@@ -38,7 +42,7 @@
<span class="um-admin-field">
<select name="_um_search_fields[]" id="_um_search_fields" class="umaf-selectjs" style="width: 300px" data-placeholder="Choose a field">
<?php foreach($ultimatemember->builtin->all_user_fields('date,time,url') as $key => $arr) { ?>
<?php foreach( $searchable_fields as $key => $arr) { ?>
<option value="<?php echo $key; ?>" <?php selected($key, $val ); ?>><?php echo isset( $arr['title'] ) ? $arr['title'] : ''; ?></option>
<?php } ?>
</select>
@@ -59,7 +63,7 @@
<span class="um-admin-field">
<select name="_um_search_fields[]" id="_um_search_fields" class="umaf-selectjs" style="width: 300px" data-placeholder="Choose a field">
<?php foreach($ultimatemember->builtin->all_user_fields('date,time,url') as $key => $arr) { ?>
<?php foreach( $searchable_fields as $key => $arr) { ?>
<option value="<?php echo $key; ?>" <?php selected($key, $ultimatemember->query->get_meta_value('_um_search_fields', $key) ); ?>><?php echo isset( $arr['title'] ) ? $arr['title'] : ''; ?></option>
<?php } ?>
</select>
+23 -2
View File
@@ -1,10 +1,24 @@
<?php
$premium['real-time-notifications'] = array(
'url' => 'https://ultimatemember.com/extensions/real-time-notifications/',
'image' => 'https://ultimatemember.com/wp-content/uploads/2015/04/notifications-01-copy.png',
'name' => 'Real-time Notifications',
'desc' => 'Add a real-time notification system to your site so users can receive updates and notifications directly on your website as they happen.',
);
$premium['user-reviews'] = array(
'url' => 'https://ultimatemember.com/extensions/user-reviews/',
'image' => 'https://ultimatemember.com/wp-content/uploads/2015/03/userrating800x300.png',
'name' => 'User Reviews',
'desc' => 'With our user reviews extension, you can add a 5 star user rating and review system to your site so users can rate/review each other.',
);
$premium['social-login'] = array(
'url' => 'https://ultimatemember.com/extensions/social-login/',
'image' => 'https://ultimatemember.com/wp-content/uploads/2015/02/sociallogin.png',
'image' => 'https://ultimatemember.com/wp-content/uploads/2015/02/socialloginv2-011.png',
'name' => 'Social Login',
'desc' => 'This extension allows users to register and login to your site using their social network accounts (Facebook, Twitter, Google+, LinkedIn)',
'desc' => 'This extension allows users to register and login to your site using their social network accounts (Facebook, Twitter, Google+, LinkedIn, Instagram, VK)',
);
$premium['bbpress'] = array(
@@ -35,6 +49,13 @@
'desc' => 'Alert users to important information or let them know about promotions or new features using conditional notices.',
);
/*$free['online-users'] = array(
'url' => 'https://ultimatemember.com/extensions/online-users/',
'image' => 'https://ultimatemember.com/wp-content/uploads/2015/04/onlineuser1-01-copy.png',
'name' => 'Online Users',
'desc' => 'Adds online users widget to your site and allow you to show the online users anywhere with a simple shortcode, and also see user online status.'
);*/
$free['google-recaptcha'] = array(
'url' => 'https://ultimatemember.com/extensions/google-recaptcha/',
'image' => 'https://ultimatemember.com/wp-content/uploads/2015/02/recaptcha-01-copy.png',
+11
View File
@@ -48,6 +48,7 @@
<!-- Email Approval Settings -->
<div class="checkmail">
<p>
<label class="um-admin-half"><?php _e('Action to be taken after registration','ultimatemember'); ?> <?php $this->tooltip( __('Select what action is taken after a person registers on your site. Depending on the status you can redirect them to their profile, a custom url or show a custom message','ultimatemember') ); ?></label>
<span class="um-admin-half">
@@ -79,6 +80,16 @@
</span>
</p><div class="um-admin-clear"></div>
<p>
<label class="um-admin-half" for="_um_url_email_activate"><?php _e('URL redirect after e-mail activation','ultimatemember'); ?> <?php $this->tooltip( __('If you want users to go to a specific page other than login page after e-mail activation, enter the URL here.','ultimatemember') ); ?></label>
<span class="um-admin-half">
<input type="text" value="<?php echo $ultimatemember->query->get_meta_value('_um_url_email_activate', null, 'na'); ?>" name="_um_url_email_activate" id="_um_url_email_activate" />
</span>
</p><div class="um-admin-clear"></div>
</div>
<!-- Email Approval Settings -->
+2 -8
View File
@@ -85,8 +85,6 @@
line-height: 2em;
}
.um-account-name a:hover {color: #3ba1da}
/*
- Account nav
*/
@@ -105,7 +103,6 @@
}
.um-account-nav a.current{
color: #3ba1da;
font-weight: bold;
}
@@ -135,7 +132,7 @@
list-style-type: none !important;
}
.um-account-side li {margin-bottom: 6px !important;background: #eee;}
.um-account-side li {margin-bottom: 1px !important;background: #eee;}
.um-account-side li a{
display: block;
@@ -152,6 +149,7 @@
right: 10px;
top: 6px;
font-size: 26px;
opacity: 0.6;
}
.um-account-side li a span.um-account-icon,
@@ -169,10 +167,6 @@
font-weight: normal !important;
}
.um-account-side li a.current span.um-account-icon,
.um-account-side li a.current:hover span.um-account-icon
{color: #3ba1da}
.um-account-side li a span.um-account-icon i {
display: block;
height: 30px;
-1
View File
@@ -187,7 +187,6 @@
border-radius: 3px;
padding: 0 20px;
color: #fff;
background: #3ba1da;
vertical-align: middle;
font-size: 14px;
box-sizing: border-box;
+1 -9
View File
@@ -215,14 +215,10 @@
.um-member-name a {
font-size: 16px;
line-height: 26px;
color: #444 !important;
color: #444;
font-weight: 700;
}
.um-member-name a:hover {
color: #3ba1da;
}
.um-member-tagline {
font-size: 13px;
line-height: 22px;
@@ -248,8 +244,6 @@
line-height: 32px;
}
.um-member-more a:hover, .um-member-less a:hover{color: #3ba1da}
.um-member-meta {
display: none;
margin: 20px 15px 0 15px;
@@ -320,7 +314,6 @@
.um-members-pagi span.current,
.um-members-pagi span.current:hover {
background: #3ba1da;
color: #fff !important;
}
@@ -345,5 +338,4 @@
.um-members-pagi a:hover {
text-decoration: none !important;
color: #3ba1da;
}
-3
View File
@@ -96,7 +96,6 @@
height: 44px;
line-height: 44px;
color: #fff;
background: #3ba1da;
padding: 0 20px;
box-sizing: border-box;
font-size: 17px;
@@ -118,7 +117,6 @@
.um-modal-btn.disabled:hover {
opacity: 0.5;
cursor: default !important;
background: #3ba1da;
}
.um-modal-btn {
@@ -132,7 +130,6 @@
padding: 0 20px;
text-align: center;
color: #fff;
background: #3ba1da;
vertical-align: middle;
font-size: 14px;
box-sizing: border-box;
+2 -6
View File
@@ -56,7 +56,7 @@
}
.um-cover-add {
color: #aaa !important;
color: #aaa;
font-size: 36px;
width: 100%;
display: table;
@@ -67,8 +67,6 @@
vertical-align: middle;
}
.um-cover-add:hover { color: #3ba1da }
.um-cover-e {
text-align: center;
box-sizing: border-box;
@@ -349,7 +347,6 @@ font-weight: normal;
.um-profile-nav-item.active a,
.um-profile-nav-item.active a:hover {
background: #3ba1da;
color: #FFF!important;
}
@@ -400,7 +397,6 @@ font-weight: normal;
font-weight: 600;
margin: 0 20px;
}
.um-profile-subnav a.active {color: #3ba1da}
.um-profile-subnav a:hover {color: #333}
.um-profile-subnav span {
@@ -486,7 +482,7 @@ font-weight: normal;
content: "•";
}
.um-item-meta a {font-weight: bold;border-bottom: 1px solid #E0E0E0;color: #3ba1da}
.um-item-meta a {font-weight: bold;border-bottom: 1px solid #E0E0E0}
.um-item-meta a:hover {border-bottom-color: #bbb}
.um-load-items {
-1
View File
@@ -549,7 +549,6 @@ div.uimob800 .um-account-side li a span.um-account-icontip i {
div.uimob800 .um-account-side li a.current,
div.uimob800 .um-account-side li a.current:hover {
background: #3ba1da;
color: #fff !important;
}
+1 -1
View File
@@ -651,7 +651,7 @@ a.um-link-alt:hover {text-decoration: underline !important;}
}
.um-dropdown li a:hover {
color: #3ba1da;
}
.um-dropdown-b {
+1 -1
View File
File diff suppressed because one or more lines are too long
+78
View File
@@ -0,0 +1,78 @@
.um {
direction: rtl !important;
text-align: right;
}
.um-profile-photo {
float: right;
}
.um-profile-photo a.um-profile-photo-img {
float: right;
left: auto;
right: 30px;
}
.um-profile-edit {
right: auto;
left: 10px;
padding-left: 10px;
}
div.uimob800 .um-header .um-profile-meta {
padding-left: 0 !important;
padding-right: 200px !important;
}
.um-name {
float: right;
margin-right: 0;
margin-left: 30px;
}
.um-profile-nav-item a{float: right}
.um-field-checkbox-state, .um-field-radio-state {
right: 1px;
left: auto;
}
.um-field-checkbox-option, .um-field-radio-option {
margin: 0 36px 0 0;
}
.um-field-half {
float: right;
}
.um-field-half.right {
float: left;
}
.um-left {
float: right;
}
.um-right {
float: left;
}
.um-account-main,
.um-account-side {
float: right;
}
.um-account-main div.um-account-heading i {
margin-right: 0;
margin-left: 10px;
}
.um-field-label .um-field-label-icon {
float: right;
margin: 0 0 0 8px;
}
p.um-notice i {
right: auto;
left: 14px;
}
+24 -2
View File
@@ -12,7 +12,19 @@ print "
.um-$form_id.um .um-tip:hover,
.um-$form_id.um .um-field-radio.active i,
.um-$form_id.um .um-field-checkbox.active i
.um-$form_id.um .um-field-checkbox.active i,
.um-$form_id.um .um-member-name a:hover,
.um-$form_id.um .um-member-more a:hover,
.um-$form_id.um .um-member-less a:hover,
.um-$form_id.um .um-members-pagi a:hover,
.um-$form_id.um .um-cover-add:hover,
.um-$form_id.um .um-profile-subnav a.active,
.um-$form_id.um .um-item-meta a,
.um-account-name a:hover,
.um-account-nav a.current,
.um-account-side li a.current span.um-account-icon,
.um-account-side li a.current:hover span.um-account-icon,
.um-dropdown li a:hover
{
color: $active_color;
}
@@ -20,7 +32,17 @@ print "
.um-$form_id.um .um-field-group-head,
.picker__box,
.picker__nav--prev:hover,
.picker__nav--next:hover
.picker__nav--next:hover,
.um-$form_id.um .um-members-pagi span.current,
.um-$form_id.um .um-members-pagi span.current:hover,
.um-$form_id.um .um-profile-nav-item.active a,
.um-$form_id.um .um-profile-nav-item.active a:hover,
.upload,
.um-modal-header,
.um-modal-btn,
.um-modal-btn.disabled,
.um-modal-btn.disabled:hover,
div.uimob800 .um-account-side li a.current,div.uimob800 .um-account-side li a.current:hover
{
background: $active_color;
}
+1 -1
View File
@@ -23,7 +23,7 @@ jQuery(document).ready(function() {
jQuery('.um-account-nav a').removeClass('current');
jQuery('.um-account-nav a[data-tab='+tab_+']').addClass('current');
return false;
});
+3 -3
View File
@@ -360,9 +360,9 @@ function initImageUpload_UM( trigger ) {
} else {
upload_text = '';
}
trigger.uploadFile({
url: ultimatemember_image_upload_url,
url: um_scripts.imageupload,
method: "POST",
multiple: false,
formData: {key: trigger.data('key'), set_id: trigger.data('set_id'), set_mode: trigger.data('set_mode') },
@@ -442,7 +442,7 @@ function initFileUpload_UM( trigger ) {
}
trigger.uploadFile({
url: ultimatemember_file_upload_url,
url: um_scripts.fileupload,
method: "POST",
multiple: false,
formData: {key: trigger.data('key'), set_id: trigger.data('set_id'), set_mode: trigger.data('set_mode') },
+3 -3
View File
@@ -24,7 +24,7 @@ jQuery(document).ready(function() {
um_modal_responsive();
jQuery.ajax({
url: ultimatemember_ajax_url,
url: um_scripts.ajaxurl,
type: 'post',
data: {
action: 'ultimatemember_remove_file',
@@ -54,7 +54,7 @@ jQuery(document).ready(function() {
um_modal_responsive();
jQuery.ajax({
url: ultimatemember_ajax_url,
url: um_scripts.ajaxurl,
type: 'post',
data: {
action: 'ultimatemember_remove_file',
@@ -99,7 +99,7 @@ jQuery(document).ready(function() {
jQuery(this).html( jQuery(this).attr('data-processing') ).addClass('disabled');
jQuery.ajax({
url: ultimatemember_ajax_url,
url: um_scripts.ajaxurl,
type: 'POST',
data: {
action: 'ultimatemember_resize_image',
+2 -2
View File
@@ -43,7 +43,7 @@ jQuery(document).ready(function() {
metakey = 'profile_photo';
jQuery.ajax({
url: ultimatemember_ajax_url,
url: um_scripts.ajaxurl,
type: 'post',
data: {
action: 'ultimatemember_delete_profile_photo',
@@ -68,7 +68,7 @@ jQuery(document).ready(function() {
metakey = 'cover_photo';
jQuery.ajax({
url: ultimatemember_ajax_url,
url: um_scripts.ajaxurl,
type: 'post',
data: {
action: 'ultimatemember_delete_cover_photo',
+17 -10
View File
@@ -55,18 +55,21 @@ jQuery(document).ready(function() {
jQuery('.um-datepicker').each(function(){
elem = jQuery(this);
if ( elem.attr('data-disabled_weekdays') != '' ) {
var disable = JSON.parse( elem.attr('data-disabled_weekdays') );
} else {
var disable = false;
}
var years_n = elem.attr('data-years');
var min = new Date( elem.attr('data-date_min') );
var max = new Date( elem.attr('data-date_max') );
var min = elem.attr('data-date_min');
var max = elem.attr('data-date_max');
var min = min.split(",");
var max = max.split(",");
elem.pickadate({
selectYears: years_n,
min: min,
@@ -74,7 +77,9 @@ jQuery(document).ready(function() {
disable: disable,
format: elem.attr('data-format'),
formatSubmit: 'yyyy/mm/dd',
hiddenName: true
hiddenName: true,
onOpen: function() { elem.blur(); },
onClose: function() { elem.blur(); }
});
});
@@ -85,7 +90,9 @@ jQuery(document).ready(function() {
format: elem.attr('data-format'),
interval: parseInt( elem.attr('data-intervals') ),
formatSubmit: 'HH:i',
hiddenName: true
hiddenName: true,
onOpen: function() { elem.blur(); },
onClose: function() { elem.blur(); }
});
});
@@ -123,7 +130,7 @@ jQuery(document).ready(function() {
parent.find('input[type=hidden]').val('');
jQuery.ajax({
url: ultimatemember_ajax_url,
url: um_scripts.ajaxurl,
type: 'post',
data: {
action: 'ultimatemember_remove_file',
@@ -143,7 +150,7 @@ jQuery(document).ready(function() {
parent.find('input[type=hidden]').val('');
jQuery.ajax({
url: ultimatemember_ajax_url,
url: um_scripts.ajaxurl,
type: 'post',
data: {
action: 'ultimatemember_remove_file',
@@ -222,7 +229,7 @@ jQuery(document).ready(function() {
var hook = jQuery(this).data('hook');
var container = jQuery(this).parents('.um').find('.um-ajax-items');
jQuery.ajax({
url: ultimatemember_ajax_url,
url: um_scripts.ajaxurl,
type: 'post',
data: {
action: 'ultimatemember_ajax_paginate',
@@ -251,7 +258,7 @@ jQuery(document).ready(function() {
}
jQuery.ajax({
url: ultimatemember_ajax_url,
url: um_scripts.ajaxurl,
type: 'post',
data: {
action: 'ultimatemember_muted_action',
+5 -5
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -32,6 +32,6 @@ if(isset($_FILES[$id]['name'])) {
}
} else {
$ret['error'] = __('Theme Compatibility Issue.','ultimatemember');
$ret['error'] = __('A theme or plugin compatibility issue','ultimatemember');
}
echo json_encode($ret);
+1 -1
View File
@@ -33,6 +33,6 @@ if(isset($_FILES[$id]['name'])) {
}
} else {
$ret['error'] = __('Theme Compatibility Issue.','ultimatemember');
$ret['error'] = __('A theme or plugin compatibility issue','ultimatemember');
}
echo json_encode($ret);
+1 -1
View File
@@ -30,7 +30,7 @@ class UM_Account {
$tabs[300]['privacy']['icon'] = 'um-faicon-lock';
$tabs[300]['privacy']['title'] = __('Privacy','ultimatemember');
$tabs[400]['notifications']['icon'] = 'um-faicon-bell';
$tabs[400]['notifications']['icon'] = 'um-faicon-envelope';
$tabs[400]['notifications']['title'] = __('Notifications','ultimatemember');
$tabs[9999]['delete']['icon'] = 'um-faicon-trash-o';
+5 -2
View File
@@ -12,8 +12,9 @@
if ( um_user('default_homepage') ) return;
if ( !um_user('redirect_homepage') ) return;
if( is_home() || is_front_page() )
if( is_front_page() ) {
$ultimatemember->access->redirect_handler = um_user('redirect_homepage');
}
}
/***
@@ -28,6 +29,8 @@
if ( $access == 2 && !is_user_logged_in() ) {
$redirect = um_get_option('access_redirect');
if ( !$redirect )
$redirect = um_get_core_page('login');
$redirects[] = untrailingslashit( um_get_core_page('login') );
$redirects[] = untrailingslashit( um_get_option('access_redirect') );
@@ -37,7 +40,7 @@
if ( $exclude_uris ) {
$redirects = array_merge( $redirects, $exclude_uris );
}
$redirects = array_unique( $redirects );
$current_url = $ultimatemember->permalinks->get_current_url( get_option('permalink_structure') );
+4
View File
@@ -80,6 +80,10 @@
if ( isset($_POST['user_email']) && !is_email( $_POST['user_email'] ) ) {
$ultimatemember->form->add_error('user_email', __('Please provide a valid e-mail','ultimatemember') );
}
if ( email_exists( $_POST['user_email'] ) && email_exists( $_POST['user_email'] ) != get_current_user_id() ) {
$ultimatemember->form->add_error('user_email', __('Email already linked to another account','ultimatemember') );
}
}
$ultimatemember->account->current_tab = 'general';
+2 -1
View File
@@ -1,7 +1,7 @@
<?php
/***
*** @Global ajax URLs
*** @fallback for ajax urls
***/
add_action('wp_head','ultimatemember_ajax_urls');
add_action('admin_head','ultimatemember_ajax_urls');
@@ -16,6 +16,7 @@
</script>
<?php
}
/***
+5
View File
@@ -22,6 +22,11 @@
switch( $_REQUEST['um_action'] ) {
default:
$uid = ( isset( $_REQUEST['uid'] ) ) ? $_REQUEST['uid'] : 0;
do_action('um_action_user_request_hook', $_REQUEST['um_action'], $uid);
break;
case 'edit':
$ultimatemember->fields->editing = true;
if ( !um_can_edit_my_profile() ) {
+1 -1
View File
@@ -95,7 +95,7 @@
foreach( $fields as $key => $array ) {
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 ) ) {
if ( !$ultimatemember->form->has_error( $key ) && preg_grep( "/".$args[$key]."/i" , $words ) ) {
$ultimatemember->form->add_error( $key, __('You are not allowed to use this word as your username.','ultimatemember') );
}
}
+1 -1
View File
@@ -50,5 +50,5 @@
function um_add_form_honeypot_js() { global $ultimatemember; ?>
<script type="text/javascript">jQuery( '#<?php echo $ultimatemember->honeypot; ?>' ).val( '' );</script>
<?php }
+2
View File
@@ -240,6 +240,8 @@
<div class="um-member-name"><a href="<?php echo um_user_profile_url(); ?>" title="<?php echo um_cap_initials( um_user('display_name') ); ?>"><?php echo um_cap_initials( um_user('display_name') ); ?></a></div>
<?php } ?>
<?php do_action('um_members_after_user_name', um_user('ID'), $args); ?>
<?php
if ( $show_tagline && is_array( $tagline_fields ) ) {
foreach( $tagline_fields as $key ) {
+4
View File
@@ -59,6 +59,10 @@
if ( isset( $_REQUEST['updated'] ) && !empty( $_REQUEST['updated'] ) && !$ultimatemember->form->errors ) {
switch( $_REQUEST['updated'] ) {
default:
$success = apply_filters("um_custom_success_message_handler", $success, $_REQUEST['updated']);
break;
case 'account':
$success = __('Your account was updated successfully.','ultimatemember');
break;
+5 -5
View File
@@ -114,17 +114,17 @@
wp_die( __('Whoa, slow down! You\'re seeing this message because you tried to submit a form too fast and we think you might be a spam bot. If you are a real human being please wait a few seconds before submitting the form. Thanks!') );
if ( !$args['user_password'] ) {
$ultimatemember->form->add_error('user_password', 'You must enter a new password');
$ultimatemember->form->add_error('user_password', __('You must enter a new password','ultimatemember') );
}
if ( um_get_option('reset_require_strongpass') ) {
if ( strlen( utf8_decode( $args['user_password'] ) ) < 8 ) {
$ultimatemember->form->add_error('user_password', __('Your password must contain at least 8 characters') );
$ultimatemember->form->add_error('user_password', __('Your password must contain at least 8 characters','ultimatemember') );
}
if ( strlen( utf8_decode( $args['user_password'] ) ) > 30 ) {
$ultimatemember->form->add_error('user_password', __('Your password must contain less than 30 characters') );
$ultimatemember->form->add_error('user_password', __('Your password must contain less than 30 characters','ultimatemember') );
}
if ( !$ultimatemember->validation->strong_pass( $args['user_password'] ) ) {
@@ -134,11 +134,11 @@
}
if ( !$args['confirm_user_password'] ) {
$ultimatemember->form->add_error('confirm_user_password', 'You must confirm your new password');
$ultimatemember->form->add_error('confirm_user_password', __('You must confirm your new password','ultimatemember') );
}
if ( $args['user_password'] != $args['confirm_user_password'] ) {
$ultimatemember->form->add_error('confirm_user_password', 'Your passwords do not match');
$ultimatemember->form->add_error('confirm_user_password', __('Your passwords do not match','ultimatemember') );
}
}
+3
View File
@@ -7,6 +7,9 @@
function um_pre_get_posts($query) {
if ( !is_admin() && $query->is_main_query() ) {
// Incompatibility with The Events Calendar
if ( isset( $query->query['post_type'] ) && $query->query['post_type'] == 'tribe_events' ) return;
if ( $query->is_search || $query->is_archive() || $query->is_home ) {
+9 -5
View File
@@ -329,7 +329,11 @@
<?php if ( $args['show_name'] ) { ?>
<div class="um-name">
<a href="<?php echo um_user_profile_url(); ?>" title="<?php echo um_user('display_name'); ?>"><?php echo um_user('display_name'); ?></a>
<?php do_action('um_after_profile_name_inline', $args ); ?>
</div>
<?php } ?>
@@ -382,7 +386,7 @@
function um_pre_profile_shortcode($args){
global $ultimatemember;
extract( $args );
if ( $mode == 'profile' && $ultimatemember->fields->editing == false ) {
$ultimatemember->fields->viewing = 1;
@@ -440,7 +444,7 @@
<?php
$items = array(
'editprofile' => '<a href="'.um_edit_my_profile_uri().'" class="real_url">'.__('Edit Profile','ultimatemember').'</a>',
'editprofile' => '<a href="'.um_edit_profile_url().'" class="real_url">'.__('Edit Profile','ultimatemember').'</a>',
'myaccount' => '<a href="'.um_get_core_page('account').'" class="real_url">'.__('My Account','ultimatemember').'</a>',
'logout' => '<a href="'.um_get_core_page('logout').'" class="real_url">'.__('Logout','ultimatemember').'</a>',
'cancel' => '<a href="#" class="um-dropdown-hide">'.__('Cancel','ultimatemember').'</a>',
@@ -460,10 +464,10 @@
$items = array_merge( $items, $actions );
}
$items = apply_filters('um_profile_edit_menu_items', $items, um_profile_id() );
$items['cancel'] = $cancel;
$items = apply_filters('um_profile_edit_menu_items', $items );
} else {
$items = apply_filters('um_myprofile_edit_menu_items', $items );
+11 -12
View File
@@ -90,6 +90,8 @@
if ( !isset( $args['role'] ) ) {
$role = um_get_option('default_role');
}
$ultimatemember->user->is_secure_role( $user_id, $role );
$ultimatemember->user->set_role( $role );
@@ -128,9 +130,9 @@
global $ultimatemember;
if ( um_user('status') != 'pending' ) {
$ultimatemember->mail->send( um_admin_email(), 'notification_new_user' );
$ultimatemember->mail->send( um_admin_email(), 'notification_new_user', array('admin' => true ) );
} else {
$ultimatemember->mail->send( um_admin_email(), 'notification_review' );
$ultimatemember->mail->send( um_admin_email(), 'notification_review', array('admin' => true ) );
}
}
@@ -186,7 +188,7 @@
add_action('um_user_registration', 'um_user_registration', 10);
function um_user_registration($args){
global $ultimatemember;
do_action('um_add_user_frontend', $args);
}
@@ -214,17 +216,14 @@
if ( isset( $args['custom_fields']['role_select'] ) || isset( $args['custom_fields']['role_radio'] ) ) return;
if (isset($args['role']) && !empty($args['role'])){
echo '<input type="hidden" name="role" id="role" value="'.$args['role'].'" />';
if (isset($args['role']) && !empty($args['role'])) {
$role = $args['role'];
} else {
$default_role = um_get_option('default_role');
echo '<input type="hidden" name="role" id="role" value="'.$default_role.'" />';
$role = um_get_option('default_role');
}
echo '<input type="hidden" name="role" id="role" value="' . $role . '" />';
}
/***
+1 -1
View File
@@ -32,7 +32,7 @@
function um_new_user_via_wpadmin( $user_id ) {
if ( is_admin() ) {
global $ultimatemember;
if ( isset( $_POST['role'] ) && $_POST['role'] == 'administrator' ) {
+7 -1
View File
@@ -17,10 +17,16 @@ class UM_Builtin {
/***
*** @regular or multi-select/options
***/
function is_dropdown_field( $field ) {
function is_dropdown_field( $field, $attrs ) {
if ( isset( $attrs['options'] ) )
return true;
$fields = $this->all_user_fields;
if ( isset($fields[$field]['options']) )
return true;
return false;
}
-32
View File
@@ -6,10 +6,6 @@ class UM_Cache {
add_action( 'init', array(&$this, 'do_not_cache' ) );
add_action('um_admin_after_editing_role', array(&$this, 'delete_role_cache'), 10, 2 );
$this->role_data = get_option('um_cache_role_data');
}
/***
@@ -22,33 +18,5 @@ class UM_Cache {
}
}
/***
*** @clear cached role data
***/
function delete_role_cache( $post_id, $post ) {
$role_slug = $post->post_name;
if ( isset( $this->role_data[ $role_slug ] ) ) {
unset( $this->role_data[ $role_slug ] );
update_option('um_cache_role_data', $this->role_data);
}
}
/***
*** @get cached role data
***/
function role_data( $role_slug ) {
if ( isset( $this->role_data[ $role_slug ] ) )
return $this->role_data[ $role_slug ];
return null;
}
/***
*** @set role data cache
***/
function set_role_data( $role_slug, $array ) {
$this->role_data[ $role_slug ] = $array;
update_option('um_cache_role_data', $this->role_data);
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ class UM_Cron {
}
public function add_schedules( $schedules = array() ) {
// Adds once weekly to the existing schedules.
$schedules['weekly'] = array(
'interval' => 604800,
+18
View File
@@ -79,16 +79,34 @@ class UM_Enqueue {
$this->load_original();
wp_localize_script( 'um_scripts', 'um_scripts', array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'fileupload' => um_url . 'core/lib/upload/um-file-upload.php',
'imageupload' => um_url . 'core/lib/upload/um-image-upload.php'
) );
} else {
wp_register_script('um_minified', um_url . 'assets/js/um.min.js', array('jquery'), ultimatemember_version, true );
wp_enqueue_script('um_minified');
wp_localize_script( 'um_minified', 'um_scripts', array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'fileupload' => um_url . 'core/lib/upload/um-file-upload.php',
'imageupload' => um_url . 'core/lib/upload/um-image-upload.php'
) );
wp_register_style('um_minified', um_url . 'assets/css/um.min.css', '', ultimatemember_version, 'all' );
wp_enqueue_style('um_minified');
}
// rtl style
if ( is_rtl() ) {
wp_register_style('um_rtl', um_url . 'assets/css/um.rtl.css', '', ultimatemember_version, 'all' );
wp_enqueue_style('um_rtl');
}
// load a localized version for date/time
$locale = get_option('WPLANG');
if ( $locale && file_exists( um_path . 'assets/js/pickadate/translations/' . $locale . '.js' ) ) {
+11 -2
View File
@@ -246,7 +246,16 @@ class UM_Fields {
*** @Print field error
***/
function field_error($text) {
$output = '<div class="um-field-error"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>'.$text.'</div>';
global $ultimatemember;
if ( isset( $this->set_id ) && $ultimatemember->form->processing == $this->set_id ) {
$output = '<div class="um-field-error"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>'.$text.'</div>';
} else {
$output = '';
}
if ( !$ultimatemember->form->processing ) {
$output = '<div class="um-field-error"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>'.$text.'</div>';
}
return $output;
}
@@ -2017,7 +2026,7 @@ class UM_Fields {
}
if ( um_is_myprofile() ) {
$output .= '<p class="um-profile-note">' . $emo .'<span>' . sprintf(__('Your profile is looking a little empty. Why not <a href="%s">add</a> some information!','ultimatemember'), add_query_arg('um_action','edit') ) . '</span></p>';
$output .= '<p class="um-profile-note">' . $emo .'<span>' . sprintf(__('Your profile is looking a little empty. Why not <a href="%s">add</a> some information!','ultimatemember'), um_edit_profile_url() ) . '</span></p>';
} else {
$output .= '<p class="um-profile-note">'. $emo . '<span>' . __('This user has not added any information to their profile yet.','ultimatemember') . '</span></p>';
}
+4
View File
@@ -9,6 +9,10 @@
if ( is_user_logged_in() && isset( $args['mode'] ) && $args['mode'] == 'login' ) {
if ( get_current_user_id() != um_user('ID' ) ) {
um_fetch_user( get_current_user_id() );
}
$args['template'] = 'logout';
}
+4
View File
@@ -66,6 +66,8 @@
foreach( $query as $field => $value ) {
if(in_array($field, array('members_page'))) continue;
if ( in_array( $field, array('gender') ) ) {
$operator = '=';
} else {
@@ -175,6 +177,8 @@
if ( isset( $order ) ) {
$query_args['order'] = $order;
}
$query_args = apply_filters('um_modify_sortby_parameter', $query_args, $sortby);
}
+4
View File
@@ -12,6 +12,8 @@ class UM_Form {
$this->errors = null;
$this->processing = null;
add_action('init', array(&$this, 'form_init'), 2);
add_action('init', array(&$this, 'field_declare'), 10);
@@ -107,6 +109,8 @@ class UM_Form {
$this->form_suffix = '-' . $form['form_id'];
$this->processing = $form['form_id'];
foreach($form as $key => $value){
if (strstr($key, $this->form_suffix) ) {
$a_key = str_replace( $this->form_suffix, '', $key);
+39 -12
View File
@@ -6,6 +6,8 @@ class UM_Mail {
add_filter('mandrill_nl2br', array(&$this, 'mandrill_nl2br') );
$this->force_plain_text = '';
}
/***
@@ -25,14 +27,23 @@ class UM_Mail {
/***
*** @check If template exists
***/
function email_template( $template ) {
function email_template( $template, $args = array() ) {
if ( file_exists( get_stylesheet_directory() . '/ultimate-member/templates/email/' . $template . '.html' ) ) {
return get_stylesheet_directory() . '/ultimate-member/templates/email/' . $template . '.html';
}
if ( file_exists( um_path . 'templates/email/' . $template . '.html' ) ) {
return um_url . 'templates/email/' . $template . '.html';
if ( isset( $args['path'] ) ) {
$path = $args['path'];
} else {
$path = um_path . 'templates/email/';
}
if ( file_exists( $path . $template . '.html' ) ) {
return $path . $template . '.html';
}
return false;
}
/***
@@ -48,38 +59,49 @@ class UM_Mail {
$this->headers = 'From: '. um_get_option('mail_from') .' <'. um_get_option('mail_from_addr') .'>' . "\r\n";
$this->subject = um_get_option( $template . '_sub' );
$this->subject = $this->convert_tags( $this->subject );
$this->subject = $this->convert_tags( $this->subject, $args );
if ( isset( $args['admin'] ) || isset( $args['plain_text'] ) ) {
$this->force_plain_text = 'forced';
}
// HTML e-mail
if ( um_get_option('email_html') && $this->email_template( $template ) ) {
$this->message = file_get_contents( $this->email_template( $template ) );
// HTML e-mail or text
if ( um_get_option('email_html') && $this->email_template( $template, $args ) ) {
add_filter( 'wp_mail_content_type', array(&$this, 'set_content_type') );
$this->message = file_get_contents( $this->email_template( $template, $args ) );
} else {
$this->message = um_get_option( $template );
}
// Convert tags in body
$this->message = $this->convert_tags( $this->message );
$this->message = $this->convert_tags( $this->message, $args );
// Send mail
add_filter( 'wp_mail_content_type', array(&$this, 'set_content_type') );
wp_mail( $email, $this->subject, $this->message, $this->headers, $this->attachments );
remove_filter( 'wp_mail_content_type', array(&$this, 'set_content_type') );
// reset globals
$this->force_plain_text = '';
}
/***
*** @maybe sending HTML emails
***/
function set_content_type( $content_type ) {
if ( um_get_option('email_html') )
return 'text/html';
if ( $this->force_plain_text == 'forced' ) return 'text/plain';
if ( um_get_option('email_html') ) return 'text/html';
return 'text/plain';
}
/***
*** @convert template tags in email template
***/
function convert_tags( $content ) {
function convert_tags( $content, $args = array() ) {
$search = array(
'{display_name}',
@@ -126,6 +148,11 @@ class UM_Mail {
$replace = apply_filters('um_template_tags_replaces_hook', $replace);
$content = str_replace($search, $replace, $content);
if ( isset( $args['tags'] ) && isset( $args['tags_replace'] ) ) {
$content = str_replace($args['tags'], $args['tags_replace'], $content);
}
return $content;
}
+9 -2
View File
@@ -73,9 +73,13 @@ class UM_Members {
$fields = $ultimatemember->builtin->all_user_fields;
$attrs = $fields[$filter];
if ( isset( $fields[$filter] ) ) {
$attrs = $fields[$filter];
} else {
$attrs = apply_filters("um_custom_search_field_{$filter}", array() );
}
if ( $ultimatemember->builtin->is_dropdown_field( $filter ) ) {
if ( $ultimatemember->builtin->is_dropdown_field( $filter, $attrs ) ) {
$type = 'select';
} else {
$type = 'text';
@@ -99,6 +103,9 @@ class UM_Members {
if ( strstr($filter, 'role_') )
$opt = $k;
if ( isset( $attrs['custom'] ) )
$opt = $k;
?>
+6 -5
View File
@@ -59,21 +59,22 @@ class UM_Permalinks {
***/
function activate_account_via_email_link(){
global $ultimatemember;
if ( isset($_REQUEST['act']) && $_REQUEST['act'] == 'activate_via_email' && isset($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 &&
isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id']) ) { // valid token
um_fetch_user( $_REQUEST['user_id'] );
if ( um_user('account_status') != 'awaiting_email_confirmation' ) wp_die('The activation link you used is invalid or has expired.');
if ( $_REQUEST['hash'] != um_user('account_secret_hash') ) wp_die('The secret key provided does not match this one for the user.');
$ultimatemember->user->approve();
$redirect = ( um_user('url_email_activate') ) ? um_user('url_email_activate') : um_get_core_page('login', 'account_active');
um_reset_user();
exit( wp_redirect( um_get_core_page('login', 'account_active') ) );
exit( wp_redirect( $redirect ) );
}
@@ -128,7 +129,7 @@ class UM_Permalinks {
***/
function profile_url() {
global $ultimatemember;
$profile_url = $this->core['user'];
$profile_url = get_permalink($profile_url);
+25 -10
View File
@@ -8,6 +8,26 @@ class UM_Query {
}
/***
*** @get all forms
***/
function forms() {
$args = array(
'post_type' => 'um_form',
'posts_per_page' => 200,
'post_status' => array('publish')
);
$query = new WP_Query( $args );
foreach( $query->posts as $post ) {
setup_postdata( $post );
$results[ $post->ID ] = $post->post_title;
}
return $results;
}
/***
*** @get all post types
***/
@@ -24,18 +44,21 @@ class UM_Query {
function make( $args ) {
$defaults = array(
'post_type' => 'post'
'post_type' => 'post',
'post_status' => array('publish')
);
$args = wp_parse_args( $args, $defaults );
if ( isset( $args['post__in'] ) && empty( $args['post__in'] ) )
return false;
extract( $args );
if ( $post_type == 'comment' ) { // comments
unset( $args['post_type'] );
unset( $args['post_status'] );
$comments = get_comments($args);
return $comments;
@@ -183,11 +206,6 @@ class UM_Query {
***/
function role_data( $role_slug ) {
global $wpdb, $ultimatemember;
// get cache
if ( $ultimatemember->cache->role_data( $role_slug ) ) {
return $ultimatemember->cache->role_data( $role_slug );
}
if ($role_slug == 'admin' || $role_slug == 'member'){
$try = $this->find_post_id('um_role','_um_core',$role_slug);
@@ -217,9 +235,6 @@ class UM_Query {
$array = $ultimatemember->setup->get_initial_permissions( $role_slug );
}
// set cache
$ultimatemember->cache->set_role_data( $role_slug, $array );
return $array;
}
+25 -16
View File
@@ -278,7 +278,7 @@ function um_profile_id() {
***/
function um_is_core_page( $page ) {
global $post, $ultimatemember;
if ( isset($post->ID) && $post->ID == $ultimatemember->permalinks->core[ $page ] )
if ( isset($post->ID) && isset( $ultimatemember->permalinks->core[ $page ] ) && $post->ID == $ultimatemember->permalinks->core[ $page ] )
return true;
return false;
}
@@ -321,7 +321,7 @@ function um_profile_id() {
global $ultimatemember;
if ( isset($_REQUEST['um_search']) ) {
$query = $ultimatemember->permalinks->get_query_array();
if ( in_array( $val, $query ) )
if ( isset( $query[$filter] ) && $val == $query[$filter] )
echo 'selected="selected"';
}
echo '';
@@ -472,19 +472,6 @@ function um_reset_user() {
return false;
}
/***
*** @Returns profile edit link
***/
function um_edit_my_profile_uri() {
global $ultimatemember;
$url = $ultimatemember->permalinks->get_current_url( get_option('permalink_structure') );
$url = remove_query_arg('profiletab', $url);
$url = remove_query_arg('subnav', $url);
$url = add_query_arg('profiletab', 'main', $url);
$url = add_query_arg('um_action', 'edit', $url);
return $url;
}
/***
*** @remove edit profile args from url
***/
@@ -605,7 +592,9 @@ function um_reset_user() {
$role = get_user_meta( $user_id, 'role', true );
$permissions = $ultimatemember->query->role_data( $role );
$permissions = apply_filters('um_user_permissions_filter', $permissions, $user_id);
if ( $permissions[ $permission ] == 1 )
if ( isset( $permissions[ $permission ] ) && is_serialized( $permissions[ $permission ] ) )
return unserialize( $permissions[ $permission ] );
if ( isset( $permissions[ $permission ] ) && $permissions[ $permission ] == 1 )
return true;
return false;
}
@@ -653,6 +642,18 @@ function um_reset_user() {
return $return;
}
/***
*** @Returns the edit profile link
***/
function um_edit_profile_url(){
global $ultimatemember;
$url = remove_query_arg('profiletab');
$url = remove_query_arg('subnav', $url);
$url = add_query_arg('profiletab', 'main',$url);
$url = add_query_arg('um_action','edit', $url);
return $url;
}
/***
*** @checks if user can edit his profile
***/
@@ -823,6 +824,14 @@ function um_fetch_user( $user_id ) {
return $uri;
}
/***
*** @get avatar URL instead of image
***/
function um_get_avatar_url($get_avatar){
preg_match('/src="(.*?)"/i', $get_avatar, $matches);
return $matches[1];
}
/***
*** @get avatar uri
***/
+14 -2
View File
@@ -21,6 +21,8 @@ class UM_Shortcodes {
global $ultimatemember;
$array = $ultimatemember->permalinks->core;
if ( !$array ) return $classes;
foreach( $array as $slug => $info ) {
if ( um_is_core_page( $slug ) ) {
$classes[] = 'um-page-' . $slug;
@@ -104,7 +106,7 @@ class UM_Shortcodes {
$defaults = array();
$args = wp_parse_args( $args, $defaults );
// when to not continue
$this->form_id = (isset($args['form_id'])) ? $args['form_id'] : null;
if (!$this->form_id) return;
@@ -113,6 +115,9 @@ class UM_Shortcodes {
// get data into one global array
$post_data = $ultimatemember->query->post_data( $this->form_id );
$args = apply_filters('um_pre_args_setup', $post_data );
if ( !isset( $args['template'] ) ) $args['template'] = '';
if ( isset( $post_data['template'] ) && $post_data['template'] != $args['template']) $args['template'] = $post_data['template'];
if ( !$this->template_exists( $args['template'] ) ) $args['template'] = $post_data['mode'];
@@ -146,9 +151,11 @@ class UM_Shortcodes {
$this->dynamic_css( $args );
if ( um_get_requested_user() ) {
if ( um_get_requested_user() || $mode == 'logout' ) {
um_reset_user();
}
do_action('um_after_everything_output');
$output = ob_get_contents();
ob_end_clean();
@@ -286,6 +293,7 @@ class UM_Shortcodes {
'{last_name}',
'{display_name}',
'{user_avatar_small}',
'{username}',
);
$pattern_array = apply_filters('um_allowed_user_tags_patterns', $pattern_array);
@@ -304,6 +312,10 @@ class UM_Shortcodes {
$value = um_user( $usermeta );
}
if ( $usermeta == 'username' ) {
$value = um_user('user_login');
}
$value = apply_filters("um_profile_tag_hook__{$usermeta}", $value, um_user('ID') );
if ( $value ) {
+10 -11
View File
@@ -16,9 +16,8 @@ class UM_Tracking {
*** @setup info array
***/
private function setup_data() {
global $ultimatemember;
$data = array();
// Retrieve current theme info
@@ -33,16 +32,10 @@ class UM_Tracking {
}
$data['url'] = home_url();
$data['theme'] = $theme;
$data['theme_version'] = $theme_ver;
$data['wp_version'] = get_bloginfo( 'version' );
$data['version'] = ultimatemember_version;
$result = count_users();
$data['users_count'] = $result['total_users'];
// Retrieve current plugin information
if( ! function_exists( 'get_plugins' ) ) {
@@ -61,15 +54,14 @@ class UM_Tracking {
$data['active_plugins'] = $active_plugins;
$data['inactive_plugins'] = $plugins;
$data['language'] = get_bloginfo('language');
$data['multisite'] = ( is_multisite() ) ? 1 : 0;
if ( !get_option('__ultimatemember_sitekey') ) {
$ultimatemember->setup->install_basics();
}
$data['email'] = get_option('admin_email');
$data['unique_sitekey'] = get_option('__ultimatemember_sitekey');
$this->data = $data;
@@ -107,6 +99,12 @@ class UM_Tracking {
$this->setup_data();
if ( !get_option('__ultimatemember_coupon_sent') ) {
$this->data['send_discount'] = 1;
} else {
$this->data['send_discount'] = 0;
}
$request = wp_remote_post( 'https://ultimatemember.com/?um_action=checkin', array(
'method' => 'POST',
'timeout' => 20,
@@ -118,6 +116,7 @@ class UM_Tracking {
) );
update_option( 'um_tracking_last_send', time() );
update_option( '__ultimatemember_coupon_sent', 1 );
}
/***
@@ -145,7 +144,7 @@ class UM_Tracking {
echo '<div class="updated" style="border-color: #3ba1da;"><p>';
echo __( 'Help us improve Ultimate Members compatibility with other plugins and themes by allowing us to track non-sensitive data on your site. Click <a href="https://ultimatemember.com/tracking/" target="_blank">here</a> to see what data we track.', 'ultimatemember' );
echo __( 'Allow Ultimate Member to track plugin usage? Opt-in to tracking and our newsletter and we will immediately e-mail you a 20% discount which you can use on any of our extensions. No sensitive data is tracked.', 'ultimatemember' );
echo '</p>';
+31
View File
@@ -173,6 +173,25 @@ class UM_User {
$this->set(0, $clean);
}
/***
*** @Security check for roles
***/
function is_secure_role( $user_id, $role ) {
if ( is_admin() ) return;
if ( $role == 'admin' ) {
$this->delete( false );
wp_die( __('This is not allowed for security reasons.','ultimatemember') );
}
if ( um_get_option('advanced_denied_roles') && strstr( um_get_option('advanced_denied_roles'), $role ) ) {
$this->delete( false );
wp_die( __('This is not allowed for security reasons.','ultimatemember') );
}
}
/***
*** @Clean user profile
***/
@@ -219,6 +238,15 @@ class UM_User {
*** @Set user's registration details
***/
function set_registration_details( $submitted ) {
if ( isset( $submitted['user_pass'] ) ) {
unset( $submitted['user_pass'] );
}
if ( isset( $submitted['user_password'] ) ) {
unset( $submitted['user_password'] );
}
update_user_meta( $this->id, 'submitted', $submitted );
}
@@ -259,6 +287,8 @@ class UM_User {
do_action('um_before_user_role_is_changed');
do_action('um_member_role_upgrade', $role, $this->profile['role'] );
$this->profile['role'] = $role;
$this->update_usermeta_info('role');
@@ -453,6 +483,7 @@ class UM_User {
if ( $send_mail ) {
$ultimatemember->mail->send( um_user('user_email'), 'deletion_email' );
$ultimatemember->mail->send( um_admin_email(), 'notification_deletion', array('admin' => true ) );
}
$ultimatemember->files->remove_dir( um_user_uploads_dir() );
+2 -3
View File
@@ -5,7 +5,6 @@ class UM_Validation {
function __construct() {
$this->regex_safe = '/\A[\w\-\.]+\z/';
$this->regex_safe_email = '/\A[\w\-\.\@]+\z/';
$this->regex_phone_number = '/\A[\d\-\.\+\(\)\ ]+\z/';
}
@@ -54,8 +53,8 @@ class UM_Validation {
*** @space, dash, underscore
***/
function safe_username( $string ) {
if ( is_email( $string ) && !preg_match( $this->regex_safe_email, $string ) )
return false;
if ( is_email( $string ) )
return true;
if ( !is_email( $string) && !preg_match( $this->regex_safe, $string ) )
return false;
return true;
+1 -1
View File
@@ -3,7 +3,7 @@
Plugin Name: Ultimate Member
Plugin URI: http://ultimatemember.com/
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
Version: 1.0.89
Version: 1.1.6
Author: Ultimate Member
Author URI: http://ultimatemember.com/
*/
+88 -2
View File
@@ -3,11 +3,11 @@ Author URI: https://ultimatemember.com/
Plugin URI: https://ultimatemember.com/
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
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 profile, user-profile, user profiles, user roles
Requires at least: 4.1
Tested up to: 4.1.1
Stable Tag: 1.0.89
Stable Tag: 1.1.6
License: GNU Version 2 or Any Later Version
@@ -41,14 +41,17 @@ Features of the plugin include:
* Developer friendly with dozens of actions and filters
* Multi-site compatibility
* Mandrill compatibility
* Multi language support
**Paid Extensions**
You can extend the power of Ultimate Member with one of our premium extensions:
* [Real-time Notifications](https://ultimatemember.com/extensions/real-time-notifications/)
* [Social Login](https://ultimatemember.com/extensions/social-login/)
* [bbPress](https://ultimatemember.com/extensions/bbpress/)
* [MailChimp](https://ultimatemember.com/extensions/mailchimp/)
* [User Reviews](https://ultimatemember.com/extensions/user-reviews/)
* [myCRED](https://ultimatemember.com/extensions/mycred/)
* [Notices](https://ultimatemember.com/extensions/notices/)
@@ -145,6 +148,7 @@ Ultimate Member has been translated into the following languages:
* Suomi
* Polski
* Türkçe
* العربية
== Installation ==
@@ -203,6 +207,88 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
== Changelog ==
= 1.1.6: April 7, 2015 =
* Fixed: major bug with datepicker (Update recommended)
= 1.1.5: April 4, 2015 =
* New: new action hook that runs when user role is changed um_member_role_upgrade
* Fixed: bug/compatibility issue with caching UM roles data
* Fixed: bug with changing role settings/permissions
* Fixed: bug with setting e-mail activation redirect URL
= 1.1.4: April 2, 2015 =
* Fixed: Major bug with dropdown and date fields (Update recommended)
* Fixed: hard-coded translation issues
= 1.1.3: April 1, 2015 =
* New: added option to manage if access control widgets can be edited by admins only
* Tweak: update to last security patch - deletes user who try to get unauthorized access
= 1.1.2: March 30, 2015 =
* Fixed: Important security patch - please update
* Fixed: conflict with The Events Calendar plugin
* Fixed: bug with edit profile link
= 1.1.1: March 29, 2015 =
* Fixed: bug where you user could use an already existing e-mail in account page
* Fixed: bug with special characaters in username
* Fixed: bug with showing draft posts in user profile
= 1.1.0: March 27, 2015 =
* New: added multi language support to assign different languages to different forms (beta feature)
* New: added RTL support (beta, still partial)
* New: added a dashboard widget to view latest blog posts from the plugin
* Tweak: changed manage_options permission to edit_users on some admin actions
* Fixed: corrected all active color references in the css
* Fixed: bug with user_row_actions filter
* Fixed: do not store user_pass in submitted metakey during registration
= 1.0.96: March 25, 2015 =
* New: Added Arabic language (ar) support
* Fixed: Date fields not working in Safari
* Fixed: issue with HTML e-mails
* Fixed: issue with showing sidebar logout widget on bbpress forums
= 1.0.95: March 24, 2015 =
* Tweak: added more hooks to mail function to allow for sending custom e-mails
* Fixed: issue with content lock settings in backend appearing for non-admins
* Fixed: issue with form errors handling
= 1.0.94: March 23, 2015 =
* Fixed: bug with member directory search
* Fixed: bug with custom role homepage
= 1.0.93: March 22, 2015 =
* Fixed: bug with showing register and login forms on same page
= 1.0.92: March 20, 2015 =
* New: added option to customize redirection URL after e-mail activation
* Fixed: issue with hardcoded ajax/upload URLs - they are now localized
* Fixed: issue with admin notification for a deleted account
* Fixed: admin notifications are in plain text format
= 1.0.91: March 20, 2015 =
* Tweak: featured image in user posts goes to post link
* Fixed: solved a bug with e-mail validation
= 1.0.90: March 19, 2015 =
* Tweak: minor admin css changes
* Tweak: error message for frontend upload with theme/plugin conflicts
= 1.0.89: March 18, 2015 =
* Tweak: Major Performance Improvements (beta)
+2
View File
@@ -56,6 +56,8 @@
</div><div class="um-clear"></div>
</form>
<?php do_action('um_after_account_page_load'); ?>
</div>
+1 -1
View File
@@ -8,7 +8,7 @@
$image_url = wp_get_attachment_image_src( $image_id, 'full', true );
?>
<div class="um-item-img"><a href="#" class="um-photo-modal" data-src="<?php echo $image_url[0]; ?>"><?php echo get_the_post_thumbnail( $post_id, 'medium' ); ?></a></div>
<div class="um-item-img"><a href="<?php the_permalink(); ?>"><?php echo get_the_post_thumbnail( $post_id, 'medium' ); ?></a></div>
<?php } ?>
+19 -3
View File
@@ -343,6 +343,15 @@ $this->sections[] = array(
'required' => array( 'wpadmin_register_redirect', '=', 'custom_url' ),
),
array(
'id' => 'access_widget_admin_only',
'type' => 'switch',
'title' => __( 'Enable the Access Control widget for Admins only?','ultimatemember' ),
'default' => 1,
'on' => __('Yes','ultimatemember'),
'off' => __('No','ultimatemember'),
),
array(
'id' => 'wpadmin_allow_ips',
'type' => 'textarea',
@@ -1757,6 +1766,14 @@ $this->sections[] = array(
'full_width' => true,
),
array(
'id' => 'advanced_denied_roles',
'type' => 'text',
'title' => __( 'Do not allow registering these roles','ultimatemember' ),
'default' => '',
'desc' => __('Comma seperate roles (role slugs) that can not be registered from frontend ever for security.','ultimatemember'),
),
array(
'id' => 'enable_timebot',
'type' => 'switch',
@@ -1829,9 +1846,8 @@ $this->sections[] = array(
'type' => 'switch',
'title' => __( 'Allow Tracking','ultimatemember' ),
'default' => 0,
'desc' => __( 'Help us improve Ultimate Members compatibility with other plugins and themes by allowing us to track non-sensitive data on your site. Click <a href="https://ultimatemember.com/tracking/" target="_blank">here</a> to see what data we track.', 'ultimatemember' ),
'on' => __('Allow tracking','ultimatemember'),
'off' => __('Do not allow','ultimatemember'),
'on' => __('On','ultimatemember'),
'off' => __('Off','ultimatemember'),
),
)
+12 -3
View File
@@ -26,9 +26,18 @@ class UM_API {
'fi_FI' => 'Suomi',
'pl_PL' => 'Polski',
'tr_TR' => 'Türkçe',
'ar' => 'العربية'
);
$this->addons['bp_avatar_transfer'] = array( __( 'BuddyPress Avatar Transfer','ultimatemember' ), __('This tool enables you to migrate your custom user photos from BuddyPress to use with Ultimate Member.','ultimatemember') );
$this->addons['multi_language'] = array(
__( 'Multi Language Support','ultimatemember' ),
__('This add-on helps you offer multi language forms to your visitors based on the languages you want.','ultimatemember')
);
$this->addons['bp_avatar_transfer'] = array(
__( 'BuddyPress Avatar Transfer','ultimatemember' ),
__('This add-on enables you to migrate your custom user photos from BuddyPress to use with Ultimate Member.','ultimatemember')
);
}
@@ -37,10 +46,10 @@ class UM_API {
***/
function load_addons() {
global $ultimatemember;
if ( !is_admin() ) return;
foreach( $ultimatemember->addons as $addon => $name ) {
if ( um_get_option('addon_' . $addon ) == 1 )
if ( um_get_option('addon_' . $addon ) == 1 ) {
include_once um_path . 'addons/'.$addon.'.php';
}
}
}