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

PHP email_exists函数代码示例

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

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



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

示例1: json_create_user

 public function json_create_user()
 {
     $error = array("status" => 0, "msg" => __('There has been an error processing your request. Please, reload the page and try again.', Eab_EventsHub::TEXT_DOMAIN));
     $data = stripslashes_deep($_POST);
     $email = $data['email'];
     if (empty($email)) {
         $error['msg'] = __('Please, submit an email.', Eab_EventsHub::TEXT_DOMAIN);
         die(json_encode($error));
     }
     if (!is_email($email)) {
         $error['msg'] = __('Please, submit a valid email.', Eab_EventsHub::TEXT_DOMAIN);
         die(json_encode($error));
     }
     if (email_exists($email)) {
         $current_location = get_permalink();
         if (!empty($data['location'])) {
             // Let's make this sane first - it's coming from a POST request, so make that sane
             $loc = wp_validate_redirect(wp_sanitize_redirect($data['location']));
             if (!empty($loc)) {
                 $current_location = $loc;
             }
         }
         $login_link = wp_login_url($current_location);
         $login_message = sprintf(__('The email address already exists. Please <a href="%s">Login</a> and RSVP to the event.', Eab_EventsHub::TEXT_DOMAIN), $login_link);
         $error['msg'] = $login_message;
         die(json_encode($error));
     }
     $wordp_user = $this->_create_user($email);
     if (is_object($wordp_user) && !empty($wordp_user->ID)) {
         $this->_login_user($wordp_user);
     } else {
         die(json_encode($error));
     }
     die(json_encode(array("status" => 1)));
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:35,代码来源:eab-rsvps-rsvp_with_email.php


示例2: ct_validate_email_ajaxlogin

function ct_validate_email_ajaxlogin($email = null, $is_ajax = true)
{
    require_once CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php';
    global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
    $ct_options = ct_get_options();
    $ct_data = ct_get_data();
    $email = is_null($email) ? $email : $_POST['email'];
    $email = sanitize_email($email);
    $is_good = true;
    if (!filter_var($email, FILTER_VALIDATE_EMAIL) || email_exists($email)) {
        $is_good = false;
    }
    if (class_exists('AjaxLogin') && isset($_POST['action']) && $_POST['action'] == 'validate_email') {
        $ct_options = ct_get_options();
        $checkjs = js_test('ct_checkjs', $_COOKIE, true);
        $submit_time = submit_time_test();
        $sender_info = get_sender_info();
        $sender_info['post_checkjs_passed'] = $checkjs;
        if ($checkjs === null) {
            $checkjs = js_test('ct_checkjs', $_COOKIE, true);
            $sender_info['cookie_checkjs_passed'] = $checkjs;
        }
        $sender_info = json_encode($sender_info);
        if ($sender_info === false) {
            $sender_info = '';
        }
        require_once 'cleantalk.class.php';
        $config = get_option('cleantalk_server');
        $ct = new Cleantalk();
        $ct->work_url = $config['ct_work_url'];
        $ct->server_url = $ct_options['server'];
        $ct->server_ttl = $config['ct_server_ttl'];
        $ct->server_changed = $config['ct_server_changed'];
        $ct->ssl_on = $ct_options['ssl_on'];
        $ct_request = new CleantalkRequest();
        $ct_request->auth_key = $ct_options['apikey'];
        $ct_request->sender_email = $email;
        $ct_request->sender_ip = $ct->ct_session_ip($_SERVER['REMOTE_ADDR']);
        $ct_request->sender_nickname = '';
        $ct_request->agent = $ct_agent_version;
        $ct_request->sender_info = $sender_info;
        $ct_request->js_on = $checkjs;
        $ct_request->submit_time = $submit_time;
        $ct_result = $ct->isAllowUser($ct_request);
        if ($ct->server_change) {
            update_option('cleantalk_server', array('ct_work_url' => $ct->work_url, 'ct_server_ttl' => $ct->server_ttl, 'ct_server_changed' => time()));
        }
        if ($ct_result->allow === 0) {
            $is_good = false;
        }
    }
    if ($is_good) {
        $ajaxresult = array('description' => null, 'cssClass' => 'noon', 'code' => 'success');
    } else {
        $ajaxresult = array('description' => 'Invalid Email', 'cssClass' => 'error-container', 'code' => 'error');
    }
    $ajaxresult = json_encode($ajaxresult);
    print $ajaxresult;
    wp_die();
}
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:60,代码来源:cleantalk-ajax_old.php


示例3: registrar_usuario

function registrar_usuario($parametros)
{
    $errors = new WP_Error();
    if ($parametros['email'] == NULL) {
        $errors->add('empty_email', __('<strong>ERROR</strong>: Please type your e-mail address.'));
        return $errors;
    }
    if (!es_email($parametros['email'])) {
        $errors->add('invalid_email', __('<strong>ERROR</strong>: The email address isn&#8217;t correct.'));
        return $errors;
    }
    if (email_exists($parametros['email'])) {
        $errors->add('email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.'));
        return $errors;
    }
    if ($parametros['nombre'] == NULL) {
        $errors->add('empty_username', __('<strong>ERROR</strong>: Please enter a username.'));
        return $errors;
    }
    $user_pass = $parametros['clave'] == NULL ? wp_generate_password(12, false) : $parametros['clave'];
    $user_id = wp_create_user($parametros['email'], $user_pass, $parametros['email']);
    if (!$user_id) {
        $errors->add('registerfail', sprintf(__('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_option('admin_email')));
        return $errors;
    }
    update_user_option($user_id, 'default_password_nag', true, true);
    //Set up the Password change nag.
    wp_new_user_notification($user_id, $user_pass);
    // Actualización de tabla clientes...
    return $user_id;
}
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:31,代码来源:acciones.php


示例4: fu_add_new_user

function fu_add_new_user($fu = false)
{
    //echo "wtf?";
    require_once '../../../wp-includes/registration.php';
    global $blog_id;
    $email = sanitize_email($fu['email']);
    //$current_site = get_current_site();
    $pass = $fu['password'];
    $user_id = email_exists($email);
    //echo "hi";
    if (!$user_id) {
        $password = $pass ? $pass : generate_random_password();
        $user_id = wpmu_create_user($fu['username'], $password, $email);
        if (false == $user_id) {
            //echo "uh oh";
            wp_die(__('There was an error creating the user'));
        } else {
            //echo "sending mail";
            wp_new_user_notification($user_id, $password);
        }
        if (get_user_option('primary_blog', $user_id) == $blog_id) {
            update_user_option($user_id, 'primary_blog', $blog_id, true);
        }
    }
    $redirect = $fu['referer'] ? $fu['referer'] : get_bloginfo('url');
    wp_redirect($redirect);
}
开发者ID:elizabethcb,项目名称:Daily-Globe,代码行数:27,代码来源:front-users.php


示例5: registra_usuario

 function registra_usuario($username, $password, $email)
 {
     global $db;
     if (user_exists($username)) {
         $mensaje_de_error = "El usuario " . $username . " ya existe";
     } else {
         if (check_email($email) == 0) {
             $mensaje_de_error = "El mail no es válido";
         } else {
             if (email_exists($email)) {
                 $mensaje_de_error = "El mail " . $email . " ya existe";
             } else {
                 $SELECT = "INSERT INTO usuarios ( usuario_login, usuario_password, usuario_email, usuario_nombre )";
                 $SELECT .= " VALUES ( '" . $username . "', '" . md5($password) . "', '" . $email . "', '" . $username . "' )";
                 $result = $db->get_results($SELECT);
                 logea("registro " . $username, "", $_SESSION["usuario"]);
                 //Creamos el ranking con un día atrás para que no obtenga beneficios de 60000 al actualizar el ranking hoy
                 $SELECT = "INSERT INTO ranking ( ranking_usuario, ranking_saldo, ranking_invertido, ranking_total, ranking_beneficio_hoy, ranking_fecha ) ";
                 $SELECT .= " VALUES ( '" . $username . "', '60000', '0', '60000', '0', CURDATE()-INTERVAL 1 DAY )";
                 $result = $db->get_results($SELECT);
             }
         }
     }
     return $mensaje_de_error;
 }
开发者ID:joanma100,项目名称:bolsaphp,代码行数:25,代码来源:plugfunctions.php


示例6: __user_exists_check

 private function __user_exists_check($data)
 {
     // check if user exists in WP or DB
     $return = array('user' => false);
     if (isset($data['user_email'])) {
         $email_check = email_exists($data['user_email']);
         if ($email_check) {
             $db_user = $this->__user_db_check($data['social_id']);
             if (!$db_user) {
                 $this->__create_user_db($email_check, $data['social_id']);
             }
             $return['user'] = get_user_by('id', $email_check);
         }
     }
     if (isset($data['social_id']) && $return['user'] == false) {
         $db_user = $this->__user_db_check($data['social_id']);
         if ($db_user) {
             $return['user'] = get_user_by('id', $db_user->wp_user_id);
         }
     }
     if (!isset($data['social_id']) && !isset($data['user_email'])) {
         return new WP_Error('No Data', __('Expecting social_id or user_email'), array('status' => 400));
     }
     return $return;
 }
开发者ID:advancedwp,项目名称:awpdevelop,代码行数:25,代码来源:social-routes.php


示例7: is_email_does_not_exist

 /** Return true if supplied email is valid or give an error message otherwise */
 static function is_email_does_not_exist($e)
 {
     if (email_exists($e)) {
         return __('Já existe um usuário com o e-mail informado');
     }
     return true;
 }
开发者ID:CoordCulturaDigital-Minc,项目名称:eleicoescnpc,代码行数:8,代码来源:validator.class.php


示例8: get_user_date

  /**
   * Return user data in JSON format
   *
   * @todo add hooks to accomodate different user values
   * @since 3.0
   *
   */
  function get_user_date($user_email = false) {
    global $wpdb;

      if(!$user_email) {
        return;
      }

      $user_id = email_exists($user_email);

      if(!$user_id) {
        return;
      }

      $user_data['first_name'] = get_user_meta($user_id, 'first_name', true);
      $user_data['last_name'] = get_user_meta($user_id, 'last_name', true);
      $user_data['company_name'] = get_user_meta($user_id, 'company_name', true);
      $user_data['phonenumber'] = get_user_meta($user_id, 'phonenumber', true);
      $user_data['streetaddress'] = get_user_meta($user_id, 'streetaddress', true);
      $user_data['city'] = get_user_meta($user_id, 'city', true);
      $user_data['state'] = get_user_meta($user_id, 'state', true);
      $user_data['zip'] = get_user_meta($user_id, 'zip', true);

      if($user_data) {
        echo json_encode(array('succes' => 'true', 'user_data' => $user_data));
      }

  }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:34,代码来源:wpi_ajax.php


示例9: registration_validation

function registration_validation($username, $password, $email)
{
    global $reg_errors;
    $reg_errors = new WP_Error();
    if (empty($username) || empty($password) || empty($email)) {
        $reg_errors->add('field', 'Required form field is missing');
    }
    if (4 > strlen($username)) {
        $reg_errors->add('username_length', 'Username too short. At least 4 characters is required');
    }
    if (username_exists($username)) {
        $reg_errors->add('user_name', 'Sorry, that username already exists!');
    }
    if (!validate_username($username)) {
        $reg_errors->add('username_invalid', 'Sorry, the username you entered is not valid');
    }
    if (5 > strlen($password)) {
        $reg_errors->add('password', 'Password length must be greater than 5');
    }
    if (!is_email($email)) {
        $reg_errors->add('email_invalid', 'Email is not valid');
    }
    if (email_exists($email)) {
        $reg_errors->add('email', 'Email Already in use');
    }
    if (is_wp_error($reg_errors)) {
        foreach ($reg_errors->get_error_messages() as $error) {
            echo '<div>';
            echo '<strong>ERROR</strong>:';
            echo $error . '<br/>';
            echo '</div>';
        }
    }
}
开发者ID:Vasiliy28,项目名称:MyJewelry,代码行数:34,代码来源:form-reg.php


示例10: upme_replace_avatar

 function upme_replace_avatar($avatar, $id_or_email, $size, $default, $alt)
 {
     // Optimized condition and added strict conditions
     if (is_numeric($id_or_email)) {
         $user_id = $id_or_email;
     } else {
         if (is_object($id_or_email)) {
             $user_id = email_exists($id_or_email->comment_author_email);
         } else {
             $user_id = email_exists($id_or_email);
         }
     }
     echo '<pre>';
     print_r($user_id);
     echo '</pre>';
     exit;
     // Filter default gravatars to prvent the loading of custom profile image
     $default_gravatars = array("blank", "identicon", "wavatar", "monsterid", "retro");
     if ($user_id > 0 && !in_array($default, $default_gravatars)) {
         if (get_the_author_meta('user_pic', $user_id) != '') {
             if (!isset($size) || $size == '0') {
                 $size = 60;
             }
             $avatar = '<img src="' . get_the_author_meta('user_pic', $user_id) . '" alt="" width="' . $size . '" height="' . $size . '" class="avatar avatar-' . $size . ' photo">';
         }
     }
     /* UPME Filter for customizing avatar image on profiles */
     $avatar = apply_filters('upme_replace_avatar', $avatar, $user_id);
     // End Filter
     return $avatar;
 }
开发者ID:nikwin333,项目名称:pcu_project,代码行数:31,代码来源:class-upme.php


示例11: pn_create_user

function pn_create_user($user_name, $user_email, $first_name, $last_name, $title)
{
    require_once ABSPATH . WPINC . '/pluggable.php';
    //WP v3.0.1 - wp_generate_password
    require_once ABSPATH . WPINC . '/registration.php';
    //WP v3.0.1 - username_exists, email_exists
    if (email_exists($user_email)) {
        return false;
    }
    $user_id = username_exists($user_name);
    if (!$user_id) {
        $random_password = wp_generate_password(12, false);
        $user_role = get_option('pn_register_role') ? get_option('pn_register_role') : 'subscriber';
        $new_user = array();
        $new_user['user_pass'] = $random_password;
        $new_user['user_login'] = $user_name;
        $new_user['user_email'] = $user_email;
        $new_user['display_name'] = $title . ' ' . $first_name . ' ' . $last_name;
        $new_user['first_name'] = $first_name;
        $new_user['last_name'] = $last_name;
        $new_user['role'] = $user_role;
        if ($id = wp_insert_user($new_user)) {
            return $random_password;
        } else {
            return false;
        }
    } else {
        return false;
    }
}
开发者ID:shimion,项目名称:bluesnap,代码行数:30,代码来源:plimusipn.php


示例12: mdjm_add_client_ajax

/**
 * Adds a new client from the event field.
 *
 * @since	1.3.7
 * @global	arr		$_POST
 */
function mdjm_add_client_ajax()
{
    $client_id = false;
    $client_list = '';
    $result = array();
    $message = array();
    if (!is_email($_POST['client_email'])) {
        $message[] = __('Email address is invalid', 'mobile-dj-manager');
    } elseif (email_exists($_POST['client_email'])) {
        $message[] = __('Email address is already in use', 'mobile-dj-manager');
    } else {
        $user_data = array('first_name' => ucwords($_POST['client_firstname']), 'last_name' => !empty($_POST['client_lastname']) ? ucwords($_POST['client_lastname']) : '', 'user_email' => $_POST['client_email'], 'client_phone' => !empty($_POST['client_phone']) ? $_POST['client_phone'] : '', 'client_phone2' => !empty($_POST['client_phone2']) ? $_POST['client_phone2'] : '');
        $user_data = apply_filters('mdjm_event_new_client_data', $user_data);
        $client_id = mdjm_add_client($user_data);
    }
    $clients = mdjm_get_clients('client');
    if (!empty($clients)) {
        foreach ($clients as $client) {
            $client_list .= sprintf('<option value="%1$s"%2$s>%3$s</option>', $client->ID, $client->ID == $client_id ? ' selected="selected"' : '', $client->display_name);
        }
    }
    if (empty($client_id)) {
        $result = array('type' => 'error', 'message' => explode("\n", $message));
    } else {
        $result = array('type' => 'success', 'client_id' => $client_id, 'client_list' => $client_list);
        do_action('mdjm_after_add_new_client', $user_data);
    }
    echo json_encode($result);
    die;
}
开发者ID:mdjm,项目名称:mobile-dj-manager,代码行数:36,代码来源:ajax-functions.php


示例13: main

 /**
  *  Mot de passe oublié (partie 1)
  *  @author Cam
  *  @return tpl
  */
 protected function main()
 {
     // Si le membre est déjà connecté
     if (is_logged_in()) {
         redir(Nw::$lang['common']['already_connected'], false, './');
     }
     $this->set_title(Nw::$lang['users']['title_lost_pwd']);
     $this->set_tpl('membres/oubli_mdp.html');
     $this->add_css('forms.css');
     // Fil ariane
     $this->set_filAriane(Nw::$lang['users']['title_lost_pwd']);
     //Si le formulaire a été validé
     if (isset($_POST['submit'])) {
         // Cette adresse email existe bien sur le site
         inc_lib('users/email_exists');
         if (email_exists($_POST['mail'])) {
             //On récupère les infos du membre
             inc_lib('users/get_info_mbr');
             $membre_mail = get_info_mbr($_POST['mail'], 'mail');
             $lien_password = Nw::$site_url . 'users-13.html?idm=' . $membre_mail['u_id'] . '&ca=' . $membre_mail['u_code_act'];
             //On prépare le texte de l'email
             $txt_mail = sprintf(Nw::$lang['users']['mail_oubli_pwd'], $membre_mail['u_pseudo'], $lien_password, $lien_password, $lien_password);
             @envoi_mail(trim($_POST['mail']), sprintf(Nw::$lang['users']['title_mail_lost_pwd'], Nw::$site_name), $txt_mail);
             redir(Nw::$lang['users']['send_mail_lost'], true, './');
         } else {
             redir(Nw::$lang['users']['email_aucun_mbr'], false, 'users-12.html');
         }
     }
 }
开发者ID:shiooooooookun,项目名称:Nouweo_PHP,代码行数:34,代码来源:12-lost_pwd1.php


示例14: getAvatar

 /**
  * Filter for get_avatar. Allow to change degault avatar to custom one.
  * 
  * @param type $avatar
  * @param type $id_or_email
  * @param type $size
  * @param type $default
  * @param type $alt
  * @return html img tag
  */
 function getAvatar($avatar = '', $id_or_email, $size = '96', $default = '', $alt = false)
 {
     global $userMeta;
     $safe_alt = false === $alt ? '' : esc_attr($alt);
     if (is_numeric($id_or_email)) {
         $user_id = (int) $id_or_email;
     } elseif (is_string($id_or_email)) {
         $user_id = email_exists($id_or_email);
     } elseif (is_object($id_or_email)) {
         if (!empty($id_or_email->user_id)) {
             $user_id = (int) $id_or_email->user_id;
         } elseif (!empty($id_or_email->comment_author_email)) {
             $user_id = email_exists($id_or_email->comment_author_email);
         }
     }
     if (!isset($user_id)) {
         return $avatar;
     }
     $umAvatar = get_user_meta($user_id, 'user_avatar', true);
     $file = $userMeta->determinFileDir($umAvatar);
     if (!empty($file)) {
         $avatar = "<img alt='{$safe_alt}' src='{$file['url']}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />";
     }
     return $avatar;
 }
开发者ID:robbenz,项目名称:plugs,代码行数:35,代码来源:umPreloadsController.php


示例15: seed_cspv4_emaillist_followupemails_queue_email

function seed_cspv4_emaillist_followupemails_queue_email()
{
    global $wpdb, $seed_cspv4, $seed_cspv4_post_result;
    extract($seed_cspv4);
    require_once SEED_CSPV4_PLUGIN_PATH . 'lib/nameparse.php';
    $name = '';
    if (!empty($_REQUEST['name'])) {
        $name = $_REQUEST['name'];
    }
    $email = strtolower($_REQUEST['email']);
    $fname = '';
    $lname = '';
    if (!empty($name)) {
        $name = seed_cspv4_parse_name($name);
        $fname = $name['first'];
        $lname = $name['last'];
    }
    if (email_exists($email)) {
        // Subscriber already exist show stats
        $seed_cspv4_post_result['status'] = '200';
        $seed_cspv4_post_result['msg'] = $txt_already_subscribed_msg;
        $seed_cspv4_post_result['msg_class'] = 'alert-info';
        $seed_cspv4_post_result['clicks'] = '0';
    } else {
        $user_id = wp_insert_user(array('user_login' => $email, 'user_email' => $email, 'first_name' => $fname, 'last_name' => $lname, 'user_pass' => wp_generate_password()));
        if (empty($seed_cspv4_post_result['status'])) {
            $seed_cspv4_post_result['status'] = '200';
        }
    }
}
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:30,代码来源:followupemails.php


示例16: acxu_createUser

function acxu_createUser($args)
{
    global $wp_xmlrpc_server;
    $wp_xmlrpc_server->escape($args);
    $nickname = $args[0];
    //$password = $args[1];
    //if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) )
    //    return $wp_xmlrpc_server->error;
    $user_name = time() . "_" . rand(1000, 9999);
    $user_email = $user_name . "@bbuser.org";
    if (!username_exists($user_name) && !email_exists($user_email)) {
        $random_password = wp_generate_password($length = 12, $include_standard_special_chars = false);
        $user_id = wp_create_user($user_name, $random_password, $user_email);
        if ($nickname == "") {
            $nickname = $user_email;
        }
        // Update the user to set the nickname
        wp_update_user(array('ID' => $user_id, 'nickname' => $nickname));
        // Get the user object to set the user's role
        $wp_user_object = new WP_User($user_id);
        //http://en.support.wordpress.com/user-roles/
        $wp_user_object->set_role('author');
        return $user_name . " " . $random_password;
    } else {
        return "ERROR: User Name or Email Already Exists";
    }
}
开发者ID:AurangZ,项目名称:securereader,代码行数:27,代码来源:auto-create-xmlrpc-user.php


示例17: um_submit_account_errors_hook

function um_submit_account_errors_hook($args)
{
    global $ultimatemember;
    // errors on general tab
    if (isset($_POST['um_account_submit']) && $_POST['um_account_submit'] != __('Delete Account', 'ultimatemember')) {
        if (isset($_POST['first_name']) && strlen(trim($_POST['first_name'])) == 0) {
            $ultimatemember->form->add_error('first_name', __('You must provide your first name', 'ultimatemember'));
        }
        if (isset($_POST['last_name']) && strlen(trim($_POST['last_name'])) == 0) {
            $ultimatemember->form->add_error('last_name', __('You must provide your last name', 'ultimatemember'));
        }
        if (isset($_POST['user_email']) && strlen(trim($_POST['user_email'])) == 0) {
            $ultimatemember->form->add_error('user_email', __('You must provide your e-mail', 'ultimatemember'));
        }
        if (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';
    // change password
    if ($_POST['current_user_password'] != '') {
        if (!wp_check_password($_POST['current_user_password'], um_user('user_pass'), um_user('ID'))) {
            $ultimatemember->form->add_error('current_user_password', __('This is not your password', 'ultimatemember'));
            $ultimatemember->account->current_tab = 'password';
        } else {
            // correct password
            if ($_POST['user_password'] != $_POST['confirm_user_password'] && $_POST['user_password']) {
                $ultimatemember->form->add_error('user_password', __('Your new password does not match', 'ultimatemember'));
                $ultimatemember->account->current_tab = 'password';
            }
            if (um_get_option('account_require_strongpass')) {
                if (strlen(utf8_decode($_POST['user_password'])) < 8) {
                    $ultimatemember->form->add_error('user_password', __('Your password must contain at least 8 characters', 'ultimatemember'));
                }
                if (strlen(utf8_decode($_POST['user_password'])) > 30) {
                    $ultimatemember->form->add_error('user_password', __('Your password must contain less than 30 characters', 'ultimatemember'));
                }
                if (!$ultimatemember->validation->strong_pass($_POST['user_password'])) {
                    $ultimatemember->form->add_error('user_password', __('Your password must contain at least one lowercase letter, one capital letter and one number', 'ultimatemember'));
                    $ultimatemember->account->current_tab = 'password';
                }
            }
        }
    }
    // delete account
    if (isset($_POST['um_account_submit']) && $_POST['um_account_submit'] == __('Delete Account', 'ultimatemember')) {
        if (strlen(trim($_POST['single_user_password'])) == 0) {
            $ultimatemember->form->add_error('single_user_password', __('You must enter your password', 'ultimatemember'));
        } else {
            if (!wp_check_password($_POST['single_user_password'], um_user('user_pass'), um_user('ID'))) {
                $ultimatemember->form->add_error('single_user_password', __('This is not your password', 'ultimatemember'));
            }
        }
        $ultimatemember->account->current_tab = 'delete';
    }
}
开发者ID:blueblazeassociates,项目名称:ultimate-member,代码行数:59,代码来源:um-actions-account.php


示例18: validate_username

 /**
  * Validate username field.
  *
  * @access public
  * @since 1.0.0
  * @return void
  */
 public static function validate_username($passed, $fields, $values)
 {
     $username = $values['user']['username_email'];
     if (is_email($username) && !email_exists($username) || !is_email($username) && !username_exists($username)) {
         return new WP_Error('username-validation-error', __('This user could not be found.', 'wpum'));
     }
     return $passed;
 }
开发者ID:CloouCom,项目名称:wp-user-manager,代码行数:15,代码来源:class-wpum-form-password.php


示例19: aitAddNewClaim

function aitAddNewClaim()
{
    if (defined('AIT_SERVER')) {
        return 0;
    }
    if (!empty($_POST['itemId']) && !empty($_POST['username']) && !empty($_POST['name']) && !empty($_POST['email'])) {
        // check username and email if exist
        if (username_exists($_POST['username'])) {
            _e("This username is already registered. Please choose another one.", "ait");
            exit;
        }
        if (email_exists($_POST['email'])) {
            _e("This email is already registered, please choose another one.", "ait");
            exit;
        }
        global $aitThemeOptions;
        // Check for nonce security
        $nonce = $_POST['nonce'];
        if (!wp_verify_nonce($nonce, 'ajax-nonce')) {
            _e('Bad nonce', 'ait');
            exit;
        }
        $claim = array('post_title' => $_POST['username'], 'post_content' => $_POST['message'], 'post_type' => 'ait-claim', 'post_status' => 'publish', 'comment_status' => 'closed', 'ping_status' => 'closed');
        $claimId = wp_insert_post($claim);
        if ($claimId == 0) {
            return 0;
        }
        update_post_meta($claimId, 'item_id', $_POST['itemId']);
        update_post_meta($claimId, 'username', $_POST['username']);
        update_post_meta($claimId, 'name', $_POST['name']);
        update_post_meta($claimId, 'email', $_POST['email']);
        update_post_meta($claimId, 'number', $_POST['number']);
        update_post_meta($claimId, 'status', 'new');
        // send email to admin
        if (isset($aitThemeOptions->directory->claimAdminEmail)) {
            $to = get_option('admin_email');
            $subject = strip_tags($aitThemeOptions->directory->claimAdminEmailSubject);
            $postLink = get_permalink(intval($_POST['itemId']));
            $post = get_post(intval($_POST['itemId']));
            $bodyHtml = $aitThemeOptions->directory->claimAdminEmailBody;
            $bodyHtml = str_replace('[item]', '<a href="' . $postLink . '" target="_blank">' . $post->post_title . '</a>', $bodyHtml);
            $bodyHtml = str_replace('[name]', $_POST['name'], $bodyHtml);
            $bodyHtml = str_replace('[username]', $_POST['username'], $bodyHtml);
            $bodyHtml = str_replace('[email]', $_POST['email'], $bodyHtml);
            $bodyHtml = str_replace('[phone]', $_POST['number'], $bodyHtml);
            $bodyHtml = str_replace('[message]', $_POST['message'], $bodyHtml);
            $bodyHtml = str_replace('[link]', admin_url('/edit.php?post_type=ait-claim'), $bodyHtml);
            $headers = 'From: ' . $aitThemeOptions->directory->claimAdminEmailFrom . "\r\n";
            add_filter('wp_mail_content_type', 'aitSetHtmlMail');
            wp_mail($to, $subject, $bodyHtml, $headers);
            remove_filter('wp_mail_content_type', 'aitSetHtmlMail');
        }
        echo "success";
    } else {
        _e("Please fill out inputs", "ait");
    }
    exit;
}
开发者ID:kivivuori,项目名称:jotain,代码行数:58,代码来源:claim-listing.php


示例20: wsl_wp_email_exists

/**
* Checks whether the given email exists in WordPress users tables.
*
* This function is not loaded by default in wp 3.0
*
* https://core.trac.wordpress.org/browser/tags/4.0/src/wp-includes/user.php#L1565
*/
function wsl_wp_email_exists($email)
{
    if (function_exists('email_exists')) {
        return email_exists($email);
    }
    if ($user = get_user_by('email', $email)) {
        return $user->ID;
    }
}
开发者ID:rmbolger,项目名称:wordpress-social-login,代码行数:16,代码来源:wsl.user.data.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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