Skip to content

Commit 30a7677

Browse files
committed
Merge remote-tracking branch 'origin/1.11.x' into 1.11.x
2 parents 060e433 + 18b2131 commit 30a7677

File tree

9 files changed

+50
-10
lines changed

9 files changed

+50
-10
lines changed

main/inc/lib/Compilatio.php

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,26 @@ public function getDoc(string $documentId): array
191191
$documentInfo = [
192192
'report_url' => $dataDocument['report_url'],
193193
];
194-
195-
if (isset($dataDocument['analyses']['anasim']['state'])) {
196-
$documentInfo['analysis_status'] = $dataDocument['analyses']['anasim']['state'];
194+
// anasim analyse type is applied for services Magister and Copyright
195+
// anasim-premium analyse type is applied for services Magister+ and Copyright+
196+
$anasim = 'anasim';
197+
if (isset($dataDocument['analyses']['anasim-premium'])) {
198+
$anasim = 'anasim-premium';
199+
if (isset($dataDocument['analyses']['anasim'])) {
200+
if (isset($dataDocument['analyses']['anasim']['creation_launch_date']) && isset($dataDocument['analyses']['anasim-premium']['creation_launch_date'])) {
201+
// if the 2 analyses type exist (which could happen technically but would be exceptional) then we present the most recent one.
202+
if ($dataDocument['analyses']['anasim']['creation_launch_date'] > $dataDocument['analyses']['anasim-premium']['creation_launch_date']) {
203+
$anasim = 'anasim';
204+
}
205+
}
206+
}
197207
}
198-
199-
if (isset($dataDocument['light_reports']['anasim']['scores']['global_score_percent'])) {
200-
$documentInfo['report_percent'] = $dataDocument['light_reports']['anasim']['scores']['global_score_percent'];
208+
if (isset($dataDocument['analyses'][$anasim]['state'])) {
209+
$documentInfo['analysis_status'] = $dataDocument['analyses'][$anasim]['state'];
210+
}
211+
212+
if (isset($dataDocument['light_reports'][$anasim]['scores']['global_score_percent'])) {
213+
$documentInfo['report_percent'] = $dataDocument['light_reports'][$anasim]['scores']['global_score_percent'];
201214
}
202215

203216
return $documentInfo;

main/inc/lib/glossary.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public static function get_glossary_term_by_glossary_name($name)
115115
name LIKE '".Database::escape_string($glossaryName)."' OR
116116
name LIKE '".Database::escape_string($parsed)."'
117117
) AND
118-
session_id IS NULL
118+
(session_id IS NULL OR session_id = 0)
119119
LIMIT 1";
120120

121121
$rs = Database::query($sql);

main/inc/local.inc.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,16 +1250,25 @@
12501250

12511251
if (!empty($_SESSION)) {
12521252
foreach ($_SESSION as $key => $session_item) {
1253-
if (strpos($key, 'lp_autolaunch_') === false) {
1254-
continue;
1255-
} else {
1253+
// Clear session keys related to SortableTable
1254+
if (strpos($key, 'table_') === 0 || strpos($key, 'sortable_table_') === 0) {
1255+
if (isset($_SESSION[$key])) {
1256+
Session::erase($key);
1257+
}
1258+
}
1259+
1260+
// Clear session keys related to lp_autolaunch_
1261+
if (strpos($key, 'lp_autolaunch_') !== false) {
12561262
if (isset($_SESSION[$key])) {
12571263
Session::erase($key);
12581264
}
12591265
}
12601266
}
12611267
}
12621268

1269+
// Clear the general clean_sortable_table flag if it exists
1270+
Session::erase('clean_sortable_table');
1271+
12631272
if (api_get_group_id()) {
12641273
Session::erase('_gid');
12651274
}

plugin/azure_active_directory/lang/dutch.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@
5050
$strings['script_users_delta_help'] = 'Get newly created, updated, or deleted users without having to perform a full read of the entire user collection. By default, is <code>No</code>.';
5151
$strings['script_usergroups_delta'] = 'Delta query for usergroups';
5252
$strings['script_usergroups_delta_help'] = 'Get newly created, updated, or deleted groups, including group membership changes, without having to perform a full read of the entire group collection. By default, is <code>No</code>.';
53+
$strings['group_filter_regex'] = 'Group filter RegEx';
54+
$strings['group_filter_regex_help'] = 'Regular expression to filter groups (only matches will be synchronized), e.g. <code>.*-FIL-.*</code> <code>.*-PAR-.*</code> <code>.*(FIL|PAR).*</code> <code>^(FIL|PAR).*</code>';

plugin/azure_active_directory/lang/english.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@
5050
$strings['script_users_delta_help'] = 'Get newly created, updated, or deleted users without having to perform a full read of the entire user collection. By default, is <code>No</code>.';
5151
$strings['script_usergroups_delta'] = 'Delta query for usergroups';
5252
$strings['script_usergroups_delta_help'] = 'Get newly created, updated, or deleted groups, including group membership changes, without having to perform a full read of the entire group collection. By default, is <code>No</code>.';
53+
$strings['group_filter_regex'] = 'Group filter RegEx';
54+
$strings['group_filter_regex_help'] = 'Regular expression to filter groups (only matches will be synchronized), e.g. <code>.*-FIL-.*</code> <code>.*-PAR-.*</code> <code>.*(FIL|PAR).*</code> <code>^(FIL|PAR).*</code>';

plugin/azure_active_directory/lang/french.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@
5050
$strings['script_users_delta_help'] = 'Get newly created, updated, or deleted users without having to perform a full read of the entire user collection. By default, is <code>No</code>.';
5151
$strings['script_usergroups_delta'] = 'Requête delta pour les groupes d\'utilisateurs';
5252
$strings['script_usergroups_delta_help'] = 'Get newly created, updated, or deleted groups, including group membership changes, without having to perform a full read of the entire group collection. By default, is <code>No</code>.';
53+
$strings['group_filter_regex'] = 'Group filter RegEx';
54+
$strings['group_filter_regex_help'] = 'Regular expression to filter groups (only matches will be synchronized), e.g. <code>.*-FIL-.*</code> <code>.*-PAR-.*</code> <code>.*(FIL|PAR).*</code> <code>^(FIL|PAR).*</code>';

plugin/azure_active_directory/lang/spanish.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@
5050
$strings['script_users_delta_help'] = 'Obtiene usuarios recién creados, actualizados o eliminados sin tener que realizar una lectura completa de toda la colección de usuarios. De forma predeterminada, es <code>No</code>.';
5151
$strings['script_usergroups_delta'] = 'Consulta delta para grupos de usuarios';
5252
$strings['script_usergroups_delta_help'] = 'Obtiene grupos recién creados, actualizados o eliminados, incluidos los cambios de membresía del grupo, sin tener que realizar una lectura completa de toda la colección de grupos. De forma predeterminada, es <code>No</code>';
53+
$strings['group_filter_regex'] = 'Group filter RegEx';
54+
$strings['group_filter_regex_help'] = 'Expresión regular para filtrar grupos (solo las coincidencias serán sincronizadas), p.ej. <code>.*-FIL-.*</code> <code>.*-PAR-.*</code> <code>.*(FIL|PAR).*</code> <code>^(FIL|PAR).*</code>';

plugin/azure_active_directory/src/AzureActiveDirectory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class AzureActiveDirectory extends Plugin
3333
public const SETTING_DEACTIVATE_NONEXISTING_USERS = 'deactivate_nonexisting_users';
3434
public const SETTING_GET_USERS_DELTA = 'script_users_delta';
3535
public const SETTING_GET_USERGROUPS_DELTA = 'script_usergroups_delta';
36+
public const SETTING_GROUP_FILTER = 'group_filter_regex';
3637

3738
public const URL_TYPE_AUTHORIZE = 'login';
3839
public const URL_TYPE_LOGOUT = 'logout';
@@ -66,6 +67,7 @@ protected function __construct()
6667
self::SETTING_DEACTIVATE_NONEXISTING_USERS => 'boolean',
6768
self::SETTING_GET_USERS_DELTA => 'boolean',
6869
self::SETTING_GET_USERGROUPS_DELTA => 'boolean',
70+
self::SETTING_GROUP_FILTER => 'text',
6971
];
7072

7173
parent::__construct('2.5', 'Angel Fernando Quiroz Campos, Yannick Warnier', $settings);

plugin/azure_active_directory/src/AzureCommand.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ protected function getAzureUsers(): Generator
121121
*/
122122
protected function getAzureGroups(): Generator
123123
{
124+
$groupFilter = $this->plugin->get(AzureActiveDirectory::SETTING_GROUP_FILTER);
125+
124126
$groupFields = [
125127
'id',
126128
'displayName',
@@ -161,6 +163,12 @@ protected function getAzureGroups(): Generator
161163
$azureGroupsInfo = $azureGroupsRequest['value'] ?? [];
162164

163165
foreach ($azureGroupsInfo as $azureGroupInfo) {
166+
if (!empty($groupFilter) &&
167+
!preg_match("/$groupFilter/", $azureGroupInfo['displayName'])
168+
) {
169+
continue;
170+
}
171+
164172
yield $azureGroupInfo;
165173
}
166174

0 commit comments

Comments
 (0)