Coding dashboard, editor bugfix

This commit is contained in:
ultimatemember
2015-01-09 03:08:31 +02:00
parent 955e4ba9d8
commit c9a092ed48
24 changed files with 211 additions and 195 deletions
+24 -10
View File
@@ -89,6 +89,7 @@
float: left; float: left;
width: 202px; width: 202px;
min-height: 300px; min-height: 300px;
display: none !important;
} }
.um-admin-dash-nav a { .um-admin-dash-nav a {
@@ -133,16 +134,15 @@
- Main - Main
*/ */
.um-admin-dash-content {
display: none;
}
.um-admin-dash-main { .um-admin-dash-main {
margin-left: 201px; margin-left: 201px;
border-left: 1px solid #D8D8D8; border-left: 1px solid #D8D8D8;
padding: 0 30px 30px 30px; padding: 0 30px 30px 30px;
box-shadow: 0px 1px 0px #FFF inset; box-shadow: 0px 1px 0px #FFF inset;
min-height: 300px; min-height: 300px;
border-left: none;
margin-left: 0;
} }
.um-admin-dash-main h3{ .um-admin-dash-main h3{
@@ -151,6 +151,19 @@
margin: 0 !important; margin: 0 !important;
} }
.um-admin-dash-content {
display: none;
display: block;
}
.um-admin-dash-review {
text-decoration: none !important;
font-size: 16px;
position: absolute;
top: 0px;
right: 4px;
}
/* /*
- Share icons - Share icons
*/ */
@@ -176,8 +189,8 @@
.um-admin-dash-two-col .um-admin-dash-col { .um-admin-dash-two-col .um-admin-dash-col {
display: inline-block; display: inline-block;
width: 42%; width: 46%;
margin-right: 4%; margin-right: 3%;
vertical-align: top; vertical-align: top;
} }
@@ -200,7 +213,7 @@
.um-admin-dash-thumb { .um-admin-dash-thumb {
display: inline-block; display: inline-block;
width: 30px; width: 30px;
margin-right: 14px; margin-right: 10px;
} }
.um-admin-dash-thumb a, .um-admin-dash-thumb a,
@@ -212,14 +225,15 @@
.um-admin-dash-info { .um-admin-dash-info {
display: inline-block; display: inline-block;
width: 110px; width: 90px;
margin-right: 10px; margin-right: 6px;
} }
.um-admin-dash-meta { .um-admin-dash-meta {
display: inline-block; display: inline-block;
width: 100px; width: 100px;
margin-right: 10px; margin-right: 6px;
position: relative;
} }
.um-admin-dash-more { .um-admin-dash-more {
+5
View File
@@ -1,9 +1,12 @@
jQuery(document).ready(function() { jQuery(document).ready(function() {
/**
var active_tab = jQuery('.um-admin-dash-nav a.active').attr('data-rel'); var active_tab = jQuery('.um-admin-dash-nav a.active').attr('data-rel');
jQuery('.um-admin-dash-content').hide(); jQuery('.um-admin-dash-content').hide();
jQuery('.um-admin-dash-content#'+active_tab).show(); jQuery('.um-admin-dash-content#'+active_tab).show();
draw_linechart();
chart_ready = 0; chart_ready = 0;
jQuery(document).on('click', '.um-admin-dash-nav a', function(e){ jQuery(document).on('click', '.um-admin-dash-nav a', function(e){
@@ -20,4 +23,6 @@ jQuery(document).ready(function() {
return false; return false;
}); });
**/
}); });
+40 -16
View File
@@ -55,24 +55,38 @@ function um_admin_modal_ajaxcall( act_id, arg1, arg2, arg3 ) {
if ( jQuery('.um-admin-editor:visible').length > 0 ) { if ( jQuery('.um-admin-editor:visible').length > 0 ) {
tinyMCE.execCommand('mceRemoveEditor', true, 'um_editor'); if ( act_id == 'um_admin_edit_field_popup' ) {
jQuery('.um-admin-editor').html( jQuery('.um-hidden-editor-container').contents() );
tinyMCE.execCommand('mceAddEditor', true, 'um_editor');
jQuery('.switch-html').trigger('click'); tinyMCE.execCommand('mceRemoveEditor', true, 'um_editor_edit');
jQuery('.switch-html').trigger('click'); jQuery('.um-admin-editor:visible').html( jQuery('.um-hidden-editor-edit').contents() );
jQuery('.switch-tmce').trigger('click'); tinyMCE.execCommand('mceAddEditor', true, 'um_editor_edit');
jQuery('.switch-html').trigger('click');
jQuery('.switch-html').trigger('click');
jQuery('.switch-tmce').trigger('click');
jQuery('#um_editor_edit_ifr').height(200);
var editor = tinyMCE.get('um_editor_edit');
var content = editor.getContent();
editor.setContent( jQuery('.um-admin-modal:visible .dynamic-mce-content').html() );
} else {
jQuery('#um_editor_ifr').height(200); tinyMCE.execCommand('mceRemoveEditor', true, 'um_editor_new');
jQuery('.um-admin-editor:visible').html( jQuery('.um-hidden-editor-new').contents() );
tinyMCE.execCommand('mceAddEditor', true, 'um_editor_new');
jQuery('.switch-html').trigger('click');
jQuery('.switch-html').trigger('click');
jQuery('.switch-tmce').trigger('click');
jQuery('#um_editor_new_ifr').height(200);
}
} }
if ( jQuery('.dynamic-mce-content').length > 0 ) {
var editor = tinyMCE.get('um_editor');
var content = editor.getContent();
editor.setContent( jQuery('.dynamic-mce-content').html() );
}
}, },
error: function(data){ error: function(data){
@@ -90,9 +104,19 @@ function um_admin_remove_modal(){
if ( jQuery('.um-admin-editor:visible').length > 0 ) { if ( jQuery('.um-admin-editor:visible').length > 0 ) {
tinyMCE.execCommand('mceRemoveEditor', true, 'um_editor'); if ( jQuery('.um-admin-modal:visible').find('form').parent().attr('id') == 'UM_edit_field' ) {
jQuery('.um-hidden-editor-container').html( jQuery('.um-admin-editor').contents() );
tinyMCE.execCommand('mceAddEditor', true, 'um_editor'); tinyMCE.execCommand('mceRemoveEditor', true, 'um_editor_edit');
jQuery('.um-hidden-editor-edit').html( jQuery('.um-admin-editor:visible').contents() );
tinyMCE.execCommand('mceAddEditor', true, 'um_editor_edit');
} else {
tinyMCE.execCommand('mceRemoveEditor', true, 'um_editor_new');
jQuery('.um-hidden-editor-new').html( jQuery('.um-admin-editor:visible').contents() );
tinyMCE.execCommand('mceAddEditor', true, 'um_editor_new');
}
} }
+1 -1
View File
@@ -40,7 +40,7 @@
$save[ $_metakey ][$new_key] = $val; $save[ $_metakey ][$new_key] = $val;
} }
} else if ( $key == 'um_editor' ) { } else if ( strstr( $key, 'um_editor' ) ) {
$save[ $_metakey ]['content'] = $val; $save[ $_metakey ]['content'] = $val;
} }
+6 -2
View File
@@ -362,8 +362,12 @@ class UM_Admin_Metabox {
$settings['textarea_rows'] = 8; $settings['textarea_rows'] = 8;
echo '<div class="um-hidden-editor-container" style="display:none">'; echo '<div class="um-hidden-editor-edit" style="display: none">';
wp_editor( '', 'um_editor', $settings ); wp_editor( '', 'um_editor_edit', $settings );
echo '</div>';
echo '<div class="um-hidden-editor-new" style="display: none">';
wp_editor( '', 'um_editor_new', $settings );
echo '</div>'; echo '</div>';
} }
+6 -8
View File
@@ -24,17 +24,15 @@
<div class="um-admin-dash-main"> <div class="um-admin-dash-main">
<div class="um-admin-dash-content" id="overview"> <?php $tabs = array('overview', 'analytics'); ?>
<?php include_once um_path . 'admin/templates/dashboard/overview.php'; ?> <?php foreach( $tabs as $tab ) { ?>
<div class="um-admin-dash-content" id="<?php echo $tab; ?>">
<?php include_once um_path . 'admin/templates/dashboard/'. $tab . '.php'; ?>
</div> </div>
<?php } ?>
<div class="um-admin-dash-content" id="analytics">
<?php include_once um_path . 'admin/templates/dashboard/analytics.php'; ?>
</div>
</div> </div>
-3
View File
@@ -1,3 +0,0 @@
<h3>New Registrations over last 30 days</h3>
<?php echo $ultimatemember->chart->create('data=new_users&x_label=Day&y_label=Daily Signups'); ?>
+9 -32
View File
@@ -16,9 +16,7 @@
<a href="<?php echo um_user_profile_url(); ?>" target="_blank"><?php echo um_user('display_name'); ?></a> <a href="<?php echo um_user_profile_url(); ?>" target="_blank"><?php echo um_user('display_name'); ?></a>
</div> </div>
<div class="um-admin-dash-meta"> <div class="um-admin-dash-meta"><?php echo date( "j M H:i", strtotime( um_user('user_registered') ) ); ?></div>
<?php echo date( "j M H:i", strtotime( um_user('user_registered') ) ); ?>
</div>
<div class="um-admin-dash-more"> <div class="um-admin-dash-more">
@@ -47,25 +45,21 @@
<a href="<?php echo um_user_profile_url(); ?>" target="_blank"><?php echo um_user('display_name'); ?></a> <a href="<?php echo um_user_profile_url(); ?>" target="_blank"><?php echo um_user('display_name'); ?></a>
</div> </div>
<div class="um-admin-dash-meta"> <div class="um-admin-dash-meta"><?php echo date( "j M H:i", strtotime( um_user('user_registered') ) ); ?>
<?php <?php
if ( um_user('submitted') ) { if ( um_user('submitted') ) {
echo '<a href="#" class="um-admin-dash-review um-admin-tipsy-n" data-modal="UM_preview_registration" data-modal-size="smaller" data-dynamic-content="um_admin_review_registration" data-arg1="'.$user_id.'" data-arg2="edit_registration" title="Review registration info"><i class="um-icon-info"></i></a>';
echo '<a href="#" class="um-admin-tipsy-n" data-modal="UM_preview_registration" data-modal-size="smaller" data-dynamic-content="um_admin_review_registration" data-arg1="'.$user_id.'" data-arg2="edit_registration" title="Review/update registration info">Review details</a>';
} else {
echo '<em>No information available</em>';
} }
?> ?>
</div> </div>
<div class="um-admin-dash-more"> <div class="um-admin-dash-more">
<a href="<?php echo $ultimatemember->permalinks->admin_act_url('user_action','um_approve_membership'); ?>" class="ok">Approve</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="<?php echo $ultimatemember->permalinks->admin_act_url('user_action','um_reject_membership'); ?>" class="red">Reject</a>
</div> </div>
</div> </div>
@@ -99,12 +93,10 @@
<a href="<?php echo um_user_profile_url(); ?>" target="_blank"><?php echo um_user('display_name'); ?></a> <a href="<?php echo um_user_profile_url(); ?>" target="_blank"><?php echo um_user('display_name'); ?></a>
</div> </div>
<div class="um-admin-dash-meta"> <div class="um-admin-dash-meta"><?php echo date( "j M H:i", strtotime( um_user('user_registered') ) ); ?></div>
<?php echo date( "j M Y", strtotime( um_user('user_registered') ) ); ?>
</div>
<div class="um-admin-dash-more"> <div class="um-admin-dash-more">
<a href="<?php echo $ultimatemember->permalinks->admin_act_url('user_action','um_resend_activation'); ?>" class="ok">Resend Email</a>
</div> </div>
</div> </div>
@@ -134,25 +126,10 @@
<a href="<?php echo um_user_profile_url(); ?>" target="_blank"><?php echo um_user('display_name'); ?></a> <a href="<?php echo um_user_profile_url(); ?>" target="_blank"><?php echo um_user('display_name'); ?></a>
</div> </div>
<div class="um-admin-dash-meta"> <div class="um-admin-dash-meta"><?php echo date( "j M H:i", strtotime( um_user('user_registered') ) ); ?></div>
<?php
if ( um_user('submitted') ) {
echo '<a href="#" class="um-admin-tipsy-n" data-modal="UM_preview_registration" data-modal-size="smaller" data-dynamic-content="um_admin_review_registration" data-arg1="'.$user_id.'" data-arg2="edit_registration" title="Review/update registration info">Review details</a>';
} else {
echo '<em>No information available</em>';
}
?>
</div>
<div class="um-admin-dash-more"> <div class="um-admin-dash-more">
<a href="<?php echo $ultimatemember->permalinks->admin_act_url('user_action','um_reenable'); ?>" class="ok">Re-activate</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="<?php echo $ultimatemember->permalinks->admin_act_url('user_action','um_delete'); ?>" class="red">Delete</a>
</div> </div>
</div> </div>
@@ -9,9 +9,7 @@
</div> </div>
<div class="um-admin-modal-foot"> <div class="um-admin-modal-foot">
<a href="#" class="button-primary"><?php _e('Update','ultimatemember'); ?></a>
<a href="#" class="button-primary"><?php _e('Approve','ultimatemember'); ?></a>
<a href="#" class="button"><?php _e('Reject','ultimatemember'); ?></a>
</div> </div>
</div> </div>
+5 -5
View File
@@ -98,7 +98,7 @@ div.uimob340 .um-profile-photo {
width: 100% !important; width: 100% !important;
text-align: center !important; text-align: center !important;
position: absolute; position: absolute;
top: -20px; top: -40px;
left: 0; left: 0;
} }
@@ -117,7 +117,7 @@ div.uimob340 .um-header .um-profile-meta {
padding-left: 0 !important; padding-left: 0 !important;
padding-right: 0 !important; padding-right: 0 !important;
text-align: center !important; text-align: center !important;
padding-top: 90px !important; padding-top: 70px !important;
} }
div.uimob340 .um-header .um-name { div.uimob340 .um-header .um-name {
@@ -281,8 +281,8 @@ div.uimob500 .um-profile-photo {
} }
div.uimob500 .um-profile-photo a.um-profile-photo-img { div.uimob500 .um-profile-photo a.um-profile-photo-img {
width: 110px !important; width: 100px !important;
height: 110px !important; height: 100px !important;
margin: 0 auto !important; margin: 0 auto !important;
float: none !important; float: none !important;
display: inline-block !important; display: inline-block !important;
@@ -295,7 +295,7 @@ div.uimob500 .um-header .um-profile-meta {
padding-left: 0 !important; padding-left: 0 !important;
padding-right: 0 !important; padding-right: 0 !important;
text-align: center !important; text-align: center !important;
padding-top: 80px !important; padding-top: 70px !important;
} }
div.uimob500 .um-header .um-name { div.uimob500 .um-header .um-name {
+2 -1
View File
@@ -33,8 +33,9 @@
/* only in admin mode */ /* only in admin mode */
.um.um-in-admin { .um.um-in-admin {
padding-top: 0; padding-top: 0;
margin-bottom: 10px; margin-bottom: 0 !important;
} }
.um.um-in-admin .um-tip {display: none !important}
.um input, .um input,
.um select, .um select,
+8 -1
View File
@@ -132,7 +132,7 @@
$form_id = $args['form_id']; $form_id = $args['form_id'];
$mode = $args['mode']; $mode = $args['mode'];
$fields = unserialize( $args['custom_fields'] ); $fields = unserialize( $args['custom_fields'] );
foreach( $fields as $key => $array ) { foreach( $fields as $key => $array ) {
if ( isset( $array['required'] ) && $array['required'] == 1 ) { if ( isset( $array['required'] ) && $array['required'] == 1 ) {
@@ -286,4 +286,11 @@
} }
if ( isset( $args['description'] ) ) {
$max_chars = um_get_option('profile_bio_maxchars');
if ( strlen( utf8_decode( $args['description'] ) ) > $max_chars && $max_chars ) {
$ultimatemember->form->add_error('description', sprintf(__('Your user description must contain less than %s characters'), $max_chars ) );
}
}
} }
+5 -1
View File
@@ -209,6 +209,10 @@
<div class="um-meta-text"> <div class="um-meta-text">
<textarea placeholder="<?php _e('Tell us a bit about yourself...','ultimatemember'); ?>" name="<?php echo 'description-' . $args['form_id']; ?>" id="<?php echo 'description-' . $args['form_id']; ?>"><?php if ( um_user('description') ) { echo um_user('description'); } ?></textarea> <textarea placeholder="<?php _e('Tell us a bit about yourself...','ultimatemember'); ?>" name="<?php echo 'description-' . $args['form_id']; ?>" id="<?php echo 'description-' . $args['form_id']; ?>"><?php if ( um_user('description') ) { echo um_user('description'); } ?></textarea>
<?php if ( $ultimatemember->fields->is_error('description') )
echo $ultimatemember->fields->field_error( $ultimatemember->fields->show_error('description') ); ?>
</div> </div>
<?php } ?> <?php } ?>
@@ -372,7 +376,7 @@
} }
if ( isset( $args['submitted']['description'] ) ) { if ( isset( $args['submitted']['description'] ) ) {
$to_update['description'] = $args['submitted']['description']; $to_update['description'] = $ultimatemember->validation->remove_html( $args['submitted']['description'] );
} }
if ( is_array( $to_update ) ) { if ( is_array( $to_update ) ) {
-23
View File
@@ -1,28 +1,5 @@
<?php <?php
/***
*** @listen to a new user deletion
***/
function um_notify_delete_user($user_id) {
global $ultimatemember;
// send the admin an email
$ultimatemember->mail->send( um_admin_email(), 'notification_deletion' );
// increase the num. of deleted accounts that day
$UM_deleted_users = get_option('um_deleted_users');
if (!isset($UM_deleted_users[ date('Y-m-d') ] )){
$UM_deleted_users[ date('Y-m-d') ] = 1;
} else {
$UM_deleted_users[ date('Y-m-d') ] = $UM_deleted_users[ date('Y-m-d') ] +1;
}
update_option('um_deleted_users', $UM_deleted_users);
}
add_action("delete_user", "um_notify_delete_user");
/*** /***
*** @listen to a new user creation in backend *** @listen to a new user creation in backend
***/ ***/
+4 -8
View File
@@ -128,8 +128,8 @@ class UM_Builtin {
'textarea' => array( 'textarea' => array(
'name' => 'Textarea', 'name' => 'Textarea',
'col1' => array('_title','_metakey','_help','_height','_max_chars','_max_words','_html'), 'col1' => array('_title','_metakey','_help','_height','_max_chars','_max_words'),
'col2' => array('_label','_placeholder','_public','_roles','_default'), 'col2' => array('_label','_placeholder','_public','_roles','_default','_html'),
'col3' => array('_required','_editable','_icon'), 'col3' => array('_required','_editable','_icon'),
'validate' => array( 'validate' => array(
'_title' => array( '_title' => array(
@@ -363,10 +363,6 @@ class UM_Builtin {
'mode' => 'required', 'mode' => 'required',
'error' => 'You must provide a title' 'error' => 'You must provide a title'
), ),
'um_editor' => array(
'mode' => 'required',
'error' => 'You must add some content first'
),
) )
), ),
@@ -413,7 +409,7 @@ class UM_Builtin {
) )
), ),
'group' => array( /*'group' => array(
'name' => 'Field Group', 'name' => 'Field Group',
'col1' => array('_title','_max_entries'), 'col1' => array('_title','_max_entries'),
'col2' => array('_label','_public','_roles'), 'col2' => array('_label','_public','_roles'),
@@ -428,7 +424,7 @@ class UM_Builtin {
'error' => 'You must provide a label' 'error' => 'You must provide a label'
), ),
) )
), ),*/
); );
+2 -20
View File
@@ -55,29 +55,11 @@ class UM_Chart {
data.addColumn('number', '<?php echo $y_label; ?>'); data.addColumn('number', '<?php echo $y_label; ?>');
<?php <?php
if ($data == 'new_users'){
$data_y = $ultimatemember->datetime->get_last_days( $days );
}
if ($data == 'deleted_users'){
$data_y = $ultimatemember->query->deleted_users_per_day( $days );
}
if (isset($data_y) && !empty($data_y)){ if (isset($data_y) && !empty($data_y)){
foreach($data_y as $key => $val){ foreach($data_y as $key => $val){
if ($data == 'new_users'){
$row_value = $ultimatemember->query->count_users_registered_on( $key );
?>data.addRow(['<?php echo $val; ?>', <?php echo $row_value; ?>]);<?php
}
if ($data == 'deleted_users'){
$key = $ultimatemember->datetime->format( $key, 'm/d' );
?>data.addRow(['<?php echo $key; ?>', <?php echo $val; ?>]);<?php
}
} }
} }
+6
View File
@@ -788,6 +788,12 @@ class UM_Fields {
return; return;
} }
} }
if ( isset( $ultimatemember->user->preview ) && $ultimatemember->user->preview ) {
if ( $data['type'] == 'password' ){
return;
}
}
/* Begin by field type */ /* Begin by field type */
+1 -1
View File
@@ -79,7 +79,7 @@ class UM_Form {
if ( $form_timestamp == '' ) if ( $form_timestamp == '' )
wp_die( __('Hello, spam bot!') ); wp_die( __('Hello, spam bot!') );
if ( $live_timestamp - $form_timestamp < 5 ) if ( $live_timestamp - $form_timestamp < 3 )
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!') ); 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!') );
} }
-36
View File
@@ -297,41 +297,5 @@ class UM_Query {
return $roles; return $roles;
} }
/***
*** @Number of users registered on specific day
***/
function count_users_registered_on( $date='' ){
global $wpdb;
// defaults to today
if( empty($date) )
$date = date('Y-m-d');
$morning = new DateTime($date. ' 00:00:00');
$night = new DateTime($date.' 23:59:59');
$m = $morning->format('Y-m-d H:i:s');
$n = $night->format('Y-m-d H:i:s');
$sql = $wpdb->prepare("SELECT wp_users.* FROM wp_users WHERE 1=1 AND CAST(user_registered AS DATE) BETWEEN %s AND %s ORDER BY user_login ASC",$m,$n);
$users = $wpdb->get_results($sql);
return $wpdb->num_rows;
}
/***
*** @Get deleted users count for last x days
***/
function deleted_users_per_day( $limit = 30 ){
$option = get_option('um_deleted_users');
if (is_array($option)){
$slice = array_slice($option, 0, $limit);
$reverse = array_reverse($slice);
return $reverse;
} else {
return null;
}
}
} }
+2 -1
View File
@@ -40,7 +40,7 @@ class UM_Setup {
'_um_search' => 0, '_um_search' => 0,
'_um_userinfo_animate' => '1', '_um_userinfo_animate' => '1',
'_um_directory_header' => __('{total_users} Members','ultimatemember'), '_um_directory_header' => __('{total_users} Members','ultimatemember'),
'_um_directory_no_users' => __('We are sorry. We cannot find any users who match your search criteria.','ultimatemember'), '_um_directory_no_users' => __('Sorry, we cannot find any users who match your search criteria.','ultimatemember'),
'_um_sortby' => 'user_registered_desc', '_um_sortby' => 'user_registered_desc',
'_um_profile_photo' => '1', '_um_profile_photo' => '1',
'_um_cover_photos' => '1', '_um_cover_photos' => '1',
@@ -85,6 +85,7 @@ class UM_Setup {
'_um_secondary_btn_text' => '#666', '_um_secondary_btn_text' => '#666',
'_um_profile_show_name' => 1, '_um_profile_show_name' => 1,
'_um_profile_show_bio' => 1, '_um_profile_show_bio' => 1,
'_um_profile_bio_maxchars' => 180,
'_um_profile_role' => '0', '_um_profile_role' => '0',
'_um_profile_template' => 'profile', '_um_profile_template' => 'profile',
'_um_profile_max_width' => '1000px', '_um_profile_max_width' => '1000px',
+14 -3
View File
@@ -252,9 +252,17 @@ class UM_User {
***/ ***/
function approve(){ function approve(){
global $ultimatemember; global $ultimatemember;
if ( um_user('account_status') == 'awaiting_admin_review' ) {
$email_tpl = 'approved_email';
} else {
$email_tpl = 'welcome_email';
}
$this->set_status('approved'); $this->set_status('approved');
$this->delete_meta('account_secret_hash'); $this->delete_meta('account_secret_hash');
$ultimatemember->mail->send( um_user('user_email'), 'approved_email' );
$ultimatemember->mail->send( um_user('user_email'), $email_tpl );
} }
/*** /***
@@ -282,6 +290,7 @@ class UM_User {
function reject(){ function reject(){
global $ultimatemember; global $ultimatemember;
$this->set_status('rejected'); $this->set_status('rejected');
$this->delete( false );
$ultimatemember->mail->send( um_user('user_email'), 'rejected_email' ); $ultimatemember->mail->send( um_user('user_email'), 'rejected_email' );
} }
@@ -297,10 +306,12 @@ class UM_User {
/*** /***
*** @delete user *** @delete user
***/ ***/
function delete() { function delete( $send_mail = true ) {
global $ultimatemember; global $ultimatemember;
$ultimatemember->mail->send( um_user('user_email'), 'deletion_email' ); if ( $send_mail ) {
$ultimatemember->mail->send( um_user('user_email'), 'deletion_email' );
}
require_once( ABSPATH . 'wp-admin/includes/user.php' ); require_once( ABSPATH . 'wp-admin/includes/user.php' );
+7
View File
@@ -10,6 +10,13 @@ class UM_Validation {
} }
/***
*** @removes html from any string
***/
function remove_html($string) {
return wp_strip_all_tags( $string );
}
/*** /***
*** @normalize a string *** @normalize a string
***/ ***/
+6 -8
View File
@@ -8,20 +8,18 @@
if ( !isset( $ultimatemember->password->reset_request ) ) { if ( !isset( $ultimatemember->password->reset_request ) ) {
do_action('um_reset_password_page_hidden_fields', $args ); do_action('um_reset_password_page_hidden_fields', $args );
do_action('um_reset_password_form', $args ); do_action('um_reset_password_form', $args );
do_action("um_after_form_fields", $args); do_action("um_after_form_fields", $args);
} else { } else {
echo '<div class="um-field-block">'; echo '<div class="um-field-block">';
echo '<p>A password reset link has been sent to <strong>'. $ultimatemember->password->reset_request['user_email'] . '</strong> for your <strong>'. um_get_option('site_name') . '</strong> account.</p>'; echo '<p>A password reset link has been sent to <strong>' . $ultimatemember->password->reset_request['user_email'] . '</strong>. Please check your inbox!</p>';
echo '<p>Please check your inbox!</p>';
echo '</div>'; echo '</div>';
} }
+57 -12
View File
@@ -391,29 +391,29 @@ $this->sections[] = array(
), ),
array( array(
'id' => 'approved_email_on', 'id' => 'welcome_email_on',
'type' => 'switch', 'type' => 'switch',
'title' => __( 'Account Approved Email' ), 'title' => __( 'Account Welcome Email' ),
'default' => 1, 'default' => 1,
'desc' => 'Whether to send the user an email when his account is approved', 'desc' => 'Whether to send the user an email when his account is automatically approved',
), ),
array( array(
'id' => 'approved_email_sub', 'id' => 'welcome_email_sub',
'type' => 'text', 'type' => 'text',
'title' => __( 'Account Approved Email' ), 'title' => __( 'Account Welcome Email' ),
'subtitle' => __( 'Subject Line' ), 'subtitle' => __( 'Subject Line' ),
'default' => 'Your account at {site_name} is now active', 'default' => 'Welcome to {site_name}!',
'required' => array( 'approved_email_on', '=', 1 ), 'required' => array( 'welcome_email_on', '=', 1 ),
'desc' => 'This is the subject line of the e-mail', 'desc' => 'This is the subject line of the e-mail',
), ),
array( array(
'id' => 'approved_email', 'id' => 'welcome_email',
'type' => 'textarea', 'type' => 'textarea',
'title' => __( 'Account Approved Email' ), 'title' => __( 'Account Welcome Email' ),
'subtitle' => __( 'Message Body' ), 'subtitle' => __( 'Message Body' ),
'required' => array( 'approved_email_on', '=', 1 ), 'required' => array( 'welcome_email_on', '=', 1 ),
'default' => 'Hi {display_name},' . "\r\n\r\n" . 'default' => 'Hi {display_name},' . "\r\n\r\n" .
'Thank you for signing up with {site_name}! Your account is now active.' . "\r\n\r\n" . 'Thank you for signing up with {site_name}! Your account is now active.' . "\r\n\r\n" .
'To login please visit the following url:' . "\r\n\r\n" . 'To login please visit the following url:' . "\r\n\r\n" .
@@ -425,7 +425,7 @@ $this->sections[] = array(
'Thanks,' . "\r\n" . 'Thanks,' . "\r\n" .
'{site_name}', '{site_name}',
), ),
array( array(
'id' => 'checkmail_email_on', 'id' => 'checkmail_email_on',
'type' => 'switch', 'type' => 'switch',
@@ -457,7 +457,7 @@ $this->sections[] = array(
'Thanks,' . "\r\n" . 'Thanks,' . "\r\n" .
'{site_name}', '{site_name}',
), ),
array( array(
'id' => 'pending_email_on', 'id' => 'pending_email_on',
'type' => 'switch', 'type' => 'switch',
@@ -489,7 +489,43 @@ $this->sections[] = array(
'Thanks,' . "\r\n" . 'Thanks,' . "\r\n" .
'{site_name}', '{site_name}',
), ),
array(
'id' => 'approved_email_on',
'type' => 'switch',
'title' => __( 'Account Approved Email' ),
'default' => 1,
'desc' => 'Whether to send the user an email when his account is approved',
),
array(
'id' => 'approved_email_sub',
'type' => 'text',
'title' => __( 'Account Approved Email' ),
'subtitle' => __( 'Subject Line' ),
'default' => 'Your account at {site_name} is now active',
'required' => array( 'approved_email_on', '=', 1 ),
'desc' => 'This is the subject line of the e-mail',
),
array(
'id' => 'approved_email',
'type' => 'textarea',
'title' => __( 'Account Approved Email' ),
'subtitle' => __( 'Message Body' ),
'required' => array( 'approved_email_on', '=', 1 ),
'default' => 'Hi {display_name},' . "\r\n\r\n" .
'Thank you for signing up with {site_name}! Your account has been approved and is now active.' . "\r\n\r\n" .
'To login please visit the following url:' . "\r\n\r\n" .
'{login_url}' . "\r\n\r\n" .
'Your account e-mail: {email}' . "\r\n" .
'Your account username: {username}' . "\r\n" .
'Your account password: {password}' . "\r\n\r\n" .
'If you have any problems, please contact us at {admin_email}' . "\r\n\r\n" .
'Thanks,' . "\r\n" .
'{site_name}',
),
array( array(
'id' => 'rejected_email_on', 'id' => 'rejected_email_on',
'type' => 'switch', 'type' => 'switch',
@@ -1217,6 +1253,15 @@ $this->sections[] = array(
'desc' => 'Switch on/off the user description on profile header', 'desc' => 'Switch on/off the user description on profile header',
), ),
array(
'id' => 'profile_bio_maxchars',
'type' => 'text',
'title' => __( 'User description maximum chars' ),
'default' => um_get_metadefault('profile_bio_maxchars'),
'desc' => 'Maximum number of characters to allow in user description field in header.',
'required' => array( 'profile_show_bio', '=', 1 ),
),
) )
); );