|
@@ 64-74 (lines=11) @@
|
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
//autentica email verifica se o email e senha existem para efetuar o login, ou outra acao. |
| 64 |
|
public function autentica_email($email,$senha){ |
| 65 |
|
$this->loadModel('Usuario'); |
| 66 |
|
$resposta = $this->Usuario->find('count', |
| 67 |
|
array('conditions' => array('AND' => array('Usuario.email' => $email, 'Usuario.senha' => sha1($senha)) |
| 68 |
|
) |
| 69 |
|
) |
| 70 |
|
); |
| 71 |
|
$this->set('resposta', $resposta); |
| 72 |
|
|
| 73 |
|
return $resposta; |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
//se o email estiver livre retorna false, senĂ£o retorna true |
| 77 |
|
public function verificar_email($email){ |
|
@@ 97-108 (lines=12) @@
|
| 94 |
|
} |
| 95 |
|
} |
| 96 |
|
|
| 97 |
|
public function recuperar_dados($email,$senha){ |
| 98 |
|
$this->loadModel('Usuario'); |
| 99 |
|
$resposta = $this->Usuario->find('all', |
| 100 |
|
array('conditions' => array('AND' => array('Usuario.email' => $email, 'Usuario.senha' => sha1($senha)) |
| 101 |
|
) |
| 102 |
|
) |
| 103 |
|
); |
| 104 |
|
|
| 105 |
|
$this->set('resposta', $resposta); |
| 106 |
|
|
| 107 |
|
return $resposta; |
| 108 |
|
} |
| 109 |
|
|
| 110 |
|
public function novo_usuario() { |
| 111 |
|
$dados = $this->request->data('dados'); |