Email de recuperación

This commit is contained in:
Juan Ferrer Toribio 2017-05-22 09:49:05 +02:00
parent f36bc0afdf
commit 5b50b3cc64
4 changed files with 7 additions and 9 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.405.1) stable; urgency=low
hedera-web (1.405.2) stable; urgency=low
* Initial Release.

View File

@ -11,8 +11,7 @@
<db-form id="user-form">
<db-model property="model" id="user-model" updatable="true">
<custom>
SELECT u.id, u.name, u.recoverPass,
c.email, c.mail, c.user_id
SELECT u.id, u.name, u.email, u.recoverPass, c.mail, c.user_id
FROM account.userView u
LEFT JOIN customer_view c
ON u.id = c.user_id

View File

@ -9,14 +9,11 @@ class RecoverPassword extends Vn\Web\JsonRequest
function run ($db)
{
$user = $db->getRow (
'SELECT c.`e-mail` mail, u.active
FROM vn2008.Clientes c
JOIN account.user u ON u.id = c.Id_Cliente
WHERE u.name = #',
'SELECT email, active FROM account.user WHERE name = #',
[$_REQUEST['recoverUser']]
);
if (!($user['active'] && $user['mail']))
if (!($user['active'] && $user['email']))
return TRUE;
$service = $this->service;
@ -24,7 +21,7 @@ class RecoverPassword extends Vn\Web\JsonRequest
$url = $service->getUrl () ."#!form=account/conf&token=$token";
$report = new Vn\Web\Report ($db, 'recover-password', ['url' => $url]);
$report->sendMail ($user['mail']);
$report->sendMail ($user['email']);
return TRUE;
}

View File

@ -290,6 +290,8 @@ abstract class Service
Locale::addPath ('rest/'. dirname ($_REQUEST['method']));
$res = NULL;
try {
$res = $method->run ($methodDb);
}