Skip to content

Commit

Permalink
Merge branch 'master' into release_2_1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Wolniewicz committed Nov 26, 2024
2 parents ff55e94 + f2b0f8c commit bc68597
Show file tree
Hide file tree
Showing 24 changed files with 1,306 additions and 541 deletions.
4 changes: 2 additions & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ build:
command: wget http://ci.test/user/API.php?action=downloadInstaller\&api_version=2\&lang=en\&device=w10\&profile=3 -O /home/scrutinizer/artifacts/WinInstaller.exe --no-verbose
title: "Generating Windows 10 installer via API call"
-
command: file /home/scrutinizer/artifacts/WinInstaller.exe | egrep 'executable.*Intel.*Windows.*Nullsoft'
title: "Checking whether output is a Windows executable and Nullsoft installer"
command: file /home/scrutinizer/artifacts/WinInstaller.exe
title: "Checking whether output is a Windows executable"
-
command: wget http://ci.test/user/API.php?action=downloadInstaller\&api_version=2\&lang=en\&device=apple_hi_sierra\&profile=3 -O /home/scrutinizer/artifacts/AppleInstaller.mobileconfig --no-verbose
title: "Generating a Apple High Sierra installer via API call"
Expand Down
2 changes: 1 addition & 1 deletion core/IdP.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function __construct(int $instId)
*/
public function listProfiles(bool $activeOnly = FALSE)
{
$query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
$query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "")." ORDER BY preference";
$allProfiles = $this->databaseHandle->exec($query);
$returnarray = [];
// SELECT -> resource, not boolean
Expand Down
28 changes: 19 additions & 9 deletions core/IdPlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ public static function listAllIdentityProviders($activeOnly = 0, $country = "")
$allIDPs = ($country != "" ? $handle->exec($query, "s", $country) : $handle->exec($query));
$idpArray = [];
// SELECTs never return a booleans, always an object
$allIdPresults = [];
while ($queryResult = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allIDPs)) {
$allIdPresults[] = $queryResult;
}
foreach ($allIdPresults as $queryResult) {
$options = IdPlist::setIdentityProviderAttributes($queryResult);
$oneInstitutionResult = [];
$oneInstitutionResult['entityID'] = $queryResult->inst_id;
Expand All @@ -82,17 +86,23 @@ public static function listAllIdentityProviders($activeOnly = 0, $country = "")
$name = $langObject->getLocalisedValue($options['names']);
}
$oneInstitutionResult['title'] = $name;
$keywords = [];
foreach ($options['names'] as $keyword) {
$value = $keyword['value'];
$keywords[$keyword['lang']] = $keyword['value'];
$keywords[$keyword['lang'].'_7'] =
iconv('UTF-8', 'ASCII//TRANSLIT', $value);
}

if (\config\ConfAssistant::USE_KEYWORDS) {
$keywords = [];
foreach ($options['names'] as $keyword) {
$value = $keyword['value'];
$keywords[$keyword['lang']] = $keyword['value'];
$keywords[$keyword['lang'].'_7'] =
iconv('UTF-8', 'ASCII//TRANSLIT', $value);
}
$q = "SELECT DISTINCT realm FROM profile WHERE inst_id=? AND realm NOT LIKE '%hosted.eduroam.org'";
$realms = $handle->exec($q, 'i', $queryResult->inst_id);
while ($outerId = mysqli_fetch_row(/** @scrutinizer ignore-type */ $realms)) {
if (preg_match('/.*@(.*)$/', $outerId[0], $matches)) {
$keywords[] = $matches[1];
}
}
$keywords_final = array_unique($keywords);

if (!empty($keywords_final)) {
$oneInstitutionResult['keywords'] = [];
foreach (array_keys($keywords_final) as $key) {
Expand Down Expand Up @@ -335,7 +345,7 @@ private static function setProfileAttributes($profile)
case 'device-specific:redirect':
$redirect = $opt[1];
if (!empty($profile->device_id)) {
$redirect .= ':' . $profile->device_id;
$redirect .= ':'.$profile->device_id;
}
break;
case 'profile:name':
Expand Down
3 changes: 1 addition & 2 deletions devices/linux/Files/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,7 @@ def __select_p12_file(self) -> str:
stderr=subprocess.PIPE)
cert, _ = shell_command.communicate()
if self.graphics == 'kdialog':
command = ['kdialog', '--getopenfilename', '.', +
# '.', '*.p12 *.P12 *.pfx *.PFX | ' + Messages.p12_filter, # removed filter due to the changed syntax in newer versions
command = ['kdialog', '--getopenfilename', '.',
'--title=' + Messages.p12_title]
shell_command = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL)
Expand Down
28 changes: 28 additions & 0 deletions schema/2_1_2-2_1_2_1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* *****************************************************************************
* Contributions to this work were made on behalf of the GÉANT project, a
* project that has received funding from the European Union’s Framework
* Programme 7 under Grant Agreements No. 238875 (GN3) and No. 605243 (GN3plus),
* Horizon 2020 research and innovation programme under Grant Agreements No.
* 691567 (GN4-1) and No. 731122 (GN4-2) and from the Horizon Europe programme
* under Grant Agreement No: 101100680 (GN5-1).
* On behalf of the aforementioned projects, GEANT Association is the sole owner
* of the copyright in all material which was developed by a member of the GÉANT
* project. GÉANT Vereniging (Association) is registered with the Chamber of
* Commerce in Amsterdam with registration number 40535155 and operates in the
* UK as a branch of GÉANT Vereniging.
*
* Registered office: Hoekenrode 3, 1102BR Amsterdam, The Netherlands.
* UK branch address: City House, 126-130 Hills Road, Cambridge CB2 1PQ, UK
*
* License: see the web/copyright.inc.php file in the file structure or
* <base_url>/copyright.php after deploying the software
*/

/**
* @author Tomasz Wolniewicz <[email protected]>
* Created: 20 Nov 2024
*/


ALTER TABLE profile ADD COLUMN `preference` int DEFAULT '1000';
1 change: 1 addition & 0 deletions schema/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ CREATE TABLE `profile` (
`sufficient_config` tinyint(1) NULL DEFAULT NULL,
`openroaming` int(2) NOT NULL DEFAULT 4,
`last_change` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`preference` int DEFAULT '1000',
PRIMARY KEY (`profile_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Expand Down
2 changes: 1 addition & 1 deletion tests/cat_integration_scrutinizer.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ INSERT INTO `institution_option` VALUES (1,'general:instname','C','Institution w

INSERT INTO `invitations` VALUES (1,NULL,'LU','Institution with all options set',NULL,'5c9a16a9b7db41081cb631fd02a071835d19c523c3e2fa2ff20580ee949fb0ff0a053664fe6a1023','2017-03-30 10:34:00',1,NULL,'FED','[email protected]','IdPSP'),(2,NULL,'LU','Blank Institution',NULL,'371ec9e8392244863f6a92bebec6f56c748cfb98608343f5c5b30358ddeaf31111c177564d14cdfb','2017-03-30 10:34:42',1,NULL,'FED','[email protected]','SP'),(3,NULL,'LU','Institution with Managed IdP',NULL,'cb4ced2d300c515e79a5f31dae9dc65782c13d349a98fc0a07542e291e281beec0de1fed52ab1944','2017-03-30 10:43:53',1,NULL,'FED','[email protected]','IdP');
INSERT INTO `ownership` VALUES (1,'eduPersonTargetedID:ab4929d8bad74b180d05932ec350843d5ff1f8c2!https://clueless.restena.lu/simplesamlphp/saml2/idp/metadata.php',1,'FED','[email protected]'),(2,'eduPersonTargetedID:ab4929d8bad74b180d05932ec350843d5ff1f8c2!https://clueless.restena.lu/simplesamlphp/saml2/idp/metadata.php',2,'FED','[email protected]'),(3,'eduPersonTargetedID:ab4929d8bad74b180d05932ec350843d5ff1f8c2!https://clueless.restena.lu/simplesamlphp/saml2/idp/metadata.php',3,'FED','[email protected]');
INSERT INTO `profile` VALUES (1,1,'[email protected]',1,1,'nps-test',1,1,1,1,4,'2017-03-30 10:40:46'),(2,3,'3-2.lu.test.hosted.eduroam.org',1,1,NULL,1,1,1,NULL,4,'2017-03-30 10:44:20');
INSERT INTO `profile` VALUES (1,1,'[email protected]',1,1,'nps-test',1,1,1,1,4,'2017-03-30 10:40:46',1000),(2,3,'3-2.lu.test.hosted.eduroam.org',1,1,NULL,1,1,1,NULL,4,'2017-03-30 10:44:20',1000);

INSERT INTO `profile_option` VALUES (1,0,NULL,'profile:description','C','This profile isn\'t really meant to do \"anything\".',1),(1,0,NULL,'profile:name','C','The Useless Profile',2),(1,0,NULL,'profile:production',NULL,'on',3),(1,0,NULL,'profile:description','de','Dieses Profile ist eigentlich für nichts gut.',4),(1,0,NULL,'profile:name','de','Das Unnütze Profil',5),(1,0,NULL,'eap:server_name',NULL,'auth.aq',6),(1,0,NULL,'eap:ca_file',NULL,'MIIDxTCCAy6gAwIBAgIJAOfXed1VHijFMA0GCSqGSIb3DQEBBAUAMIGeMQswCQYDVQQGEwJMVTETMBEGA1UEBxMKTHV4ZW1ib3VyZzEaMBgGA1UEChMRRm9uZGF0aW9uIFJFU1RFTkExGzAZBgNVBAsTElJFU1RFTkEgZWR1cm9hbSBDQTEiMCAGA1UEAxMZUkVTVEVOQSBlZHVyb2FtIGF1dGhvcml0eTEdMBsGCSqGSIb3DQEJARYObm9jQHJlc3RlbmEubHUwHhcNMDYwMTE5MTI1MzA5WhcNMTYwMTE3MTI1MzA5WjCBnjELMAkGA1UEBhMCTFUxEzARBgNVBAcTCkx1eGVtYm91cmcxGjAYBgNVBAoTEUZvbmRhdGlvbiBSRVNURU5BMRswGQYDVQQLExJSRVNURU5BIGVkdXJvYW0gQ0ExIjAgBgNVBAMTGVJFU1RFTkEgZWR1cm9hbSBhdXRob3JpdHkxHTAbBgkqhkiG9w0BCQEWDm5vY0ByZXN0ZW5hLmx1MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC576jfDDKeS9Lq5vf6WGxjTWK1dMwO8BRGMJ8/VVj3b59Bmm6qHuxrQ4V48SIG8i6q/bxuCgusG/FGvnIcxIychCDF0ggGxl7XBje0EmqAi4c1nViQhMVQnCN3rG5jr5e/rUlHvzvVF/zFeEgD6NGGyJsodiVWuXyGcfjK1NcyYQIDAQABo4IBBzCCAQMwHQYDVR0OBBYEFNKjQqCmSObRgDvmVOEAqkZVH3y4MIHTBgNVHSMEgcswgciAFNKjQqCmSObRgDvmVOEAqkZVH3y4oYGkpIGhMIGeMQswCQYDVQQGEwJMVTETMBEGA1UEBxMKTHV4ZW1ib3VyZzEaMBgGA1UEChMRRm9uZGF0aW9uIFJFU1RFTkExGzAZBgNVBAsTElJFU1RFTkEgZWR1cm9hbSBDQTEiMCAGA1UEAxMZUkVTVEVOQSBlZHVyb2FtIGF1dGhvcml0eTEdMBsGCSqGSIb3DQEJARYObm9jQHJlc3RlbmEubHWCCQDn13ndVR4oxTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GBAEyFwxhGxGTkjDrcG6TLh5CORjpEdtOe5Poq5g02y64xFKgVn2mtpfOtOrN5C0zk8vkhA4X5rb91hiTSpI2bzS5q/pbNbwqVUJe3W6ZG+rdokkBp0pfQV3vq8xDS322MHkxmdAybRIzIx24Sv5T4y0aEaMtQt+wnFxLFU6HCk3X3',7),(2,0,NULL,'hiddenprofile:tou_accepted',NULL,'1',8);

Expand Down
4 changes: 2 additions & 2 deletions translation/core.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-11 10:54+0100\n"
"POT-Creation-Date: 2024-11-26 18:18+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -317,7 +317,7 @@ msgstr ""
msgid "South Africa"
msgstr ""

#: core/CAT.php:485 core/IdPlist.php:79
#: core/CAT.php:485 core/IdPlist.php:83
msgid "Unnamed Entity"
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion translation/devices.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-11 10:54+0100\n"
"POT-Creation-Date: 2024-11-26 18:18+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
2 changes: 1 addition & 1 deletion translation/diagnostics.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-11 10:54+0100\n"
"POT-Creation-Date: 2024-11-26 18:18+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
Loading

0 comments on commit bc68597

Please sign in to comment.