changes Auth entity where clause

This commit is contained in:
Taras Machyshyn
2013-12-16 11:03:02 +02:00
parent 9ec2b26d38
commit 6533caf7e4
2 changed files with 20 additions and 7 deletions
+9 -2
View File
@@ -48,14 +48,21 @@ class Auth extends \Slim\Middleware
$username = $authKey;
$password = $authSec;
$user = $this->entityManager->getRepository('User')->findOne(array('userName' => $username));
if ($user) {
//$user = $this->entityManager->getRepository('User')->findOne(array('userName' => $username));
$user = $this->entityManager->getRepository('User')->findOne(array(
'whereClause' => array(
'userName' => $username,
),
));
if ($user instanceof \Espo\Entities\User) {
if ($password == $user->get('password')) {
$this->container->setUser($user);
$isAuthenticated = true;
}
}
if ($isAuthenticated) {
$this->next->call();
} else {
+11 -5
View File
@@ -49,15 +49,21 @@ class Auth extends \Slim\Middleware
$username = $authKey;
$password = $authSec;
/*$user = $this->entityManager->getRepository('User')->findOneBy(array('username' => $username));
if ($user) {
if ($password == $user->getPassword()) {
$user = $this->entityManager->getRepository('User')->findOne(array(
'whereClause' => array(
'userName' => $username,
),
));
if ($user instanceof \Espo\Entities\User) {
if ($password == $user->get('password')) {
$this->container->setUser($user);
$isAuthenticated = true;
}
} */
}
//$isAuthenticated = true;
$isAuthenticated = true;
if ($isAuthenticated) {
$this->next->call();