XAPI: Fix namespace for LrsAuth - refs BT#16742

pull/3687/head
Angel Fernando Quiroz Campos 5 years ago
parent a6d80d263b
commit d65f1f6d1b
  1. 4
      plugin/xapi/admin.php
  2. 2
      plugin/xapi/src/Entity/LrsAuth.php
  3. 5
      plugin/xapi/src/Lrs/LrsRequest.php

@ -2,6 +2,8 @@
/* For licensing terms, see /license.txt */
use Chamilo\PluginBundle\Entity\XApi\LrsAuth;
$cidReset = true;
require_once __DIR__.'/../../main/inc/global.inc.php';
@ -17,7 +19,7 @@ $pageActions = '';
$pageContent = '';
/**
* @param \LrsAuth|null $auth
* @param \Chamilo\PluginBundle\Entity\XApi\LrsAuth|null $auth
*
* @throws \Exception
*

@ -9,6 +9,8 @@ use Doctrine\ORM\Mapping as ORM;
/**
* Class LrsAuth.
*
* @package Chamilo\PluginBundle\Entity\XApi
*
* @ORM\Table(name="xapi_lrs_auth")
* @ORM\Entity()
*/

@ -4,6 +4,7 @@
namespace Chamilo\PluginBundle\XApi\Lrs;
use Chamilo\PluginBundle\Entity\XApi\LrsAuth;
use Symfony\Component\HttpFoundation\Request as HttpRequest;
use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
@ -133,9 +134,9 @@ class LrsRequest
list($username, $password) = $parts;
$auth = \Database::getManager()
->getRepository(\LrsAuth::class)
->getRepository(LrsAuth::class)
->findOneBy(
['username' => $username, 'password' => $password]
['username' => $username, 'password' => $password, 'enabled' => true]
);
if (null == $auth) {

Loading…
Cancel
Save