mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-18 14:13:46 +09:00
Version 1.0.48
This commit is contained in:
@@ -16,7 +16,7 @@ if(isset($_FILES[$id]['name'])) {
|
||||
|
||||
$temp = $_FILES[$id]["tmp_name"];
|
||||
$file = $_FILES[$id]["name"];
|
||||
|
||||
$file = str_replace(array('(',')','+','&','?','%','{','}','[',']','=',',',';',' '),'',$file);
|
||||
|
||||
$error = $ultimatemember->files->check_image_upload( $temp, $id );
|
||||
if ( $error ){
|
||||
|
||||
+6
-2
@@ -15,15 +15,19 @@ class UM_Access {
|
||||
*** @do actions based on priority
|
||||
***/
|
||||
function template_redirect() {
|
||||
|
||||
global $ultimatemember;
|
||||
|
||||
do_action('um_access_homepage_per_role');
|
||||
|
||||
do_action('um_access_global_settings');
|
||||
|
||||
do_action('um_access_post_settings');
|
||||
|
||||
if ( $this->redirect_handler && !$this->allow_access )
|
||||
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);
|
||||
exit( wp_redirect( $this->redirect_handler ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+37
-11
@@ -114,30 +114,56 @@ class UM_Account {
|
||||
function get_tab_output( $id ) {
|
||||
global $ultimatemember;
|
||||
|
||||
$output = null;
|
||||
|
||||
switch( $id ) {
|
||||
case 'privacy' :
|
||||
|
||||
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' :
|
||||
|
||||
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' :
|
||||
|
||||
case 'general':
|
||||
$args = 'user_login,first_name,last_name,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' :
|
||||
|
||||
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 :
|
||||
$args = null;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$fields = $ultimatemember->builtin->get_specific_fields( $args );
|
||||
$output = null;
|
||||
foreach( $fields as $key => $data ){
|
||||
$output .= $ultimatemember->fields->edit_field( $key, $data );
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
case 2:
|
||||
|
||||
if ( !is_user_logged_in() ){
|
||||
if ( !$access_redirect ) $access_redirect = home_url();
|
||||
if ( !$access_redirect ) $access_redirect = um_get_core_page('login');
|
||||
$redirect_to = $access_redirect;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
do_action('um_pre_account_update');
|
||||
|
||||
$tab = ( get_query_var('um_tab') ) ? get_query_var('um_tab') : 'general';
|
||||
|
||||
exit( wp_redirect( $ultimatemember->account->tab_link( $tab ) ) );
|
||||
@@ -218,6 +220,30 @@
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
*** @display tab "Notifications"
|
||||
***/
|
||||
add_action('um_account_tab__notifications', 'um_account_tab__notifications');
|
||||
function um_account_tab__notifications( $info ) {
|
||||
global $ultimatemember;
|
||||
extract( $info );
|
||||
extract( $info );
|
||||
|
||||
$output = $ultimatemember->account->get_tab_output('notifications');
|
||||
|
||||
if ( $output ) { ?>
|
||||
|
||||
<div class="um-account-heading uimob340-hide uimob500-hide"><i class="<?php echo $icon; ?>"></i><?php echo $title; ?></div>
|
||||
|
||||
<?php echo $output; ?>
|
||||
|
||||
<div class="um-col-alt um-col-alt-b"><div class="um-left"><input type="submit" name="um_account_submit" id="um_account_submit" value="<?php _e('Update Notifications','ultimatemember'); ?>" class="um-button" /></div><div class="um-clear"></div></div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
*** @display account photo and username
|
||||
***/
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ class UM_Mail {
|
||||
/***
|
||||
*** @mandrill compatibility
|
||||
***/
|
||||
function mandrill_nl2br($nl2br, $message) {
|
||||
function mandrill_nl2br($nl2br, $message = '') {
|
||||
|
||||
// text emails
|
||||
$nl2br = true;
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ class UM_Query {
|
||||
$real_role_slug = $role_slug;
|
||||
}
|
||||
} else {
|
||||
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_name = '$role_slug'");
|
||||
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'um_role' AND post_name = '$role_slug'");
|
||||
$real_role_slug = $role_slug;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,12 +98,14 @@ class UM_Shortcodes {
|
||||
}
|
||||
|
||||
$args = apply_filters('um_shortcode_args_filter', $args );
|
||||
|
||||
if ( um_profile_id() && isset( $args['role'] ) && $args['role'] && $args['role'] != $ultimatemember->query->get_role_by_userid( um_profile_id() ) )
|
||||
return;
|
||||
|
||||
extract( $args, EXTR_SKIP );
|
||||
|
||||
// for profiles only
|
||||
if ( $mode == 'profile' && um_profile_id() && isset( $args['role'] ) && $args['role'] &&
|
||||
$args['role'] != $ultimatemember->query->get_role_by_userid( um_profile_id() ) )
|
||||
return;
|
||||
|
||||
do_action("um_pre_{$mode}_shortcode", $args);
|
||||
|
||||
do_action("um_before_form_is_loaded", $args);
|
||||
|
||||
Reference in New Issue
Block a user