Update# directly delete pending registration after successfully
registered
This commit is contained in:
parent
b3ad29b23f
commit
51e92b9a17
|
|
@ -171,12 +171,12 @@ class RegisterController extends Controller {
|
|||
'errormsgs' => array($e->message, $username, $password)), 'guest');
|
||||
}
|
||||
|
||||
// Mark registered
|
||||
$res = $this->pendingreg->setRegistered($token);
|
||||
// Delete pending reg request
|
||||
$res = $this->pendingreg->delete($email);
|
||||
if ( \OCP\DB::isError($res) ) {
|
||||
return new TemplateResponse('', 'error', array(
|
||||
'errors' => array(array(
|
||||
'error' => $this->l10n->t('Invalid verification URL. No registration request with this verification URL is found.'),
|
||||
'error' => $this->l10n->t('Failed to delete pending registration request'),
|
||||
'hint' => ''
|
||||
))
|
||||
), 'error');
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@ class PendingRegist {
|
|||
return $query->execute(array($email))->fetchAll();
|
||||
}
|
||||
|
||||
public function delete($email) {
|
||||
$query = $this->db->prepareQuery('DELETE FROM `*PREFIX*registration` WHERE `email` = ? ');
|
||||
return $query->execute(array($email));
|
||||
}
|
||||
|
||||
public function findEmailByToken($token) {
|
||||
$query = $this->db->prepareQuery('SELECT `email` FROM `*PREFIX*registration` WHERE `token` = ? ');
|
||||
return $query->execute(array($token))->fetchOne();
|
||||
}
|
||||
|
||||
public function setRegistered($token) {
|
||||
$query = $this->db->prepareQuery('UPDATE `*PREFIX*registration` SET `registered`=true WHERE `token` = ? ');
|
||||
return $query->execute(array($token));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue