Frage

I'm using ZendFramework and My current register form allow anyone to create an account to download files in my website, I want to have control of that by allowing or not their registration, I want to receive an email with their forms and then choose if they can log in, my code for now is this:

$Cadastrar=$this->App->BancoDeDados->exec("
INSERT INTO 
".EAMConfig::$PrefixoDB."usuarios(
    usuario,senha,grupo_id,
    nome,email,criado,
    ativo) 
VALUES (
    '".$frm_email."','".$senha."','2',
    '".$frm_nome."','".$frm_email."','".date('Y-m-d H:i:s')."',
    '1')"); 
War es hilfreich?

Lösung

You can add another column to the usuarios table called confirm that is boolean. When an user registers this will be set to false. After the insert you can call the mail function.

http://framework.zend.com/manual/1.12/en/zend.mail.introduction.html

You can go in the database and confirm users as you get emails then by switching confirm to true. On your login page you check if the user has been confirm or not by checking that column.

Here is what I could find on the login form. http://framework.zend.com/manual/1.12/en/learning.multiuser.authentication.html

After this line. You would check if the user was confirm or not. if ($result->isValid()) {

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top