Skip to content

Commit 7d0e6bf

Browse files
committed
Merge branch 'master' of github.com:chamilo/chamilo-lms
2 parents ac1bef0 + f8a217e commit 7d0e6bf

26 files changed

+419
-394
lines changed

.yarn/releases/yarn-4.9.1.cjs renamed to .yarn/releases/yarn-4.9.2.cjs

Lines changed: 273 additions & 279 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
nodeLinker: node-modules
22

3-
yarnPath: .yarn/releases/yarn-4.9.1.cjs
3+
yarnPath: .yarn/releases/yarn-4.9.2.cjs

config/authentication.dist.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,16 @@ parameters:
5050
client_id: ''
5151
client_secret: ''
5252
url_api: 'https://graph.microsoft.com'
53+
tenant: '6d53d383-2e87-49dd-a756-d6156a484698'
54+
force_logout: false
55+
provisioning: false
56+
update_users: false
57+
group_id:
58+
admin: ''
59+
session_admin: ''
60+
teacher: ''
61+
existing_user_verification_order: ''
62+
deactivate_nonexisting_users: false
63+
script_users_delta: false
64+
script_usergroups_delta: false
65+
group_filter_regex: ''

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,5 @@
148148
"autoprefixer": "10.4.5"
149149
},
150150
"license": "GPL-3.0",
151-
"packageManager": "yarn@4.9.1"
151+
"packageManager": "yarn@4.9.2"
152152
}

src/CoreBundle/Controller/AccountController.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Chamilo\CoreBundle\Repository\Node\UserRepository;
1515
use Chamilo\CoreBundle\Settings\SettingsManager;
1616
use Chamilo\CoreBundle\Traits\ControllerTrait;
17+
use DateTimeImmutable;
1718
use Endroid\QrCode\Builder\Builder;
1819
use Endroid\QrCode\Encoding\Encoding;
1920
use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelHigh;
@@ -77,7 +78,7 @@ public function edit(
7778
$password = $form['password']->getData();
7879
if ($password) {
7980
$user->setPlainPassword($password);
80-
$user->setPasswordUpdatedAt(new \DateTimeImmutable());
81+
$user->setPasswordUpdatedAt(new DateTimeImmutable());
8182
}
8283
}
8384

@@ -113,21 +114,21 @@ public function changePassword(
113114

114115
if (!$user || !$user instanceof UserInterface) {
115116
$userId = $request->query->get('userId');
116-
//error_log("User not logged in. Received userId from query: " . $userId);
117+
// error_log("User not logged in. Received userId from query: " . $userId);
117118

118119
if (!$userId || !ctype_digit($userId)) {
119-
//error_log("Access denied: Missing or invalid userId.");
120+
// error_log("Access denied: Missing or invalid userId.");
120121
throw $this->createAccessDeniedException('This user does not have access to this section.');
121122
}
122123

123-
$user = $userRepository->find((int)$userId);
124+
$user = $userRepository->find((int) $userId);
124125

125126
if (!$user || !$user instanceof UserInterface) {
126-
//error_log("Access denied: User not found with ID $userId");
127+
// error_log("Access denied: User not found with ID $userId");
127128
throw $this->createAccessDeniedException('User not found or invalid.');
128129
}
129130

130-
//error_log("Loaded user by ID: " . $user->getId());
131+
// error_log("Loaded user by ID: " . $user->getId());
131132
}
132133

133134
$isRotation = $request->query->getBoolean('rotate', false);
@@ -163,7 +164,7 @@ public function changePassword(
163164

164165
$totp = TOTP::create($secret);
165166
$portalName = $settingsManager->getSetting('platform.institution');
166-
$totp->setLabel($portalName . ' - ' . $user->getEmail());
167+
$totp->setLabel($portalName.' - '.$user->getEmail());
167168

168169
$qrCodeResult = Builder::create()
169170
->writer(new PngWriter())
@@ -172,7 +173,8 @@ public function changePassword(
172173
->errorCorrectionLevel(new ErrorCorrectionLevelHigh())
173174
->size(300)
174175
->margin(10)
175-
->build();
176+
->build()
177+
;
176178

177179
$qrCodeBase64 = base64_encode($qrCodeResult->getString());
178180
$showQRCode = true;
@@ -224,7 +226,7 @@ public function changePassword(
224226
));
225227
} else {
226228
$user->setPlainPassword($newPassword);
227-
$user->setPasswordUpdatedAt(new \DateTimeImmutable());
229+
$user->setPasswordUpdatedAt(new DateTimeImmutable());
228230
$userRepository->updateUser($user);
229231
$this->addFlash('success', 'Password updated successfully.');
230232

@@ -244,10 +246,10 @@ public function changePassword(
244246
}
245247
}
246248
} else {
247-
error_log("Form is NOT valid.");
249+
error_log('Form is NOT valid.');
248250
}
249251
} else {
250-
error_log("Form NOT submitted yet.");
252+
error_log('Form NOT submitted yet.');
251253
}
252254

253255
return $this->render('@ChamiloCore/Account/change_password.html.twig', [
@@ -267,7 +269,7 @@ private function encryptTOTPSecret(string $secret, string $encryptionKey): strin
267269
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($cipherMethod));
268270
$encryptedSecret = openssl_encrypt($secret, $cipherMethod, $encryptionKey, 0, $iv);
269271

270-
return base64_encode($iv . '::' . $encryptedSecret);
272+
return base64_encode($iv.'::'.$encryptedSecret);
271273
}
272274

273275
/**

src/CoreBundle/Controller/CourseController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
use Exception;
5353
use Exercise;
5454
use ExtraFieldValue;
55-
use Fhaculty\Graph\Graph;
5655
use Graphp\GraphViz\GraphViz;
5756
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
5857
use Symfony\Bundle\SecurityBundle\Security;
@@ -290,6 +289,7 @@ public function getNextCourse(
290289
foreach ($sequence['requirements'] ?? [] as $resource) {
291290
if ($resource instanceof Course) {
292291
$hasValidRequirement = true;
292+
293293
break 2;
294294
}
295295
}
@@ -308,7 +308,7 @@ public function getNextCourse(
308308

309309
if ($sequenceResource && $sequenceResource->hasGraph()) {
310310
$graph = $sequenceResource->getSequence()->getUnSerializeGraph();
311-
if ($graph !== null) {
311+
if (null !== $graph) {
312312
$graph->setAttribute('graphviz.node.fontname', 'arial');
313313
$graphviz = new GraphViz();
314314
$graphImage = $graphviz->createImageSrc($graph);

src/CoreBundle/Controller/ExceptionController.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ public function undefinedUrlError(
106106
$themeHost = rtrim($accessUrl?->getUrl() ?? '', '/');
107107
$themeName = 'chamilo';
108108

109-
$cssUrl = $themeHost . $urlGenerator->generate('theme_asset', [
110-
'name' => $themeName,
111-
'path' => 'colors.css',
112-
], UrlGeneratorInterface::ABSOLUTE_PATH);
113-
114-
$logoUrl = $themeHost . $urlGenerator->generate('theme_asset', [
115-
'name' => $themeName,
116-
'path' => 'images/header-logo.svg',
117-
], UrlGeneratorInterface::ABSOLUTE_PATH);
109+
$cssUrl = $themeHost.$urlGenerator->generate('theme_asset', [
110+
'name' => $themeName,
111+
'path' => 'colors.css',
112+
], UrlGeneratorInterface::ABSOLUTE_PATH);
113+
114+
$logoUrl = $themeHost.$urlGenerator->generate('theme_asset', [
115+
'name' => $themeName,
116+
'path' => 'images/header-logo.svg',
117+
], UrlGeneratorInterface::ABSOLUTE_PATH);
118118

119119
return $this->render('@ChamiloCore/Exception/undefined_url.html.twig', [
120120
'host' => $host,

src/CoreBundle/Controller/ResourceController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,9 @@ public function changeVisibilityAll(
473473
->getResult()
474474
;
475475

476-
$skipTools = ['course_tool',
477-
// 'chat',
478-
// 'notebook',
476+
$skipTools = ['course_tool',
477+
// 'chat',
478+
// 'notebook',
479479
// 'wiki'
480480
];
481481

src/CoreBundle/Controller/SecurityController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Chamilo\CoreBundle\Repository\TrackELoginRecordRepository;
1818
use Chamilo\CoreBundle\Settings\SettingsManager;
1919
use DateTime;
20+
use DateTimeImmutable;
2021
use Doctrine\ORM\EntityManagerInterface;
2122
use Exception;
2223
use OTPHP\TOTP;
@@ -149,7 +150,7 @@ public function loginJson(
149150
$days = (int) $this->settingsManager->getSetting('security.password_rotation_days', true);
150151
if ($days > 0) {
151152
$lastUpdate = $user->getPasswordUpdatedAt() ?? $user->getCreatedAt();
152-
$diffDays = (new \DateTimeImmutable())->diff($lastUpdate)->days;
153+
$diffDays = (new DateTimeImmutable())->diff($lastUpdate)->days;
153154

154155
if ($diffDays > $days) {
155156
// Clean token & session
@@ -158,7 +159,7 @@ public function loginJson(
158159

159160
return $this->json([
160161
'rotate_password' => true,
161-
'redirect' => '/account/change-password?rotate=1&userId=' . $user->getId(),
162+
'redirect' => '/account/change-password?rotate=1&userId='.$user->getId(),
162163
]);
163164
}
164165
}

src/CoreBundle/Controller/SessionController.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
use Essence\Essence;
3131
use ExtraFieldValue;
3232
use Graphp\GraphViz\GraphViz;
33-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Entity;
3433
use SessionManager;
3534
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
3635
use Symfony\Bundle\SecurityBundle\Security;
@@ -360,15 +359,13 @@ public function sendCourseNotification(
360359
return $this->json(['success' => true]);
361360
}
362361

363-
364362
#[Route('/{sessionId}/next-session', name: 'chamilo_session_next_session')]
365363
public function getNextSession(
366364
int $sessionId,
367365
Request $request,
368366
SequenceResourceRepository $repo,
369367
Security $security
370368
): JsonResponse {
371-
372369
$requirementAndDependencies = $repo->getRequirementAndDependencies(
373370
$sessionId,
374371
SequenceResource::SESSION_TYPE
@@ -405,7 +402,7 @@ public function getNextSession(
405402
$graphImage = null;
406403
if ($sequenceResource && $sequenceResource->hasGraph()) {
407404
$graph = $sequenceResource->getSequence()->getUnSerializeGraph();
408-
if ($graph !== null) {
405+
if (null !== $graph) {
409406
$graph->setAttribute('graphviz.node.fontname', 'arial');
410407
$graphviz = new GraphViz();
411408
$graphImage = $graphviz->createImageSrc($graph);

0 commit comments

Comments
 (0)