English 中文(简体)
Codeigniter/PHP: Creatinguser in thebatch withtankAuth
原标题:Codeigniter/PHP: Creating users in batch with TankAuth
最佳回答

象对我进行简单的排他性手术这样的声音

某种方式(无论来源如何)使用户名以可操作的形式获得,例如一个阵列 用户_list

我们恳切地说,它喜欢这样做。

Array(
    Array(
        [username] =>  ... ,
        [email]    =>  ... ,
        [password] =>   ,     //leave password empty
    ),
    Array(
        [username] =>  ... ,
        [email]    =>  ... ,
        [password] =>   ,     //leave password empty
    ),
    ... etc.
)

然后,为办理新登记手续、将密码重新排入阵列创造了简便的例行程序,因此,你将有一个完整的标识清单、新的(占支配地位的)密码和电子邮件。

//loop by referance in order to properly store the generated password
foreach($user_list as &$user) {

    //generate 8 char password and store it
    $user[ password ] = substr(uniqid(),2,8);

    //run register routine (not sure on tank auth s specific syntax
    $this->tankauth->register($user[ username ],$user[ email ],$user[ password ],FALSE);
}

之后,<代码> 用户_list载有用户的所有新密码。

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签