public function execute() { if ($this->user->logged_in == false) { $this->output->add_tag("result", "You are not logged in!", array("url" => "")); return; } $this->output->description = "Profile"; $this->output->keywords = "profile"; $this->output->title = "Profile"; if ($this->user->status == USER_STATUS_CHANGEPWD) { $this->output->add_message("Please, change your password."); } if ($_SERVER["REQUEST_METHOD"] == "POST") { /* Update profile */ $_POST["hashed"] = hash_password($_POST["password"], $this->user->username); if ($this->model->profile_oke($_POST) == false) { $this->show_profile_form($_POST); } else { if ($this->model->update_profile($_POST) === false) { $this->output->add_tag("result", "Error while updating profile.", array("url" => "profile")); } else { $this->output->add_tag("result", "Profile has been updated.", array("url" => $this->settings->start_page)); $this->user->log_action("profile updated"); } } } else { $user = array("fullname" => $this->user->fullname, "email" => $this->user->email); $this->show_profile_form($user); } }
public function profile_oke($profile) { $result = true; if (trim($profile["fullname"]) == "") { $this->output->add_message("Fill in your name."); $result = false; } if (valid_email($profile["email"]) == false) { $this->output->add_message("Invalid e-mail address."); $result = false; } else { if (($check = $this->db->entry("users", $profile["email"], "email")) != false) { if ($check["id"] != $this->user->id) { $this->output->add_message("E-mail address already exists."); $result = false; } } } if (hash_password($profile["current"], $this->user->username) != $this->user->password) { $this->output->add_message("Current password is incorrect."); $result = false; } if ($profile["password"] != "") { if ($profile["password"] != $profile["repeat"]) { $this->output->add_message("New passwords do not match."); $result = false; } else { if ($this->user->password == $profile["hashed"]) { $this->output->add_message("New password must be different from current password."); $result = false; } } } return $result; }
/** * Changes user's password after validation of entered data. * User must enter security number to prevent robot attacks. */ public function changePassword() { checkUnauthorizedAccess(); $main = new Main(); $main->setPageTitle("Password settings"); $changePassword = new ChangePassword(); $main->setBody($changePassword); echo $main; $username = getUsername(); if (post('change-pwd')) { $password = post('first'); $confirmedPassword = post('second'); $userSecurityNumber = post('security'); $error = false; if (!ctype_alnum($password) || strlen($password) < 4 || strlen($password) > 25) { $error = true; } if (!ctype_alnum($confirmedPassword) || strlen($confirmedPassword) < 4 || strlen($confirmedPassword) > 25) { $error = true; } if ($userSecurityNumber < 1113 || $userSecurityNumber > 1207) { $error = true; } if ($password === $confirmedPassword && !$error) { $hashedPassword = hash_password($password); UserRepository::changePassword($username, $hashedPassword); } } }
/** * 登入方法 * @param null $input * @return array */ public function login($input = null) { $input = $input ? $input : rq(); if (!empty($input['user_type']) && $input['user_type'] == 'doctor' && !empty($input['cust_id'])) { $d = M('doctor'); $d = $d->where('cust_id', $input['cust_id'])->first(); if ($d) { log_him_in(['uid' => $d->id]); add_chara($input['user_type']); return ss(); } return $d ? ss($d) : ee(2); } if (!empty($input['user_type']) && !empty($input['username']) && !empty($input['password'])) { $input['password'] = hash_password($input['password']); $user = $this->user_exists($input['user_type'], array_only($input, ['username', 'password'])); if ($user) { log_him_in(['username' => $user->username, 'uid' => $user->id]); add_chara($input['user_type']); return ss(); } } else { return ee(2); } return ee(2); }
function check_session() { if ($GLOBALS['use_ip_in_session'] == 1) { $ip = get_real_ip(); } else { $ip = date('m'); } @session_start(); ini_set('session.cookie_httponly', TRUE); // use a cookie to remain logged in $user_id = hash_password($GLOBALS['mdp'] . $GLOBALS['identifiant'] . $GLOBALS['salt'], md5($_SERVER['HTTP_USER_AGENT'] . $ip . $GLOBALS['salt'])); if (isset($_COOKIE['BT-admin-stay-logged']) and $_COOKIE['BT-admin-stay-logged'] == $user_id) { $_SESSION['user_id'] = md5($user_id); session_set_cookie_params(365 * 24 * 60 * 60); // set new expiration time to the browser session_regenerate_id(true); // Send cookie return TRUE; } if (!isset($_SESSION['user_id']) or $_SESSION['user_id'] != $GLOBALS['identifiant'] . $GLOBALS['mdp'] . md5($_SERVER['HTTP_USER_AGENT'] . $ip)) { return FALSE; } else { return TRUE; } }
public static function setUpBeforeClass() { self::$CI =& get_instance(); // Clean db! self::$CI->mongo_db->dropDb('aw_datacollection_test'); // Change Controller. self::$CI = new Survey(); self::$CI->mongo_db->switchDb('mongodb://*****:*****@localhost.dev', 'name' => 'Admin', 'username' => 'admin', 'password' => hash_password('admin'), 'roles' => array(ROLE_ADMINISTRATOR), 'author' => null, 'status' => User_entity::STATUS_ACTIVE, 'created' => Mongo_db::date(), 'updated' => Mongo_db::date()), array('uid' => 9902, 'email' => '*****@*****.**', 'name' => 'Regular user', 'username' => 'regular', 'password' => hash_password('regular'), 'roles' => array(), 'author' => 1, 'status' => User_entity::STATUS_ACTIVE, 'created' => Mongo_db::date(), 'updated' => Mongo_db::date()), array('uid' => 9903, 'email' => '*****@*****.**', 'name' => 'The Agent', 'username' => 'agent', 'password' => hash_password('agent'), 'roles' => array(ROLE_CC_AGENT), 'author' => 1, 'status' => User_entity::STATUS_ACTIVE, 'created' => Mongo_db::date(), 'updated' => Mongo_db::date()), array('uid' => 9904, 'email' => '*****@*****.**', 'name' => 'The Blocked Agent', 'username' => 'bloked_agent', 'password' => hash_password('blocked_agent'), 'roles' => array(ROLE_CC_AGENT), 'author' => 1, 'status' => User_entity::STATUS_BLOCKED, 'created' => Mongo_db::date(), 'updated' => Mongo_db::date()))); }
public function register() { check_if_already_logged_in(); $data["page"] = "register"; if (isset($_POST['btnRegister'])) { $input = array("username" => $_POST['username'], "password" => $_POST['password'], "confirmpass" => $_POST['password_confirm'], "firstname" => $_POST['firstname'], "middlename" => $_POST['middlename'], "lastname" => $_POST['lastname'], "email" => $_POST['email'], "gender" => isset($_POST['gender']) ? $_POST['gender'] : "", "occupation" => $_POST['occupation'], "otherinfo" => $_POST['otherinfo']); $data["error"] = verify_data($input); if ($data["error"]["count"] == 0) { $salt = generate_salt(); $userdata["username"] = $input["username"]; $userdata["salt"] = encrypt_salt($salt, 'enElpiPUP1516'); $userdata["password"] = hash_password($input["password"], $salt); $userdata["type"] = "member"; $other["first_name"] = $input["firstname"]; $other["middle_name"] = $input["middlename"]; $other["last_name"] = $input["lastname"]; $other["email"] = $input["email"]; $other["gender"] = $input["gender"]; $other["occupation"] = $input["occupation"]; $other["about"] = $input["otherinfo"]; $user = $this->Users_model->insert($userdata, $other); header('Location: register'); } } $this->load->view('templates/header'); $this->load->view('users/register', $data); $this->load->view('templates/footer'); }
/** * Run the migrations. * * @return void */ public function up() { Schema::create('i_' . $this->ins_name, function (Blueprint $t) { $t->engine = 'InnoDB'; $t->increments('id'); $t->text('name'); $t->text('name_in_charge'); $t->integer('city_id')->unsigned(); $t->integer('province_id')->unsigned(); $t->text('location_detail'); $t->string('username')->unique(); $t->string('password'); $t->string('phone')->nullable(); $t->string('email')->nullable(); $t->date('started_at')->nullable(); $t->date('ended_at')->nullable(); $t->smallInteger('status')->default(1); // 0为冻结账户 $t->text('memo')->nullable(); $t->softDeletes(); $t->timestamps(); }); $count = 1000; db_c($this->ins_name, 'i', ['id' => 1, 'name' => '自营', 'name_in_charge' => str_random(2) . ' ' . str_random(2), 'location_detail' => str_random(100), 'started_at' => date("Y-m-d H:i:s", 1440560208), 'ended_at' => date("Y-m-d H:i:s", 1840560208), 'city_id' => rand(36, 398), 'province_id' => rand(2, 35), 'username' => $this->ins_name . 'self', 'password' => hash_password($this->ins_name . 'self'), 'phone' => rand(13000000000.0, 13999999999.0), 'email' => str_random(3) . '@' . str_random(3) . '.com', 'memo' => str_random(200), 'status' => rand(0, 1)]); for ($i = 0; $i < $count; $i++) { db_c($this->ins_name, 'i', ['name' => str_random(2) . '集团', 'name_in_charge' => str_random(2) . ' ' . str_random(2), 'location_detail' => str_random(100), 'started_at' => date("Y-m-d H:i:s", mt_rand(1161302400, 1440560208)), 'ended_at' => date("Y-m-d H:i:s", mt_rand(1161302400, 1440560208) + rand(1000000, 999999999)), 'city_id' => rand(36, 398), 'province_id' => rand(2, 35), 'username' => $this->ins_name . $i, 'password' => hash_password($this->ins_name . $i), 'phone' => rand(13000000000.0, 13999999999.0), 'email' => str_random(3) . '@' . str_random(3) . '.com', 'memo' => str_random(200), 'status' => rand(0, 1)]); } }
/** * Function renders main page and implements user login behaviour. * If user is already logged in, he will be redirected to his twitter wall. * If user doesn't exist or entered data is wrong, warning message will show. */ public function action() { if (isLoggedIn()) { redirect(\route\Route::get("twitterWall")->generate(array("id" => UserRepository::getIdByUsername($_SESSION['username'])))); } $main = new Main(); $main->setPageTitle("Twitter App"); $body = new \templates\Index(); $main->setBody($body); echo $main; if (UserRepository::isLoggedIn()) { redirect(\route\Route::get("twitterWall")->generate()); } if (post('login')) { $username = htmlentities(trim(post('username'))); $password = htmlentities(trim(post('password'))); $hashedPassword = hash_password($password); if (UserRepository::login($username, $hashedPassword)) { redirect(\route\Route::get("twitterWall")->generate(array("id" => UserRepository::getIdByUsername($_SESSION['username'])))); exit; } else { ?> <script src="assets/js/loginError.js"></script> <?php } } }
public function test_get_user_data() { $this->CI->users->get_user_data(1); $this->assertEquals('test', $this->CI->users->user_data['login']); $this->assertEquals('username', $this->CI->users->user_data['name']); $this->assertEquals('*****@*****.**', $this->CI->users->user_data['email']); $this->assertEquals(hash_password('new_password', $this->CI->users->user_data['password']), $this->CI->users->user_data['password']); }
public function addUserBasicInfo() { if (!$this->the_user_id) { $this->addUser(); } $this->the_user_basic_info_id = $this->user_basic_info_model->insert(array('id' => 1000, 'uid' => $this->the_user_id, 'username' => 'jack', 'password' => hash_password('jack'), 'mobile' => '123456')); $this->the_user_basic_info = $this->user_basic_info_model->load($this->the_user_basic_info_id); }
public function save_password($username, $password) { if ($username == "") { return false; } $password["password"] = hash_password($password["password"], $username); $query = "update users set password=%s where username=%s"; return $this->db->query($query, $password["password"], $username) != false; }
function change_password($users, $passwords, $user, $old, $new) { if (verify_password($users, $passwords, $user, $old)) { $new_salt = generate_random_string(20); $passwords[array_keys($users, $user)][0] = hash_password($new, $new_salt); $passwords[array_keys($users, $user)][1] = $new_salt; logout(); } }
public function change_password($row = null) { $row = $row ? $row : rq(); $ins = $this->find($row['id']); $ins->password = hash_password($row['password']); $r = $ins->save(); // trigger log $this->eventFire('pass', $ins); return $r ? ss($r) : ee(1); }
function verify($password, $hashed_password, $salt) { $original_salt = decrypt_salt($salt, 'enElpiPUP1516'); $hashed_password2 = hash_password($password, $original_salt); if ($hashed_password2 === $hashed_password) { return true; } else { return false; } }
/** * 更新 */ public function u($rq = null) { $this->guarded = arr_except_vals($this->guarded, ['password']); if (!$rq) { $rq = rq(); } if (isset($rq['password'])) { $rq['password'] = hash_password($rq['password']); } return parent::u($rq); }
public static function setUpBeforeClass() { self::$CI =& get_instance(); // Clean db! self::$CI->mongo_db->dropDb('aw_datacollection_test'); // Change Controller. self::$CI = new Survey(); self::$CI->mongo_db->switchDb('mongodb://*****:*****@localhost.dev', 'name' => 'Admin', 'username' => 'admin', 'password' => hash_password('admin'), 'roles' => array(ROLE_ADMINISTRATOR), 'author' => null, 'status' => User_entity::STATUS_ACTIVE, 'created' => Mongo_db::date(), 'updated' => Mongo_db::date()))); }
/** * Function is used for registering new users. * It checks entered data, register new user and redirects to user's twitter wall. * User must enter security number to prevent robot attacks. */ public function action() { $main = new Main(); $main->setPageTitle("Sign up for TwitterApp"); $register = new \templates\Register(); $main->setBody($register); echo $main; if (post('register')) { $firstName = htmlentities(trim(post('fname'))); $lastName = htmlentities(trim(post('lname'))); $username = htmlentities(trim(post('username'))); $password = trim(post('password')); $hashedPassword = hash_password($password); $confirmedPassword = trim(post('cpassword')); $email = trim(post('email')); $userSecurityNumber = (int) trim(post('security')); //server-side validation $error = false; if (!ctype_alpha($firstName) || strlen($firstName) < 3 || strlen($firstName) > 25) { $error = true; } if (!ctype_alpha($lastName) || strlen($lastName) < 3 || strlen($lastName) > 25) { $error = true; } if (!ctype_alnum($username) || strlen($username) < 4 || strlen($lastName) > 25) { $error = true; } if (!ctype_alnum($password) || strlen($password) < 4 || strlen($password) > 25) { $error = true; } if (!ctype_alnum($confirmedPassword) || strlen($confirmedPassword) < 4 || strlen($confirmedPassword) > 25) { $error = true; } if ($userSecurityNumber < 1113 || $userSecurityNumber > 1207) { $error = true; } if ($password === $confirmedPassword && !$error) { $user = new User(); $user->setFirstName($firstName); $user->setLastName($lastName); $user->setUsername($username); $user->setPassword($hashedPassword); $user->setEmail($email); try { UserRepository::registerUser($user); } catch (\PDOException $e) { $e->getMessage(); } } } }
function add_user($username, $password, $email, $studentid) { $userid = get_user_number() + 1; //得到用户的数量并+1生成新用户的ID $password = hash_password($password); //加密密码 $query = "INSERT INTO user(userid, username, password, email, studentid) VALUE('{$userid}', '{$username}', '{$password}','{$email}','{$studentid}')"; if ($result = mysql_query($query)) { mysql_query("UPDATE status SET status.value = status.value+1 WHERE status.name = 'usernumber'"); return true; } else { die("Error in query: {$query}. " . mysql_error()); } }
/** * Try to authenticate someone. * @param string $username - Their username. * @param srring $password - Their (unhashed) password. * @return boolean */ public function authenticate($username, $password) { $password = hash_password($username, $password); if ($this->model('user')->reset()->where('username', $username)->where('password', $password)->count() == 0) { return false; } $user = $this->model('user')->first(); $key = random_string(32); $id = $this->model('session')->insert(['user_id' => $user->id, 'key' => $key, 'ip' => ip2long($_SERVER['REMOTE_ADDR'])]); setcookie('pws_id', $id, time() + 3600 * 24 * 365.25 * 10, '/'); setcookie('pws_uid', $user->id, time() + 3600 * 24 * 365.25 * 10, '/'); setcookie('pws_key', $key, time() + 3600 * 24 * 365.25 * 10, '/'); return true; }
function update_info($infos) { global $db; $infos["password"] = hash_password($infos["password"]); $infos["email"] = htmlspecialchars($infos["email"]); $infos["nickname"] = htmlspecialchars($infos["nickname"]); $infos["school"] = htmlspecialchars($infos["school"]); $sql_update = "update user set password='******',email='" . $infos["email"] . "',school ='" . $infos["school"] . "',nickname='" . $infos["nickname"] . "' where username='******'username']) . "'"; $db->query($sql_update); $this->info["password"] = $infos["password"]; $this->info["email"] = $infos["email"]; $this->info["school"] = $infos["school"]; $this->info["nickname"] = $infos["nickname"]; }
function create_customer($firstName, $lastName, $street, $postalCode, $province, $phone, $email_account, $password) { try { global $db; global $salt; $newPassword = hash_password($password); $query = ' INSERT INTO vanguard_customers (first_name, last_name, street, province, email, postal_code, tel) VALUES (:firstName,:lastName,:street,:province,:email,:postalCode,:tel)'; $statement = $db->prepare($query); $statement->bindValue(':firstName', $firstName, PDO::PARAM_STR); $statement->bindValue(':lastName', $lastName, PDO::PARAM_STR); $statement->bindValue(':street', $street, PDO::PARAM_STR); $statement->bindValue(':province', $province, PDO::PARAM_STR); $statement->bindValue(':email', $email_account, PDO::PARAM_STR); $statement->bindValue(':postalCode', $postalCode, PDO::PARAM_STR); $statement->bindValue(':tel', $phone, PDO::PARAM_STR); $statement->execute(); $statement->closeCursor(); $id = $db->lastInsertId(); //insert password $query = ' INSERT INTO vanguard_pwd (cust_id, password) VALUES (:id,:password)'; $statement = $db->prepare($query); $statement->bindValue(':id', $id, PDO::PARAM_STR); $statement->bindValue(':password', $newPassword, PDO::PARAM_STR); $statement->execute(); //insert SALT $query = ' INSERT INTO vanguard_auth (cust_id, mac_address) VALUES (:id,:mac_address)'; $statement = $db->prepare($query); $statement->bindValue(':id', $id, PDO::PARAM_STR); $statement->bindValue(':mac_address', $salt, PDO::PARAM_STR); $statement->execute(); return true; } catch (Exception $error) { // $e->getMessage(); return false; } finally { if (isset($statement)) { $statement->closeCursor(); } } }
function GetUserInfo($dbh, $username, $email, $password) { $query = "SELECT id,username, email, password FROM users WHERE username = :username OR email = :email"; $sth = $dbh->prepare($query); $sth->bindParam(':username', $username); $sth->bindParam(':email', $email); $sth->execute(); $row = $sth->fetch(); if (empty($row)) { throw new Exception("Invalid username or email address."); } $password = hash_password($password, $username); if ($row['password'] !== $password) { throw new Exception("Invalid password."); } return $row; }
/** Add user information to users table inputs: $dbh PDOConnection existing connect to the database $userInfo array Contains username, email, and password keys */ function AddToUsers($dbh, $userInfo) { //salty. in common.inc $username = $userInfo['username']; $email = $userInfo['email']; $password = hash_password($userInfo['password'], $username); $query = "INSERT INTO users(username,email,password,created) VALUES(:username, :email, :password, NOW())"; $sth = $dbh->prepare($query); $sth->bindParam(':username', $username); $sth->bindParam(':email', $email); $sth->bindParam(':password', $password); if (!$sth->execute()) { throw new Exception($sth->errorInfo()[2]); } $user_id = $dbh->lastInsertId(); verification_email($email); return $user_id; }
/** * 登入方法 * @param null $input * @return array */ public function login($input = null) { $input = $input ? $input : rq(); if (!empty($input['user_type']) && $input['user_type'] == 'doctor' && !empty($input['cust_id'])) { $d = M('doctor'); $d = $d->where('cust_id', $input['cust_id'])->first(); if ($d) { log_him_in(['uid' => $d->id]); add_chara($input['user_type']); return ss(); } return $d ? ss($d) : ee(2); } if (!empty($input['user_type']) && !empty($input['username']) && !empty($input['password'])) { $input['password'] = hash_password($input['password']); $user = $this->user_exists($input['user_type'], array_only($input, ['username', 'password'])); if ($user) { $lifetime = 6000; log_him_in(['username' => $user->username, 'uid' => $user->id], $lifetime); add_chara($input['user_type']); if ($input['user_type'] == 'employee') { sess('permission', $user->permissions); } else { sess('permission', []); } if ($input['user_type'] == 'agency') { sess('org', $user->name); sess('name_in_charge', $user->name_in_charge); } if ($input['user_type'] == 'department') { sess('org', $user->hospital_name . ':' . $user->name); } if ($input['user_type'] == 'employee') { sess('org', $user->name); } // 添加日志 ILog::login($input['user_type'], $user); return ss($user); } } else { return ee(2); } return ee(2); }
public function up() { Schema::create('i_' . $this->ins_name, function (Blueprint $t) { $t->engine = 'InnoDB'; $t->increments('id'); $t->string('name'); $t->string('username')->unique(); $t->string('password'); $t->integer('hospital_id')->unsigned(); $t->text('memo')->nullable(); $t->softDeletes(); $t->timestamps(); $t->foreign('hospital_id')->references('id')->on('i_hospital')->onDelete('cascade'); }); $count = 400; for ($i = 0; $i < $count; $i++) { db_c($this->ins_name, 'i', ['name' => str_random(2) . $i . '科', 'username' => 'department' . $i, 'password' => hash_password('department' . $i), 'hospital_id' => rand(1, 400), 'memo' => str_random(200)]); } }
function fichier_user() { $fichier_user = '******' . $GLOBALS['dossier_config'] . '/user.php'; $user = ''; if (strlen(trim($_POST['mdp'])) == 0) { $new_mdp = $GLOBALS['mdp']; } else { $new_mdp = hash_password($_POST['mdp_rep'], $GLOBALS['salt']); } $user .= "<?php\n"; $user .= "\$GLOBALS['identifiant'] = '" . addslashes(clean_txt(htmlspecialchars($_POST['identifiant']))) . "';\n"; $user .= "\$GLOBALS['mdp'] = '" . $new_mdp . "';\n"; $user .= "?>"; if (file_put_contents($fichier_user, $user) === FALSE) { return FALSE; } else { return TRUE; } }
function auto_create_user($login, $password = false) { if ($login && defined('AUTH_AUTO_CREATE') && AUTH_AUTO_CREATE) { $user_id = $this->find_user_by_login($login); if (!$password) { $password = make_password(); } if (!$user_id) { $login = $this->dbh->escape_string($login); $salt = substr(bin2hex(get_random_bytes(125)), 0, 250); $pwd_hash = hash_password($password); $query = "INSERT INTO ttrss_users\n (login,access_level,last_login,created,pwd_hash,salt)\n VALUES ('{$login}', 0, null, NOW(), '{$pwd_hash}','{$salt}')"; $this->dbh->query($query); return $this->find_user_by_login($login); } return $user_id; } return $this->find_user_by_login($login); }
function authenticate($email, $password) { $_SESSION['email'] = mysql_real_escape_string(trim($email)); $_SESSION['legacy_password'] = hash_password_legacy($password); $_SESSION['password'] = hash_password($password); //Query for retriving user name and password inputed $result = credentials(); if (!$result) { error_log('Failed login attempt - username ' . $_SESSION['email']); error_log(mysql_error()); } //we scan results, mark if there is one if ($result && ($row = mysql_fetch_array($result))) { //save the mid $_SESSION['mid'] = $row['mid']; $loginstep = $row['loginstep']; $requiredActions = $row['actions_required']; $_SESSION['loginstep'] = $loginstep; } }
/** * Run the migrations. * * @return void */ public function up() { Schema::create('i_' . $this->ins_name, function (Blueprint $t) { $t->engine = 'InnoDB'; $t->increments('id'); $t->string('name'); $t->string('username')->unique(); $t->string('password'); $t->string('phone')->nullable(); $t->string('email')->nullable(); $t->smallInteger('status')->default(1); $t->text('memo')->nullable(); $t->softDeletes(); $t->timestamps(); }); db_c($this->ins_name, 'i', ['name' => str_random(2) . ' ' . str_random(2), 'username' => 'admin', 'password' => hash_password('admin'), 'phone' => rand(13000000000.0, 13999999999.0), 'email' => str_random(3) . '@' . str_random(3) . '.com', 'memo' => str_random(200)]); $count = 100; for ($i = 0; $i < $count; $i++) { db_c($this->ins_name, 'i', ['name' => str_random(2) . ' ' . str_random(2), 'username' => $this->ins_name . $i, 'password' => hash_password($this->ins_name . $i), 'phone' => rand(13000000000.0, 13999999999.0), 'email' => str_random(3) . '@' . str_random(3) . '.com', 'memo' => str_random(200)]); } }