mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-09 11:03:17 +00:00
Fix unit tests
This commit is contained in:
@@ -1463,10 +1463,15 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
|
||||
if (!$session->hasModuleId($app_id)) {
|
||||
$module = new \Entities\SessionModule();
|
||||
|
||||
$module->setModuleId($app_id);
|
||||
$module->setSession($session);
|
||||
$session->addSessionModule($module);
|
||||
|
||||
$app['EM']->persist($module);
|
||||
$app['EM']->persist($session);
|
||||
|
||||
$app['EM']->flush();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -110,6 +110,12 @@ class User_Query implements User_QueryInterface
|
||||
*/
|
||||
protected $only_templates = false;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $email_not_null = false;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Array
|
||||
@@ -222,6 +228,10 @@ class User_Query implements User_QueryInterface
|
||||
$sql .= ' AND usr.invite=0 ';
|
||||
}
|
||||
|
||||
if ( ! $this->email_not_null) {
|
||||
$sql .= ' AND usr.usr_mail IS NOT NULL ';
|
||||
}
|
||||
|
||||
if ($this->only_templates === true) {
|
||||
$sql .= ' AND model_of = ' . $this->app['phraseanet.user']->get_id();
|
||||
} elseif ($this->include_templates === false) {
|
||||
@@ -439,6 +449,18 @@ class User_Query implements User_QueryInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param boolean $boolean
|
||||
* @return User_Query
|
||||
*/
|
||||
public function email_not_null($boolean)
|
||||
{
|
||||
$this->email_not_null = ! ! $boolean;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array $rights
|
||||
|
Reference in New Issue
Block a user