@@ -12,53 +12,53 @@ |
||
12 | 12 | this is just an include file for Gui class definition |
13 | 13 | */ |
14 | 14 | $Faq = [ |
15 | - [ |
|
15 | + [ |
|
16 | 16 | 'id'=>'idp_not_listed', |
17 | 17 | 'title'=>sprintf(_("My %s is not listed. Can't I just use any of the other ones?"),$Gui->nomenclature_inst), |
18 | 18 | 'text'=>sprintf(_("No! The installers contain security settings which are specific to the %s. If you are not from that %s, your computer will detect that you are about to send your username and credential to an unauthorised server and will abort the login. Using a different %s installer is <i>guaranteed to not work</i>!"), $Gui->nomenclature_inst, $Gui->nomenclature_inst, $Gui->nomenclature_inst) |
19 | - ], |
|
20 | - [ |
|
19 | + ], |
|
20 | + [ |
|
21 | 21 | 'id'=>'idp_not_listed', |
22 | 22 | 'title'=>sprintf(_("What can I do to get my %s listed?"), $Gui->nomenclature_inst), |
23 | 23 | 'text'=>sprintf(_("Contact %s administrators at your %s and complain. It will take at most one hour of their time to get things done."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst) |
24 | 24 | ], |
25 | - [ |
|
25 | + [ |
|
26 | 26 | 'id'=>'device_not_listed', |
27 | 27 | 'title'=>sprintf(_("My device is not listed! Does that mean I can't do %s?"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
28 | 28 | 'text'=>sprintf(_("No. The CAT tool can only support Operating Systems which can be automatically configured in some way. Many other devices can still be used with %s, but must be configured manually. Please contact your %s Identity Provider to get help in setting up such a device."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) |
29 | - ], |
|
29 | + ], |
|
30 | 30 | |
31 | - [ |
|
31 | + [ |
|
32 | 32 | 'title'=>sprintf(_("I can connect to %s simply by providing username and password, what is the point of using an installer?"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
33 | 33 | 'text'=>sprintf(_("When you are connecting from an unconfigured device your security is at risk. The very point of preconfiguration is to set up security, when this is done, your device will first confirm that it talks to the correct authentication server and will never send your password to an untrusted one.")) |
34 | 34 | ], |
35 | - [ |
|
35 | + [ |
|
36 | 36 | 'title'=>sprintf(_("Is it safe to use %s installers?"),CONFIG['APPEARANCE']['productname']), |
37 | 37 | 'text'=>sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."),CONFIG['APPEARANCE']['productname']).' '.( isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."),CONFIG['APPEARANCE']['productname'],CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']):""), |
38 | 38 | |
39 | 39 | ], |
40 | - [ |
|
40 | + [ |
|
41 | 41 | 'title'=>_("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"), |
42 | 42 | 'text'=>_("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.")." ".(isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."),CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'])." ":"").sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."),"<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>") |
43 | 43 | |
44 | 44 | ], |
45 | - [ |
|
45 | + [ |
|
46 | 46 | 'title'=>sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
47 | - 'text'=>sprintf(_("There can be a number of different reasons. The network you see may not be a genuine %s one and your device silently drops the connection attempt; there may be something wrong with the configuration of the network; your account may have expired; there may be a connection problem with your home authentication server; you may have broken the regulations of the network you are using and have been refused access as a consequence. You should contact your %s and report the problem, the administrators should be able to trace your connections."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst) |
|
47 | + 'text'=>sprintf(_("There can be a number of different reasons. The network you see may not be a genuine %s one and your device silently drops the connection attempt; there may be something wrong with the configuration of the network; your account may have expired; there may be a connection problem with your home authentication server; you may have broken the regulations of the network you are using and have been refused access as a consequence. You should contact your %s and report the problem, the administrators should be able to trace your connections."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst) |
|
48 | 48 | ], |
49 | - [ |
|
49 | + [ |
|
50 | 50 | 'id'=>'contact', |
51 | 51 | 'title'=>sprintf(_("I have a question about this web site. Whom should I contact?")), |
52 | 52 | 'text'=>sprintf(_("You should send a mail to %s."),CONFIG['APPEARANCE']['support-contact']['display']) |
53 | - ], |
|
53 | + ], |
|
54 | 54 | ]; |
55 | 55 | |
56 | 56 | if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam") { |
57 | - array_push($Faq, |
|
58 | - [ |
|
59 | - 'id'=>'what_is_'.CONFIG_CONFASSISTANT['CONSORTIUM']['name'], |
|
60 | - 'title'=>sprintf(_("What is this %s thing anyway?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
|
61 | - 'text'=>sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than 6.000 hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> for more details."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) |
|
62 | - ]); |
|
57 | + array_push($Faq, |
|
58 | + [ |
|
59 | + 'id'=>'what_is_'.CONFIG_CONFASSISTANT['CONSORTIUM']['name'], |
|
60 | + 'title'=>sprintf(_("What is this %s thing anyway?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
|
61 | + 'text'=>sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than 6.000 hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> for more details."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) |
|
62 | + ]); |
|
63 | 63 | } |
64 | 64 | ?> |
@@ -14,51 +14,51 @@ |
||
14 | 14 | $Faq = [ |
15 | 15 | [ |
16 | 16 | 'id'=>'idp_not_listed', |
17 | - 'title'=>sprintf(_("My %s is not listed. Can't I just use any of the other ones?"),$Gui->nomenclature_inst), |
|
17 | + 'title'=>sprintf(_("My %s is not listed. Can't I just use any of the other ones?"), $Gui->nomenclature_inst), |
|
18 | 18 | 'text'=>sprintf(_("No! The installers contain security settings which are specific to the %s. If you are not from that %s, your computer will detect that you are about to send your username and credential to an unauthorised server and will abort the login. Using a different %s installer is <i>guaranteed to not work</i>!"), $Gui->nomenclature_inst, $Gui->nomenclature_inst, $Gui->nomenclature_inst) |
19 | 19 | ], |
20 | 20 | [ |
21 | 21 | 'id'=>'idp_not_listed', |
22 | 22 | 'title'=>sprintf(_("What can I do to get my %s listed?"), $Gui->nomenclature_inst), |
23 | - 'text'=>sprintf(_("Contact %s administrators at your %s and complain. It will take at most one hour of their time to get things done."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst) |
|
23 | + 'text'=>sprintf(_("Contact %s administrators at your %s and complain. It will take at most one hour of their time to get things done."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst) |
|
24 | 24 | ], |
25 | 25 | [ |
26 | 26 | 'id'=>'device_not_listed', |
27 | - 'title'=>sprintf(_("My device is not listed! Does that mean I can't do %s?"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
|
28 | - 'text'=>sprintf(_("No. The CAT tool can only support Operating Systems which can be automatically configured in some way. Many other devices can still be used with %s, but must be configured manually. Please contact your %s Identity Provider to get help in setting up such a device."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) |
|
27 | + 'title'=>sprintf(_("My device is not listed! Does that mean I can't do %s?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
|
28 | + 'text'=>sprintf(_("No. The CAT tool can only support Operating Systems which can be automatically configured in some way. Many other devices can still be used with %s, but must be configured manually. Please contact your %s Identity Provider to get help in setting up such a device."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) |
|
29 | 29 | ], |
30 | 30 | |
31 | 31 | [ |
32 | - 'title'=>sprintf(_("I can connect to %s simply by providing username and password, what is the point of using an installer?"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
|
32 | + 'title'=>sprintf(_("I can connect to %s simply by providing username and password, what is the point of using an installer?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
|
33 | 33 | 'text'=>sprintf(_("When you are connecting from an unconfigured device your security is at risk. The very point of preconfiguration is to set up security, when this is done, your device will first confirm that it talks to the correct authentication server and will never send your password to an untrusted one.")) |
34 | 34 | ], |
35 | 35 | [ |
36 | - 'title'=>sprintf(_("Is it safe to use %s installers?"),CONFIG['APPEARANCE']['productname']), |
|
37 | - 'text'=>sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."),CONFIG['APPEARANCE']['productname']).' '.( isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."),CONFIG['APPEARANCE']['productname'],CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']):""), |
|
36 | + 'title'=>sprintf(_("Is it safe to use %s installers?"), CONFIG['APPEARANCE']['productname']), |
|
37 | + 'text'=>sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), CONFIG['APPEARANCE']['productname']) . ' ' . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), CONFIG['APPEARANCE']['productname'], CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) : ""), |
|
38 | 38 | |
39 | 39 | ], |
40 | 40 | [ |
41 | 41 | 'title'=>_("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"), |
42 | - 'text'=>_("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.")." ".(isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."),CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'])." ":"").sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."),"<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>") |
|
42 | + 'text'=>_("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.") . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) . " " : "") . sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>") |
|
43 | 43 | |
44 | 44 | ], |
45 | 45 | [ |
46 | - 'title'=>sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
|
47 | - 'text'=>sprintf(_("There can be a number of different reasons. The network you see may not be a genuine %s one and your device silently drops the connection attempt; there may be something wrong with the configuration of the network; your account may have expired; there may be a connection problem with your home authentication server; you may have broken the regulations of the network you are using and have been refused access as a consequence. You should contact your %s and report the problem, the administrators should be able to trace your connections."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst) |
|
46 | + 'title'=>sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
|
47 | + 'text'=>sprintf(_("There can be a number of different reasons. The network you see may not be a genuine %s one and your device silently drops the connection attempt; there may be something wrong with the configuration of the network; your account may have expired; there may be a connection problem with your home authentication server; you may have broken the regulations of the network you are using and have been refused access as a consequence. You should contact your %s and report the problem, the administrators should be able to trace your connections."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst) |
|
48 | 48 | ], |
49 | 49 | [ |
50 | 50 | 'id'=>'contact', |
51 | 51 | 'title'=>sprintf(_("I have a question about this web site. Whom should I contact?")), |
52 | - 'text'=>sprintf(_("You should send a mail to %s."),CONFIG['APPEARANCE']['support-contact']['display']) |
|
52 | + 'text'=>sprintf(_("You should send a mail to %s."), CONFIG['APPEARANCE']['support-contact']['display']) |
|
53 | 53 | ], |
54 | 54 | ]; |
55 | 55 | |
56 | 56 | if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam") { |
57 | 57 | array_push($Faq, |
58 | 58 | [ |
59 | - 'id'=>'what_is_'.CONFIG_CONFASSISTANT['CONSORTIUM']['name'], |
|
59 | + 'id'=>'what_is_' . CONFIG_CONFASSISTANT['CONSORTIUM']['name'], |
|
60 | 60 | 'title'=>sprintf(_("What is this %s thing anyway?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']), |
61 | - 'text'=>sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than 6.000 hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> for more details."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) |
|
61 | + 'text'=>sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than 6.000 hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> for more details."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) |
|
62 | 62 | ]); |
63 | 63 | } |
64 | 64 | ?> |
@@ -125,6 +125,7 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @param string $device |
127 | 127 | * @param AbstractProfile $profile |
128 | + * @param string $generatedFor |
|
128 | 129 | * @return array info about the new installer (mime and link) |
129 | 130 | */ |
130 | 131 | private function generateNewInstaller($device, $profile, $generatedFor, $token, $password) { |
@@ -459,6 +460,10 @@ discard block |
||
459 | 460 | readfile($file); |
460 | 461 | } |
461 | 462 | |
463 | + /** |
|
464 | + * @param string $destFile |
|
465 | + * @param integer $resize |
|
466 | + */ |
|
462 | 467 | private function processImage($inputImage, $destFile, $width, $height, $resize) { |
463 | 468 | $info = new \finfo(); |
464 | 469 | $filetype = $info->buffer($inputImage, FILEINFO_MIME_TYPE); |
@@ -485,7 +490,6 @@ discard block |
||
485 | 490 | * When called for DiscoJuice, first check if file cache exists |
486 | 491 | * If not then generate the file and save it in the cache |
487 | 492 | * @param int $idp IdP identifier |
488 | - * @param int $disco flag turning on image generation for DiscoJuice |
|
489 | 493 | * @param int $width maximum width of the generated image |
490 | 494 | * @param int $height maximum height of the generated image |
491 | 495 | * if one of these is 0 then it is treated as no upper bound |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | if (isset($deviceProperties['options']['hidden']) && $deviceProperties['options']['hidden'] && $showHidden == 0) { |
177 | 177 | continue; |
178 | 178 | } |
179 | - $count ++; |
|
179 | + $count++; |
|
180 | 180 | |
181 | 181 | $deviceProperties['device'] = $device; |
182 | 182 | |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | } |
563 | 563 | |
564 | 564 | |
565 | - public function sendLogo($identifier, $type, $width = 0, $height = 0){ |
|
565 | + public function sendLogo($identifier, $type, $width = 0, $height = 0) { |
|
566 | 566 | if ($type === "federation") { |
567 | 567 | $logo = $this->getFedLogo($identifier, $width, $height); |
568 | 568 | } |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | return ['status' => 'error', 'error' => 'Function for GEOIPv1 called, but config says this is not the version to use!']; |
581 | 581 | } |
582 | 582 | //$host = $_SERVER['REMOTE_ADDR']; |
583 | - $host = input_filter(INPUT_SERVER,'REMOTE_ADDR',FILTER_VALIDATE_IP); |
|
583 | + $host = input_filter(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP); |
|
584 | 584 | $record = geoip_record_by_name($host); |
585 | 585 | if ($record === FALSE) { |
586 | 586 | return ['status' => 'error', 'error' => 'Problem listing countries']; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ]; |
40 | 40 | |
41 | 41 | |
42 | -function getRequest($varName,$filter) { |
|
42 | +function getRequest($varName, $filter) { |
|
43 | 43 | $safeText = ["options"=>["regexp"=>"/^[\w\d]+$/"]]; |
44 | 44 | switch ($filter) { |
45 | 45 | case 'safe_text': |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | // make sure this is a known action |
59 | 59 | $actionR = getRequest('action', 'safe_text'); |
60 | -$action = array_search($actionR,LISTOFACTIONS) ? $actionR : FALSE; |
|
60 | +$action = array_search($actionR, LISTOFACTIONS) ? $actionR : FALSE; |
|
61 | 61 | if ($action === FALSE) { |
62 | 62 | exit; |
63 | 63 | } |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | $lang = $langR ? $validator->supportedLanguage($langR) : FALSE; |
66 | 66 | $deviceR = getRequest('device', 'safe_text'); |
67 | 67 | $device = $deviceR ? $validator->Device($deviceR) : FALSE; |
68 | -$idpR = getRequest('idp','int'); |
|
68 | +$idpR = getRequest('idp', 'int'); |
|
69 | 69 | $idp = $idpR ? $validator->IdP($idpR)->identifier : FALSE; |
70 | -$profileR = getRequest('profile','int'); |
|
70 | +$profileR = getRequest('profile', 'int'); |
|
71 | 71 | $profile = $profileR ? $validator->Profile($profileR)->identifier : FALSE; |
72 | -$federationR = getRequest('federation','safe_text'); |
|
72 | +$federationR = getRequest('federation', 'safe_text'); |
|
73 | 73 | $federation = $federationR ? $validator->Federation($deviceR)->identifier : FALSE; |
74 | -$disco = getRequest('disco','int'); |
|
75 | -$width = getRequest('width','int') ?? 0; |
|
76 | -$height = getRequest('height','int') ?? 0; |
|
77 | -$sort = getRequest('sort','int') ?? 0; |
|
78 | -$generatedforR = getRequest('generatedfor','safe_text') ?? 'user'; |
|
74 | +$disco = getRequest('disco', 'int'); |
|
75 | +$width = getRequest('width', 'int') ?? 0; |
|
76 | +$height = getRequest('height', 'int') ?? 0; |
|
77 | +$sort = getRequest('sort', 'int') ?? 0; |
|
78 | +$generatedforR = getRequest('generatedfor', 'safe_text') ?? 'user'; |
|
79 | 79 | |
80 | 80 | /* |
81 | 81 | $idp = FALSE; |
@@ -260,6 +260,9 @@ discard block |
||
260 | 260 | return _("Sorry, this should not happen - no additional information is available"); |
261 | 261 | } |
262 | 262 | |
263 | + /** |
|
264 | + * @param string $file |
|
265 | + */ |
|
263 | 266 | private function findSourceFile($file) { |
264 | 267 | if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) { |
265 | 268 | return $this->module_path . '/Files/' . $this->device_id . '/' . $file; |
@@ -540,6 +543,9 @@ discard block |
||
540 | 543 | 'application/pdf' => 'pdf', |
541 | 544 | ]; |
542 | 545 | |
546 | + /** |
|
547 | + * @param string $type |
|
548 | + */ |
|
543 | 549 | private function saveLogoFile($logos,$type) { |
544 | 550 | $iterator = 0; |
545 | 551 | $returnarray = []; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | if (isset($this->attributes['general:logo_file'])) { |
214 | 214 | $this->loggerInstance->debug(5, "saving IDP logo\n"); |
215 | - $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'],'idp'); |
|
215 | + $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'], 'idp'); |
|
216 | 216 | } |
217 | 217 | if (isset($this->attributes['fed:logo_file'])) { |
218 | 218 | $this->loggerInstance->debug(5, "saving FED logo\n"); |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | 'application/pdf' => 'pdf', |
541 | 541 | ]; |
542 | 542 | |
543 | - private function saveLogoFile($logos,$type) { |
|
543 | + private function saveLogoFile($logos, $type) { |
|
544 | 544 | $iterator = 0; |
545 | 545 | $returnarray = []; |
546 | 546 | foreach ($logos as $blob) { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | if (!is_numeric($profileIdRaw)) { |
138 | 138 | throw new Exception("Non-numeric Profile identifier was passed to AbstractProfile constructor!"); |
139 | 139 | } |
140 | - $profileId = (int)$profileIdRaw; // no, it can not possibly be a double. Try to convince Scrutinizer... |
|
140 | + $profileId = (int) $profileIdRaw; // no, it can not possibly be a double. Try to convince Scrutinizer... |
|
141 | 141 | $profile = $this->databaseHandle->exec("SELECT inst_id FROM profile WHERE profile_id = $profileId"); |
142 | 142 | if (!$profile || $profile->num_rows == 0) { |
143 | 143 | $this->loggerInstance->debug(2, "Profile $profileId not found in database!\n"); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $idp = new IdP($this->institution); |
151 | 151 | } else { |
152 | 152 | $idp = $idpObject; |
153 | - $this->institution = (int)$idp->identifier; |
|
153 | + $this->institution = (int) $idp->identifier; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | $this->instName = $idp->name; |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | } |
222 | 222 | // okay, no guidance on outer IDs at all - but we need *something* to |
223 | 223 | // test with for the RealmChecks. So: |
224 | - return "@".$realm; |
|
224 | + return "@" . $realm; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | if ($invitationDetails = mysqli_fetch_object($instinfo)) { |
116 | 116 | if ($invitationDetails->cat_institution_id !== NULL) { // add new admin to existing IdP |
117 | 117 | $this->databaseHandle->exec("INSERT INTO ownership (user_id, institution_id, blesslevel, orig_mail) VALUES(?, $invitationDetails->cat_institution_id, '$invitationDetails->invite_issuer_level', '$invitationDetails->invite_dest_mail') ON DUPLICATE KEY UPDATE blesslevel='$invitationDetails->invite_issuer_level', orig_mail='$invitationDetails->invite_dest_mail' ", "s", $owner); |
118 | - $this->loggerInstance->writeAudit((string)$owner, "OWN", "IdP " . $invitationDetails->cat_institution_id . " - added user as owner"); |
|
118 | + $this->loggerInstance->writeAudit((string) $owner, "OWN", "IdP " . $invitationDetails->cat_institution_id . " - added user as owner"); |
|
119 | 119 | return new IdP($invitationDetails->cat_institution_id); |
120 | 120 | } |
121 | 121 | // create new IdP |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | $retval = []; |
263 | 263 | $invitations = $this->databaseHandle->exec("SELECT cat_institution_id, country, name, invite_issuer_level, invite_dest_mail, invite_token |
264 | 264 | FROM invitations |
265 | - WHERE cat_institution_id " . ( $idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0"); |
|
266 | - $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation" ) . ".\n"); |
|
265 | + WHERE cat_institution_id " . ($idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0"); |
|
266 | + $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation") . ".\n"); |
|
267 | 267 | while ($invitationQuery = mysqli_fetch_object($invitations)) { |
268 | 268 | $retval[] = ["country" => $invitationQuery->country, "name" => $invitationQuery->name, "mail" => $invitationQuery->invite_dest_mail, "token" => $invitationQuery->invite_token]; |
269 | 269 | } |
@@ -94,7 +94,7 @@ |
||
94 | 94 | |
95 | 95 | while ($oneAttrib = mysqli_fetch_object($idpWideOptionsQuery)) { |
96 | 96 | if (!isset($profiles[$oneAttrib->institution_id])) { |
97 | - $idp = new \core\IdP((int)$oneAttrib->institution_id); |
|
97 | + $idp = new \core\IdP((int) $oneAttrib->institution_id); |
|
98 | 98 | $profiles[$oneAttrib->institution_id] = ['IdP' => $idp, 'Profiles' => $idp->listProfiles()]; |
99 | 99 | echo "Debug: IdP " . $idp->identifier . " has profiles "; |
100 | 100 | foreach ($profiles[$oneAttrib->institution_id]['Profiles'] as $oneProfileObject) { |
@@ -185,12 +185,12 @@ |
||
185 | 185 | throw new Exception("Zero - How can that be?"); |
186 | 186 | } |
187 | 187 | if (is_numeric($input) && isset(EAP::EAPTYPES_CONVERSION[$input])) { |
188 | - return (array)EAP::EAPTYPES_CONVERSION[$input]; |
|
188 | + return (array) EAP::EAPTYPES_CONVERSION[$input]; |
|
189 | 189 | } |
190 | 190 | if (is_array($input)) { |
191 | 191 | $keys = array_keys(EAP::EAPTYPES_CONVERSION, $input); |
192 | 192 | if (count($keys) == 1) { |
193 | - return (int)$keys[0]; |
|
193 | + return (int) $keys[0]; |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | throw new Exception("Unable to map EAP method array to EAP method int or vice versa: $input!"); |
@@ -297,10 +297,11 @@ |
||
297 | 297 | <allow-save>true</allow-save> |
298 | 298 | '; |
299 | 299 | if ($use_anon == 1) { |
300 | - if ($outer_user == '') |
|
301 | - $profileFileCont .= '<AnonymousIdentity>@</AnonymousIdentity>'; |
|
302 | - else |
|
303 | - $profileFileCont .= '<AnonymousIdentity>' . $outer_id . '</AnonymousIdentity>'; |
|
300 | + if ($outer_user == '') { |
|
301 | + $profileFileCont .= '<AnonymousIdentity>@</AnonymousIdentity>'; |
|
302 | + } else { |
|
303 | + $profileFileCont .= '<AnonymousIdentity>' . $outer_id . '</AnonymousIdentity>'; |
|
304 | + } |
|
304 | 305 | } |
305 | 306 | $profileFileCont .= '</ClientSideCredential> |
306 | 307 | <ServerSideCredential> |
@@ -446,8 +446,8 @@ |
||
446 | 446 | |
447 | 447 | $fcontents .= ';-------------------------------- |
448 | 448 | !define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '" |
449 | -!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0] ) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '" |
|
450 | -!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0] ) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '" |
|
449 | +!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0]) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '" |
|
450 | +!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0]) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '" |
|
451 | 451 | |
452 | 452 | !ifdef TLS |
453 | 453 | '; |