|
|
|
@ -2,6 +2,8 @@ |
|
|
|
|
|
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
|
|
|
|
|
use Chamilo\CoreBundle\Framework\Container; |
|
|
|
|
|
|
|
|
|
require_once __DIR__.'/../inc/global.inc.php'; |
|
|
|
|
|
|
|
|
|
ini_set('memory_limit', -1); |
|
|
|
@ -43,7 +45,7 @@ function WSHelperVerifyKey($params) |
|
|
|
|
// if we are behind a reverse proxy, assume it will send the |
|
|
|
|
// HTTP_X_FORWARDED_FOR header and use this IP instead |
|
|
|
|
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
|
|
|
|
list($ip1) = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); |
|
|
|
|
[$ip1] = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); |
|
|
|
|
$ip = trim($ip1); |
|
|
|
|
} |
|
|
|
|
if ($debug) { |
|
|
|
@ -457,7 +459,7 @@ function WSDeleteLp($params) |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
$lp = \Chamilo\CoreBundle\Framework\Container::getLpRepository()->find($lpId); |
|
|
|
|
$lp = Container::getLpRepository()->find($lpId); |
|
|
|
|
$lp = new learnpath($lp, $lpId, null); |
|
|
|
|
if ($lp) { |
|
|
|
|
if ($debug) { |
|
|
|
@ -469,7 +471,7 @@ function WSDeleteLp($params) |
|
|
|
|
if (!empty($items)) { |
|
|
|
|
/** @var $item learnpathItem */ |
|
|
|
|
foreach ($items as $itemId) { |
|
|
|
|
$item = new learnpathItem($itemId, null, $courseId); |
|
|
|
|
$item = new learnpathItem($lp, $itemId, $courseId); |
|
|
|
|
|
|
|
|
|
if ($item) { |
|
|
|
|
$documentId = $item->get_path(); |
|
|
|
|