Files
Phraseanet/lib/Alchemy/Phrasea/Form/Constraint/NewEmail.php
2013-05-29 14:23:18 +02:00

36 lines
768 B
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Form\Constraint;
use Alchemy\Phrasea\Application;
use Symfony\Component\Validator\Constraint;
class NewEmail extends Constraint
{
private $app;
private $message;
public function __construct(Application $app)
{
$this->message = _('This email is already bound to an account');
$this->app = $app;
parent::__construct();
}
public function isAlreadyRegistered($email)
{
$ret = (Boolean) \User_Adapter::get_usr_id_from_email($this->app, $email);
return $ret;
}
}