Fix# avoid deprecated \OCP\DB

This commit is contained in:
Pellaeon Lin 2016-02-13 14:18:56 +08:00
parent 716db75f9a
commit 95084a18f1
1 changed files with 3 additions and 3 deletions

View File

@ -152,7 +152,7 @@ class RegisterController extends Controller {
*/ */
public function verifyToken($token) { public function verifyToken($token) {
$email = $this->pendingreg->findEmailByToken($token); $email = $this->pendingreg->findEmailByToken($token);
if ( \OCP\DB::isError($email) ) { if ( $email === false ) {
return new TemplateResponse('', 'error', array( return new TemplateResponse('', 'error', array(
'errors' => array(array( 'errors' => array(array(
'error' => $this->l10n->t('Invalid verification URL. No registration request with this verification URL is found.'), 'error' => $this->l10n->t('Invalid verification URL. No registration request with this verification URL is found.'),
@ -169,7 +169,7 @@ class RegisterController extends Controller {
*/ */
public function createAccount($token) { public function createAccount($token) {
$email = $this->pendingreg->findEmailByToken($token); $email = $this->pendingreg->findEmailByToken($token);
if ( \OCP\DB::isError($email) ) { if ( $email === false ) {
return new TemplateResponse('', 'error', array( return new TemplateResponse('', 'error', array(
'errors' => array(array( 'errors' => array(array(
'error' => $this->l10n->t('Invalid verification URL. No registration request with this verification URL is found.'), 'error' => $this->l10n->t('Invalid verification URL. No registration request with this verification URL is found.'),
@ -225,7 +225,7 @@ class RegisterController extends Controller {
// Delete pending reg request // Delete pending reg request
$res = $this->pendingreg->delete($email); $res = $this->pendingreg->delete($email);
if ( \OCP\DB::isError($res) ) { if ( $res === false ) {
return new TemplateResponse('', 'error', array( return new TemplateResponse('', 'error', array(
'errors' => array(array( 'errors' => array(array(
'error' => $this->l10n->t('Failed to delete pending registration request'), 'error' => $this->l10n->t('Failed to delete pending registration request'),