changes Auth entity where clause
This commit is contained in:
@@ -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
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user