From 6f4a887d51024ab3dff1cb2c7f8d496880d58152 Mon Sep 17 00:00:00 2001
From: llaffont <llaffont@e3cc70dd-a52f-4065-8a26-0e09943c8c5c>
Date: Mon, 26 Aug 2013 15:16:16 +0000
Subject: [PATCH] Correction import des abonnes cosmogramme

git-svn-id: http://afi-forge.afi-sa.fr/svn/opacce/trunk@2599 e3cc70dd-a52f-4065-8a26-0e09943c8c5c
---
 library/Class/Users.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/library/Class/Users.php b/library/Class/Users.php
index 3ac88c9304a..ac6633f33da 100644
--- a/library/Class/Users.php
+++ b/library/Class/Users.php
@@ -630,10 +630,10 @@ class Class_Users extends Storm_Model_Abstract {
 	//------------------------------------------------------------------------------------------------------
 	// Vérification pour eviter les doublons de login
 	//------------------------------------------------------------------------------------------------------
-	public function ifLoginExist($login) {
+	public function ifLoginExist($login, $site) {
 		$login = (trim($login));
 
-		$login = $this->getLoader()->findFirstBy(array('login' => $login));
+		$login = $this->getLoader()->findFirstBy(['login' => $login, 'id_site' => $site]);
 		return ($login != null);
 	}
 
@@ -644,7 +644,7 @@ class Class_Users extends Storm_Model_Abstract {
 		$this->check(mb_strlen($this->getLogin(),'UTF-8') <= 50, $this->_translate->_("Le champ 'Identifiant' doit être inférieur à 50 caractères"));
 
 		if ($this->isNew()) {
-			$this->check($this->ifLoginExist($this->getLogin()) == false,
+			$this->check($this->ifLoginExist($this->getLogin(), $this->getIdSite()) == false,
 									 $this->_translate->_("L'identifiant que vous avez choisi existe déjà."));
 		}
 
-- 
GitLab