• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wppb_notify_user_registration_email函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wppb_notify_user_registration_email函数的典型用法代码示例。如果您正苦于以下问题:PHP wppb_notify_user_registration_email函数的具体用法?PHP wppb_notify_user_registration_email怎么用?PHP wppb_notify_user_registration_email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wppb_notify_user_registration_email函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wppb_front_end_register


//.........这里部分代码省略.........
                                    /* when trying to upload file, be sure it's one of the accepted image file-types */
                                    if (($_FILES[$uploadedfile]['type'] == 'image/jpeg' || $_FILES[$uploadedfile]['type'] == 'image/jpg' || $_FILES[$uploadedfile]['type'] == 'image/png' || $_FILES[$uploadedfile]['type'] == 'image/bmp' || $_FILES[$uploadedfile]['type'] == 'image/pjpeg' || $_FILES[$uploadedfile]['type'] == 'image/x-png') && ($_FILES[$uploadedfile]['size'] < WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE && $_FILES[$uploadedfile]['size'] != 0)) {
                                        $wp_filetype = wp_check_filetype(basename($_FILES[$uploadedfile]['name']), null);
                                        $attachment = array('post_mime_type' => $wp_filetype['type'], 'post_title' => $fileName, 'post_content' => '', 'post_status' => 'inherit');
                                        $attach_id = wp_insert_attachment($attachment, $target_path);
                                        $upFile = image_downsize($attach_id, 'thumbnail');
                                        $upFile = $upFile[0];
                                        //if file upload succeded
                                        if (move_uploaded_file($_FILES[$uploadedfile]['tmp_name'], $target_path)) {
                                            add_user_meta($new_user, $value['item_metaName'], $upFile);
                                            wppb_resize_avatar($new_user);
                                            $avatarUpload = 'yes';
                                        } else {
                                            $avatarUpload = 'no';
                                        }
                                    }
                                    if ($_FILES[$uploadedfile]['type'] == '') {
                                        $avatarUpload = 'yes';
                                    }
                                    break;
                            }
                        }
                    }
                    // if admin approval is activated, then block the user untill he gets approved
                    $wppb_generalSettings = get_option('wppb_general_settings', 'not_found');
                    if ($wppb_generalSettings != 'not_found') {
                        if ($wppb_generalSettings['adminApproval'] == 'yes') {
                            wp_set_object_terms($new_user, array('unapproved'), 'user_status', false);
                            clean_object_term_cache($new_user, 'user_status');
                        }
                    }
                    // send an email to the admin, and - if selected - to the user also.
                    $bloginfo = get_bloginfo('name');
                    $sentEmailStatus = wppb_notify_user_registration_email($bloginfo, esc_attr($_POST['user_name']), esc_attr($_POST['email']), $_POST['send_credentials_via_email'], $_POST['passw1'], $wppb_generalSettings['adminApproval']);
                }
            } elseif (is_multisite()) {
                //validate username and email
                $validationRes = wpmu_validate_user_signup($userdata['user_login'], $userdata['user_email']);
                $error = apply_filters('wppb_register_wpmu_registration_error', $validationRes['errors']->get_error_message());
                if (trim($error) != '') {
                } else {
                    $new_user = 'yes';
                    $multisite_message = true;
                    $meta = array('user_pass' => base64_encode($userdata['user_pass']), 'first_name' => $userdata['first_name'], 'last_name' => $userdata['last_name'], 'nickname' => $userdata['nickname'], 'user_url' => $userdata['user_url'], 'aim' => $userdata['aim'], 'yim' => $userdata['yim'], 'jabber' => $userdata['jabber'], 'description' => $userdata['description'], 'role' => $userdata['role']);
                    $meta = wppb_add_custom_field_values($_POST, $meta);
                    wppb_signup_user($userdata['user_login'], $userdata['user_email'], $meta);
                }
            }
        }
    }
    ?>
	<div class="wppb_holder" id="wppb_register">
<?php 
    if (is_user_logged_in() && !current_user_can('create_users')) {
        global $user_ID;
        $login = get_userdata($user_ID);
        if ($login->display_name == '') {
            $login->display_name = $login->user_login;
        }
        $registerFilterArray['loginLogoutError'] = '
				<p class="log-in-out alert">' . __('You are logged in as', 'profilebuilder') . ' <a href="' . get_author_posts_url($login->ID) . '" title="' . $login->display_name . '">' . $login->display_name . '</a>. ' . __('You don\'t need another account.', 'profilebuilder') . ' <a href="' . wp_logout_url(get_permalink()) . '" title="' . __('Log out of this account.', 'profilebuilder') . '">' . __('Logout', 'profilebuilder') . '  &raquo;</a></p><!-- .log-in-out .alert -->';
        $registerFilterArray['loginLogoutError'] = apply_filters('wppb_register_have_account_alert', $registerFilterArray['loginLogoutError'], $login->ID);
        echo $registerFilterArray['loginLogoutError'];
    } elseif ($new_user != 'no') {
        if (current_user_can('create_users')) {
            if ($multisite_message) {
开发者ID:par-orillonsoft,项目名称:elearning-wordpress,代码行数:67,代码来源:wppb.register.php


示例2: wppb_save_form_values

 function wppb_save_form_values($global_request)
 {
     $user_id = $this->wppb_get_desired_user_id();
     $userdata = apply_filters('wppb_build_userdata', array(), $global_request);
     $new_user_signup = false;
     $wppb_general_settings = get_option('wppb_general_settings');
     if (isset($wppb_general_settings['loginWith']) && $wppb_general_settings['loginWith'] == 'email') {
         $userdata['user_login'] = apply_filters('wppb_generated_random_username', Wordpress_Creation_Kit_PB::wck_generate_slug(trim($userdata['user_email'])), $userdata['user_email']);
     }
     if ($this->args['form_type'] == 'register') {
         if (!is_multisite()) {
             if (isset($wppb_general_settings['emailConfirmation']) && $wppb_general_settings['emailConfirmation'] == 'yes') {
                 $new_user_signup = true;
                 $multisite_message = true;
                 $userdata = $this->wppb_add_custom_field_values($global_request, $userdata, $this->args['form_fields']);
                 if (!isset($userdata['role'])) {
                     $userdata['role'] = $this->args['role'];
                 }
                 $userdata['user_pass'] = wp_hash_password($userdata['user_pass']);
                 wppb_signup_user($userdata['user_login'], $userdata['user_email'], $userdata);
             } else {
                 if (!isset($userdata['role'])) {
                     $userdata['role'] = $this->args['role'];
                 }
                 $userdata = wp_unslash($userdata);
                 $user_id = wp_insert_user($userdata);
             }
         } else {
             $new_user_signup = true;
             $multisite_message = true;
             $userdata = $this->wppb_add_custom_field_values($global_request, $userdata, $this->args['form_fields']);
             if (!isset($userdata['role'])) {
                 $userdata['role'] = $this->args['role'];
             }
             $userdata['user_pass'] = wp_hash_password($userdata['user_pass']);
             /* since version 2.0.7 add this meta so we know on what blog the user registered */
             $userdata['registered_for_blog_id'] = get_current_blog_id();
             $userdata = wp_unslash($userdata);
             wppb_signup_user($userdata['user_login'], $userdata['user_email'], $userdata);
         }
     } elseif ($this->args['form_type'] == 'edit_profile') {
         $userdata['ID'] = $this->wppb_get_desired_user_id();
         $userdata = wp_unslash($userdata);
         /* if the user changes his password then we can't send it to the wp_update_user() function or
            the user will be logged out and won't be logged in again because we call wp_update_user() after
            the headers were sent( in the content as a shortcode ) */
         if (isset($userdata['user_pass']) && !empty($userdata['user_pass'])) {
             unset($userdata['user_pass']);
         }
         wp_update_user($userdata);
     }
     if (!empty($this->args['form_fields']) && !$new_user_signup) {
         foreach ($this->args['form_fields'] as $field) {
             do_action('wppb_save_form_field', $field, $user_id, $global_request, $this->args['form_type']);
         }
         if ($this->args['form_type'] == 'register') {
             if (!is_wp_error($user_id)) {
                 $wppb_general_settings = get_option('wppb_general_settings');
                 if (isset($global_request['send_credentials_via_email']) && $global_request['send_credentials_via_email'] == 'sending') {
                     $send_credentials_via_email = 'sending';
                 } else {
                     $send_credentials_via_email = '';
                 }
                 wppb_notify_user_registration_email(get_bloginfo('name'), isset($userdata['user_login']) ? trim($userdata['user_login']) : trim($userdata['user_email']), trim($userdata['user_email']), $send_credentials_via_email, trim($userdata['user_pass']), isset($wppb_general_settings['adminApproval']) ? $wppb_general_settings['adminApproval'] : 'no');
             }
         }
     }
     return $user_id;
 }
开发者ID:RuseHackV2,项目名称:Go-Out,代码行数:69,代码来源:class-formbuilder.php


示例3: wppb_activate_signup

/**
 * Activate a signup.
 *
 *
 * @param string $key The activation key provided to the user.
 * @return array An array containing information about the activated user and/or blog
 */
function wppb_activate_signup($key)
{
    global $wpdb;
    $bloginfo = get_bloginfo('name');
    $wppb_general_settings = get_option('wppb_general_settings');
    $signup = is_multisite() ? $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->signups} WHERE activation_key = %s", $key)) : $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->base_prefix . "signups WHERE activation_key = %s", $key));
    if (empty($signup)) {
        return apply_filters('wppb_register_activate_user_error_message1', '<p class="error">' . __('Invalid activation key!', 'profilebuilder') . '</p>');
    }
    if ($signup->active) {
        if (empty($signup->domain)) {
            return apply_filters('wppb_register_activate_user_error_message2', '<p class="error">' . __('This username is now active!', 'profilebuilder') . '</p>');
        }
    }
    $meta = unserialize($signup->meta);
    $user_login = isset($wppb_general_settings['loginWith']) && $wppb_general_settings['loginWith'] == 'email' ? trim($signup->user_email) : trim($signup->user_login);
    $user_email = esc_sql($signup->user_email);
    /* the password is in hashed form in the signup table so we will add it later */
    $password = NULL;
    $user_id = username_exists($user_login);
    if (!$user_id) {
        $user_id = wppb_create_user($user_login, $password, $user_email);
    } else {
        $user_already_exists = true;
    }
    if (!$user_id) {
        return apply_filters('wppb_register_activate_user_error_message4', '<p class="error">' . __('Could not create user!', 'profilebuilder') . '</p>');
    } elseif (isset($user_already_exists) && $user_already_exists == true) {
        return apply_filters('wppb_register_activate_user_error_message5', '<p class="error">' . __('This username is already activated!', 'profilebuilder') . '</p>');
    } else {
        $inserted_user = is_multisite() ? $wpdb->update($wpdb->signups, array('active' => 1, 'activated' => current_time('mysql', true)), array('activation_key' => $key)) : $wpdb->update($wpdb->base_prefix . 'signups', array('active' => 1, 'activated' => current_time('mysql', true)), array('activation_key' => $key));
        wppb_add_meta_to_user_on_activation($user_id, '', $meta);
        // if admin approval is activated, then block the user untill he gets approved
        $wppb_generalSettings = get_option('wppb_general_settings');
        if (isset($wppb_generalSettings['adminApproval']) && $wppb_generalSettings['adminApproval'] == 'yes') {
            $user_data = get_userdata($user_id);
            if ($wppb_generalSettings != 'not_found' && !empty($wppb_generalSettings['adminApprovalOnUserRole'])) {
                foreach ($user_data->roles as $role) {
                    if (in_array($role, $wppb_generalSettings['adminApprovalOnUserRole'])) {
                        wp_set_object_terms($user_id, array('unapproved'), 'user_status', false);
                        clean_object_term_cache($user_id, 'user_status');
                    } else {
                        add_filter('wppb_register_success_message', 'wppb_noAdminApproval_successMessage');
                    }
                }
            } else {
                wp_set_object_terms($user_id, array('unapproved'), 'user_status', false);
                clean_object_term_cache($user_id, 'user_status');
            }
        }
        if (!isset($wppb_generalSettings['adminApproval'])) {
            $wppb_generalSettings['adminApproval'] = 'no';
        }
        /* copy the hashed password from signup meta to wp user table */
        if (!empty($meta['user_pass'])) {
            /* we might still have the base64 encoded password in signups and not the hash */
            if (base64_encode(base64_decode($meta['user_pass'], true)) === $meta['user_pass']) {
                $meta['user_pass'] = wp_hash_password($meta['user_pass']);
            }
            $wpdb->update($wpdb->users, array('user_pass' => $meta['user_pass']), array('ID' => $user_id));
        }
        wppb_notify_user_registration_email($bloginfo, $user_login, $user_email, 'sending', $password, $wppb_generalSettings['adminApproval']);
        do_action('wppb_activate_user', $user_id, $password, $meta);
        if ($inserted_user) {
            $success_message = apply_filters('wppb_success_email_confirmation', '<p class="wppb-success">' . __('Your email was successfully confirmed.', 'profilebuilder') . '</p><!-- .success -->');
            $admin_approval_message = apply_filters('wppb_email_confirmation_with_admin_approval', '<p class="wppb-success">' . __('Before you can access your account, an administrator needs to approve it. You will be notified via email.', 'profilebuilder') . '</p>');
            $wppb_general_settings = get_option('wppb_general_settings', 'false');
            if (!empty($wppb_general_settings['adminApproval']) && $wppb_general_settings['adminApproval'] == 'yes') {
                $user_data = get_userdata($user_id);
                if ($wppb_general_settings != 'not_found' && !empty($wppb_general_settings['adminApprovalOnUserRole'])) {
                    foreach ($user_data->roles as $role) {
                        if (in_array($role, $wppb_general_settings['adminApprovalOnUserRole'])) {
                            return $success_message . $admin_approval_message;
                        } else {
                            wp_set_object_terms($user_id, NULL, 'user_status');
                            clean_object_term_cache($user_id, 'user_status');
                            return $success_message;
                        }
                    }
                } else {
                    return $success_message . $admin_approval_message;
                }
            } else {
                wp_set_object_terms($user_id, NULL, 'user_status');
                clean_object_term_cache($user_id, 'user_status');
                return $success_message;
            }
        } else {
            return apply_filters('wppb_register_failed_user_activation', '<p class="error">' . __('There was an error while trying to activate the user.', 'profilebuilder') . '</p><!-- .error -->');
        }
    }
}
开发者ID:eugene-gromky-co,项目名称:mindfulnesssummit,代码行数:99,代码来源:register.php


示例4: wppb_save_form_values

 function wppb_save_form_values($global_request)
 {
     $user_id = $this->wppb_get_desired_user_id();
     $userdata = apply_filters('wppb_build_userdata', array(), $global_request);
     $new_user_signup = false;
     $wppb_general_settings = get_option('wppb_general_settings');
     if ($this->args['form_type'] == 'register') {
         $result = $this->wppb_register_user($global_request, $userdata);
         $user_id = $result['user_id'];
         $userdata = $result['userdata'];
         $new_user_signup = $result['new_user_signup'];
     } elseif ($this->args['form_type'] == 'edit_profile') {
         if (isset($wppb_general_settings['loginWith']) && $wppb_general_settings['loginWith'] == 'email') {
             $user_info = get_userdata($user_id);
             $userdata['user_login'] = $user_info->user_login;
         }
         $userdata['ID'] = $this->wppb_get_desired_user_id();
         $userdata = wp_unslash($userdata);
         /* if the user changes his password then we can't send it to the wp_update_user() function or
            the user will be logged out and won't be logged in again because we call wp_update_user() after
            the headers were sent( in the content as a shortcode ) */
         if (isset($userdata['user_pass']) && !empty($userdata['user_pass'])) {
             unset($userdata['user_pass']);
         }
         wp_update_user($userdata);
     }
     if (!empty($this->args['form_fields']) && !$new_user_signup) {
         foreach ($this->args['form_fields'] as $field) {
             do_action('wppb_save_form_field', $field, $user_id, $global_request, $this->args['form_type']);
         }
         if ($this->args['form_type'] == 'register') {
             if (!is_wp_error($user_id)) {
                 $wppb_general_settings = get_option('wppb_general_settings');
                 if (isset($global_request['send_credentials_via_email']) && $global_request['send_credentials_via_email'] == 'sending') {
                     $send_credentials_via_email = 'sending';
                 } else {
                     $send_credentials_via_email = '';
                 }
                 wppb_notify_user_registration_email(get_bloginfo('name'), isset($userdata['user_login']) ? trim($userdata['user_login']) : trim($userdata['user_email']), trim($userdata['user_email']), $send_credentials_via_email, trim($userdata['user_pass']), isset($wppb_general_settings['adminApproval']) ? $wppb_general_settings['adminApproval'] : 'no');
             }
         }
     }
     return $user_id;
 }
开发者ID:alvarpoon,项目名称:aeg,代码行数:44,代码来源:class-formbuilder.php


示例5: wppb_manual_activate_signup

/**
 * Activate a signup.
 *
 *
 * @param string $activation_key The activation key provided to the user.
 * @return array An array containing information about the activated user and/or blog
 */
function wppb_manual_activate_signup($activation_key)
{
    global $wpdb;
    if (is_multisite()) {
        $signup = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->signups} WHERE activation_key = %s", $activation_key));
    } else {
        $signup = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "signups WHERE activation_key = %s", $activation_key));
    }
    if (!empty($signup) && !$signup->active) {
        $meta = unserialize($signup->meta);
        $user_login = esc_sql($signup->user_login);
        $user_email = esc_sql($signup->user_email);
        $password = base64_decode($meta['user_pass']);
        $user_id = username_exists($user_login);
        if (!$user_id) {
            $user_id = wppb_create_user($user_login, $password, $user_email);
        } else {
            $user_already_exists = true;
        }
        if (!$user_id) {
            return __('Could not create user!', 'profilebuilder');
        } elseif (isset($user_already_exists) && $user_already_exists == true) {
            return __('That username is already activated!', 'profilebuilder');
        } else {
            $now = current_time('mysql', true);
            $retVal = is_multisite() ? $wpdb->update($wpdb->signups, array('active' => 1, 'activated' => $now), array('activation_key' => $activation_key)) : $wpdb->update($wpdb->prefix . 'signups', array('active' => 1, 'activated' => $now), array('activation_key' => $activation_key));
            wppb_add_meta_to_user_on_activation($user_id, '', $meta);
            // if admin approval is activated, then block the user untill he gets approved
            $wppb_general_settings = get_option('wppb_general_settings');
            if (isset($wppb_general_settings['adminApproval']) && $wppb_general_settings['adminApproval'] == 'yes') {
                wp_set_object_terms($user_id, array('unapproved'), 'user_status', false);
                clean_object_term_cache($user_id, 'user_status');
            }
            wppb_notify_user_registration_email(get_bloginfo('name'), $user_login, $user_email, 'sending', $password, isset($wppb_general_settings['adminApproval']) ? $wppb_general_settings['adminApproval'] : 'no');
            do_action('wppb_activate_user', $user_id, $password, $meta);
            return $retVal ? 'ok' : __('There was an error while trying to activate the user', 'profilebuilder');
        }
    }
}
开发者ID:DarussalamTech,项目名称:aims_prj,代码行数:46,代码来源:email-confirmation.php


示例6: wppb_manual_activate_signup

/**
 * Activate a signup.
 *
 *
 * @param string $activation_key The activation key provided to the user.
 * @return array An array containing information about the activated user and/or blog
 */
function wppb_manual_activate_signup($activation_key)
{
    global $wpdb;
    if (is_multisite()) {
        $signup = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->signups} WHERE activation_key = %s", $activation_key));
    } else {
        $signup = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "signups WHERE activation_key = %s", $activation_key));
    }
    if (!empty($signup) && !$signup->active) {
        $meta = unserialize($signup->meta);
        $user_login = esc_sql($signup->user_login);
        $user_email = esc_sql($signup->user_email);
        /* the password is in hashed form in the signup table and we will copy it later to the user */
        $password = NULL;
        $user_id = username_exists($user_login);
        if (!$user_id) {
            $user_id = wppb_create_user($user_login, $password, $user_email);
        } else {
            $user_already_exists = true;
        }
        if (!$user_id) {
            return __('Could not create user!', 'profile-builder');
        } elseif (isset($user_already_exists) && $user_already_exists == true) {
            return __('That username is already activated!', 'profile-builder');
        } else {
            $now = current_time('mysql', true);
            $retVal = is_multisite() ? $wpdb->update($wpdb->signups, array('active' => 1, 'activated' => $now), array('activation_key' => $activation_key)) : $wpdb->update($wpdb->base_prefix . 'signups', array('active' => 1, 'activated' => $now), array('activation_key' => $activation_key));
            wppb_add_meta_to_user_on_activation($user_id, '', $meta);
            /* copy the hashed password from signup meta to wp user table */
            if (!empty($meta['user_pass'])) {
                /* we might still have the base64 encoded password in signups and not the hash */
                if (base64_encode(base64_decode($meta['user_pass'], true)) === $meta['user_pass']) {
                    $meta['user_pass'] = wp_hash_password($meta['user_pass']);
                }
                $wpdb->update($wpdb->users, array('user_pass' => $meta['user_pass']), array('ID' => $user_id));
            }
            wppb_notify_user_registration_email(get_bloginfo('name'), $user_login, $user_email, 'sending', $password, isset($wppb_general_settings['adminApproval']) ? $wppb_general_settings['adminApproval'] : 'no');
            do_action('wppb_activate_user', $user_id, $password, $meta);
            return $retVal ? 'ok' : __('There was an error while trying to activate the user', 'profile-builder');
        }
    }
}
开发者ID:Juni4567,项目名称:mycashflow,代码行数:49,代码来源:email-confirmation.php



注:本文中的wppb_notify_user_registration_email函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wppb_required_field_error函数代码示例发布时间:2022-05-23
下一篇:
PHP wppb_icl_t函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap