Compresse les fichiers de données
Corrige un problème dans la fonction getCoursesByUser lorsque le membre a un rôle inférieur à EDITOR
This commit is contained in:
parent
cf0fb4df53
commit
4387dcda7a
@ -143,7 +143,7 @@ class JsonDb extends \Prowebcraft\Dot
|
|||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
//$v = json_encode($this->data, JSON_UNESCAPED_UNICODE );
|
//$v = json_encode($this->data, JSON_UNESCAPED_UNICODE );
|
||||||
$v = json_encode($this->data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
|
$v = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
|
||||||
$l = strlen($v);
|
$l = strlen($v);
|
||||||
$t = 0;
|
$t = 0;
|
||||||
while ($t < 5) {
|
while ($t < 5) {
|
||||||
|
@ -1438,8 +1438,8 @@ class common
|
|||||||
case self::GROUP_MEMBER:
|
case self::GROUP_MEMBER:
|
||||||
case self::GROUP_VISITOR:
|
case self::GROUP_VISITOR:
|
||||||
foreach ($c as $courseId => $value) {
|
foreach ($c as $courseId => $value) {
|
||||||
$students = $this->getData(['enrolment', $courseId, 'students']);
|
$students = $this->getData(['enrolment', $courseId]);
|
||||||
if (in_array($userId, $students) === false) {
|
if (is_array($students[$userId]) === false) {
|
||||||
unset($c[$courseId]);
|
unset($c[$courseId]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user