@@ -68,13 +68,12 @@ |
||
68 | 68 | |
69 | 69 | <?php |
70 | 70 | /** |
71 | - * The OS object holds operating system descriptions |
|
72 | - * @param name is the main title |
|
73 | - * @param subtitle - the subtitle |
|
74 | - * @param path - the path to the scriin-dump image |
|
75 | - * @param signed - if true show information that the module is signed |
|
76 | - |
|
77 | -*/ |
|
71 | + * The OS object holds operating system descriptions |
|
72 | + * @param name is the main title |
|
73 | + * @param subtitle - the subtitle |
|
74 | + * @param path - the path to the scriin-dump image |
|
75 | + * @param signed - if true show information that the module is signed |
|
76 | + */ |
|
78 | 77 | ?> |
79 | 78 | |
80 | 79 | function OS(name, subtitle, path, signed) { |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | } |
332 | 332 | |
333 | 333 | <?php if(isset($_REQUEST['idp']) && $_REQUEST['idp']) { |
334 | - print "front_page = 0;\n"; |
|
334 | + print "front_page = 0;\n"; |
|
335 | 335 | } ?> |
336 | 336 | |
337 | 337 | function showTOU(){ |
@@ -469,9 +469,9 @@ discard block |
||
469 | 469 | $p_id = (isset($_REQUEST['profile']) && $_REQUEST['profile']) ? $_REQUEST['profile'] : 0; |
470 | 470 | if(! is_numeric($p_id)) |
471 | 471 | exit; |
472 | - print 'listProfiles('.$_REQUEST['idp'].','.$p_id.');'; |
|
472 | + print 'listProfiles('.$_REQUEST['idp'].','.$p_id.');'; |
|
473 | 473 | } |
474 | - ?> |
|
474 | + ?> |
|
475 | 475 | |
476 | 476 | $(".signin").click(function(event){ |
477 | 477 | pressedButton = $(this); |
@@ -532,12 +532,12 @@ discard block |
||
532 | 532 | }); |
533 | 533 | DiscoJuice.Constants.Countries = { |
534 | 534 | <?php |
535 | - $C = $Gui->printCountryList(1); |
|
536 | - $ret = ''; |
|
537 | - foreach ($C as $key => $val) { |
|
535 | + $C = $Gui->printCountryList(1); |
|
536 | + $ret = ''; |
|
537 | + foreach ($C as $key => $val) { |
|
538 | 538 | $ret .= "'$key': \"$val\","; |
539 | - } |
|
540 | - echo substr($ret, 0, -1); |
|
539 | + } |
|
540 | + echo substr($ret, 0, -1); |
|
541 | 541 | ?> |
542 | 542 | }; |
543 | 543 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | result = j.status; |
58 | 58 | if(! result) { |
59 | 59 | alert("<?php echo _("no matching data found")?>"); |
60 | - document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']),'/').'/'?>'; |
|
60 | + document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/'?>'; |
|
61 | 61 | } |
62 | 62 | j = j.data; |
63 | 63 | n = j.length; |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | $("#profile_desc").text(''); |
186 | 186 | } |
187 | 187 | if(j.local_url !== undefined && j.local_url) |
188 | - txt = txt+'<tr><td><?php echo _("WWW:");?></td><td><a href="'+j.local_url+'" target="_blank">'+j.local_url+'</a></td></tr>'; |
|
188 | + txt = txt+'<tr><td><?php echo _("WWW:"); ?></td><td><a href="'+j.local_url+'" target="_blank">'+j.local_url+'</a></td></tr>'; |
|
189 | 189 | if(j.local_email !== undefined && j.local_email) |
190 | - txt = txt+'<tr><td><?php echo _("email:");?></td><td><a href=mailto:"'+j.local_email+'">'+j.local_email+'</a></td></tr>'; |
|
190 | + txt = txt+'<tr><td><?php echo _("email:"); ?></td><td><a href=mailto:"'+j.local_email+'">'+j.local_email+'</a></td></tr>'; |
|
191 | 191 | if(j.local_phone !== undefined && j.local_phone) |
192 | - txt = txt+'<tr><td><?php echo _("tel:");?></td><td>'+j.local_phone+'</td></tr>'; |
|
192 | + txt = txt+'<tr><td><?php echo _("tel:"); ?></td><td>'+j.local_phone+'</td></tr>'; |
|
193 | 193 | if(txt) |
194 | 194 | txt = "<table><tr><th colspan='2'><?php echo _("If you encounter problems, then you can obtain direct assistance from you home organisation at:"); ?></th></tr>"+txt+'</table>'; |
195 | 195 | else |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $("#"+v.id+",#g_"+v.id).addClass('additionalInfo'); |
219 | 219 | $("#"+v.id+",#g_"+v.id).click(function(event){ |
220 | 220 | i_div = $("#info_"+$(this).attr('id')); |
221 | - t = "<?php echo _("Your site administrator has specified that this device should be configured with resources located on a local page. When you click <b>Continue</b> this page will be opened in a new window/tab.")?>"+"<br><span class='redirect_link'><a href='"+v.redirect+"' target='_blank'><?php echo _("Continue");?></a></span>"; |
|
221 | + t = "<?php echo _("Your site administrator has specified that this device should be configured with resources located on a local page. When you click <b>Continue</b> this page will be opened in a new window/tab.")?>"+"<br><span class='redirect_link'><a href='"+v.redirect+"' target='_blank'><?php echo _("Continue"); ?></a></span>"; |
|
222 | 222 | i_div.html(t); |
223 | 223 | $(".redirect_link").click(function(event) { |
224 | 224 | i_div.hide(); |
@@ -226,13 +226,13 @@ discard block |
||
226 | 226 | |
227 | 227 | }); |
228 | 228 | } else if(v.device_customtext != '0' || v.eap_customtext != '0' || v.message != '0' || v.status > 0) { |
229 | - var continue_text = "<?php echo _("Continue");?>"; |
|
229 | + var continue_text = "<?php echo _("Continue"); ?>"; |
|
230 | 230 | $("#"+v.id+",#g_"+v.id).addClass('additionalInfo'); |
231 | 231 | $("#"+v.id+",#g_"+v.id).click(function(event){ |
232 | 232 | i_div = $("#info_"+$(this).attr('id')); |
233 | 233 | if(v.status > 0) { |
234 | 234 | t = "<?php echo _("This device cannot be configured with settings provided by your institution")?>"; |
235 | - continue_text = "<?php echo _("Close");?>"; |
|
235 | + continue_text = "<?php echo _("Close"); ?>"; |
|
236 | 236 | } else { |
237 | 237 | t = i_div.html(); |
238 | 238 | if(v.message != '0') { |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | return(Math.round(windowWidth/2)); |
331 | 331 | } |
332 | 332 | |
333 | -<?php if(isset($_REQUEST['idp']) && $_REQUEST['idp']) { |
|
333 | +<?php if (isset($_REQUEST['idp']) && $_REQUEST['idp']) { |
|
334 | 334 | print "front_page = 0;\n"; |
335 | 335 | } ?> |
336 | 336 | |
@@ -369,10 +369,10 @@ discard block |
||
369 | 369 | $("#download_info a").attr('href',download_link); |
370 | 370 | $('#download_info').show(); |
371 | 371 | if( generateTimer > 0 ) { |
372 | - setTimeout("document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']),'/')?>'+'/'+download_link",generateTimer); |
|
372 | + setTimeout("document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/')?>'+'/'+download_link",generateTimer); |
|
373 | 373 | } |
374 | 374 | else { |
375 | - document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']),'/')?>'+'/'+download_link; |
|
375 | + document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/')?>'+'/'+download_link; |
|
376 | 376 | } |
377 | 377 | } |
378 | 378 | } |
@@ -463,13 +463,13 @@ discard block |
||
463 | 463 | $(window).resize(set_front_page); |
464 | 464 | resetDevices(); |
465 | 465 | <?php |
466 | -if(isset($_REQUEST['idp']) && $_REQUEST['idp']) { |
|
467 | - if(! is_numeric($_REQUEST['idp'])) |
|
466 | +if (isset($_REQUEST['idp']) && $_REQUEST['idp']) { |
|
467 | + if (!is_numeric($_REQUEST['idp'])) |
|
468 | 468 | exit; |
469 | 469 | $p_id = (isset($_REQUEST['profile']) && $_REQUEST['profile']) ? $_REQUEST['profile'] : 0; |
470 | - if(! is_numeric($p_id)) |
|
470 | + if (!is_numeric($p_id)) |
|
471 | 471 | exit; |
472 | - print 'listProfiles('.$_REQUEST['idp'].','.$p_id.');'; |
|
472 | + print 'listProfiles(' . $_REQUEST['idp'] . ',' . $p_id . ');'; |
|
473 | 473 | } |
474 | 474 | ?> |
475 | 475 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | "title":"<?php echo _("Home institution") ?>", |
498 | 498 | "subtitle":"<?php echo _("Select your <strong>institution<\/strong>") ?>", |
499 | 499 | "textHelp": "<?php echo _("Help, my institution is not on the list") ?>", |
500 | - "textHelpMore": "<?php echo sprintf(_("This system relies on information supplied by local %s administrators. If your institution is not on the list, then nag them to add information to the %s database."),Config::$CONSORTIUM['name'],Config::$APPEARANCE['productname']); ?>", |
|
500 | + "textHelpMore": "<?php echo sprintf(_("This system relies on information supplied by local %s administrators. If your institution is not on the list, then nag them to add information to the %s database."), Config::$CONSORTIUM['name'], Config::$APPEARANCE['productname']); ?>", |
|
501 | 501 | "textLocateMe": "<?php echo _("Locate me more accurately using HTML5 Geo-Location") ?>", |
502 | 502 | "textShowProviders": "<?php echo _("Show institutions in") ?>", |
503 | 503 | "textAllCountries": "<?php echo _("all countries") ?>", |
@@ -464,11 +464,13 @@ |
||
464 | 464 | resetDevices(); |
465 | 465 | <?php |
466 | 466 | if(isset($_REQUEST['idp']) && $_REQUEST['idp']) { |
467 | - if(! is_numeric($_REQUEST['idp'])) |
|
468 | - exit; |
|
467 | + if(! is_numeric($_REQUEST['idp'])) { |
|
468 | + exit; |
|
469 | + } |
|
469 | 470 | $p_id = (isset($_REQUEST['profile']) && $_REQUEST['profile']) ? $_REQUEST['profile'] : 0; |
470 | - if(! is_numeric($p_id)) |
|
471 | - exit; |
|
471 | + if(! is_numeric($p_id)) { |
|
472 | + exit; |
|
473 | + } |
|
472 | 474 | print 'listProfiles('.$_REQUEST['idp'].','.$p_id.');'; |
473 | 475 | } |
474 | 476 | ?> |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | case 'about': |
44 | 44 | $out = sprintf(_("<span class='edu_cat'>%s</span> is built as a cooperation platform.<p>Local %s administrators enter their %s configuration details and based on them, <span class='edu_cat'>%s</span> builds customised installers for a number of popular platforms. An installer prepared for one institution will not work for users of another one, therefore if your institution is not on the list, you cannot use this system. Please contact your local administrators and try to influence them to add your institution configuration to <span class='edu_cat'>%s</span>."), Config::$APPEARANCE['productname'], Config::$CONSORTIUM['name'], Config::$CONSORTIUM['name'], Config::$APPEARANCE['productname'], Config::$APPEARANCE['productname']); |
45 | 45 | $out .= "<p>" . sprintf(_("<span class='edu_cat'>%s</span> currently supports the following devices and EAP type combinations:"), Config::$APPEARANCE['productname']) . "</p>"; |
46 | - $out .= "<table><tr><th>"._("Device Group")."</th><th>"._("Device")."</th>"; |
|
46 | + $out .= "<table><tr><th>" . _("Device Group") . "</th><th>" . _("Device") . "</th>"; |
|
47 | 47 | foreach (EAP::listKnownEAPTypes() as $oneeap) { |
48 | 48 | $out .= "<th style='min-width: 80px;'>" . display_name($oneeap) . "</th>"; |
49 | 49 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | $as = new SimpleSAML_Auth_Simple(Config::$AUTHENTICATION['ssp-authsource']); |
119 | 119 | if ($as->isAuthenticated()) |
120 | - $out.='<script type="text/javascript">goAdmin()</script>'; |
|
120 | + $out .= '<script type="text/javascript">goAdmin()</script>'; |
|
121 | 121 | else { |
122 | 122 | if (Config::$CONSORTIUM['selfservice_registration'] === NULL) |
123 | 123 | $out .= sprintf(_("You must have received an invitation from your national %s operator before being able to manage your institution. If that is the case, please continue and log in."), Config::$CONSORTIUM['name']); |
@@ -35,10 +35,11 @@ discard block |
||
35 | 35 | $out = '<script type="text/javascript">document.location.href="' . Config::$CONSORTIUM['homepage'] . '"</script>'; |
36 | 36 | break; |
37 | 37 | case 'about_consortium': |
38 | - if (Config::$CONSORTIUM['name'] == "eduroam") |
|
39 | - $out = sprintf(_("eduroam is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all eduroam hotspots on the planet. There are several million eduroam users already, enjoying free internet access on more than 6.000 hotspots! Visit <a href='http://www.eduroam.org'>the eduroam homepage</a> for more details.")); |
|
40 | - else |
|
41 | - $out = ""; |
|
38 | + if (Config::$CONSORTIUM['name'] == "eduroam") { |
|
39 | + $out = sprintf(_("eduroam is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all eduroam hotspots on the planet. There are several million eduroam users already, enjoying free internet access on more than 6.000 hotspots! Visit <a href='http://www.eduroam.org'>the eduroam homepage</a> for more details.")); |
|
40 | + } else { |
|
41 | + $out = ""; |
|
42 | + } |
|
42 | 43 | break; |
43 | 44 | case 'about': |
44 | 45 | $out = sprintf(_("<span class='edu_cat'>%s</span> is built as a cooperation platform.<p>Local %s administrators enter their %s configuration details and based on them, <span class='edu_cat'>%s</span> builds customised installers for a number of popular platforms. An installer prepared for one institution will not work for users of another one, therefore if your institution is not on the list, you cannot use this system. Please contact your local administrators and try to influence them to add your institution configuration to <span class='edu_cat'>%s</span>."), Config::$APPEARANCE['productname'], Config::$CONSORTIUM['name'], Config::$CONSORTIUM['name'], Config::$APPEARANCE['productname'], Config::$APPEARANCE['productname']); |
@@ -49,16 +50,18 @@ discard block |
||
49 | 50 | } |
50 | 51 | $out .= "</tr>"; |
51 | 52 | foreach (Devices::listDevices() as $index => $onedevice) { |
52 | - if (isset ($onedevice['options']) && (($onedevice['options']['hidden'] == 1) || ($onedevice['options']['redirect'] == 1))) |
|
53 | - continue; |
|
53 | + if (isset ($onedevice['options']) && (($onedevice['options']['hidden'] == 1) || ($onedevice['options']['redirect'] == 1))) { |
|
54 | + continue; |
|
55 | + } |
|
54 | 56 | $out .= "<tr><td class='vendor'><img src='resources/images/vendorlogo/" . $onedevice['group'] . ".png' alt='logo'></td><td>" . $onedevice['display'] . "</td>"; |
55 | 57 | $device_instance = new DeviceFactory($index); |
56 | 58 | foreach (EAP::listKnownEAPTypes() as $oneeap) { |
57 | 59 | $out .= "<td>"; |
58 | - if (in_array($oneeap, $device_instance->device->supportedEapMethods)) |
|
59 | - $out .= "<img src='resources/images/icons/Quetto/check-icon.png' alt='SUPPORTED'>"; |
|
60 | - else |
|
61 | - $out .= "<img src='resources/images/icons/Quetto/no-icon.png' alt='UNSUPPOERTED'>"; |
|
60 | + if (in_array($oneeap, $device_instance->device->supportedEapMethods)) { |
|
61 | + $out .= "<img src='resources/images/icons/Quetto/check-icon.png' alt='SUPPORTED'>"; |
|
62 | + } else { |
|
63 | + $out .= "<img src='resources/images/icons/Quetto/no-icon.png' alt='UNSUPPOERTED'>"; |
|
64 | + } |
|
62 | 65 | $out .= "</td>"; |
63 | 66 | } |
64 | 67 | $out .= "</tr>"; |
@@ -69,10 +72,12 @@ discard block |
||
69 | 72 | . "<b><u>REQUIRED</u></b>" |
70 | 73 | . "<ul>" |
71 | 74 | . "<li><b>%s</b> (the service itself)</li>"), Config::$APPEARANCE['productname'], valid_host($_SERVER['HTTP_HOST'])); |
72 | - if (!empty(Config::$APPEARANCE['webcert_CRLDP'])) |
|
73 | - $out .= sprintf(ngettext("<li><b>%s</b> (the CRL Distribution Point for the site certificate), also TCP/80</li>", "<li><b>%s</b> (the CRL Distribution Points for the site certificate), also TCP/80</li>", count(Config::$APPEARANCE['webcert_CRLDP'])), implode(", ", Config::$APPEARANCE['webcert_CRLDP'])); |
|
74 | - if (!empty(Config::$APPEARANCE['webcert_OCSP'])) |
|
75 | - $out .= sprintf(ngettext("<li><b>%s</b> (the OCSP Responder for the site certificate), also TCP/80</li>", "<li><b>%s</b> (the OCSP Responder for the site certificate), also TCP/80</li>", count(Config::$APPEARANCE['webcert_OCSP'])), implode(", ", Config::$APPEARANCE['webcert_OCSP'])); |
|
75 | + if (!empty(Config::$APPEARANCE['webcert_CRLDP'])) { |
|
76 | + $out .= sprintf(ngettext("<li><b>%s</b> (the CRL Distribution Point for the site certificate), also TCP/80</li>", "<li><b>%s</b> (the CRL Distribution Points for the site certificate), also TCP/80</li>", count(Config::$APPEARANCE['webcert_CRLDP'])), implode(", ", Config::$APPEARANCE['webcert_CRLDP'])); |
|
77 | + } |
|
78 | + if (!empty(Config::$APPEARANCE['webcert_OCSP'])) { |
|
79 | + $out .= sprintf(ngettext("<li><b>%s</b> (the OCSP Responder for the site certificate), also TCP/80</li>", "<li><b>%s</b> (the OCSP Responder for the site certificate), also TCP/80</li>", count(Config::$APPEARANCE['webcert_OCSP'])), implode(", ", Config::$APPEARANCE['webcert_OCSP'])); |
|
80 | + } |
|
76 | 81 | $out .= sprintf(_("<li><b>android.l.google.com</b> (Google Play access for Android App)</li>" |
77 | 82 | . "<li><b>android.clients.google.com</b> (Google Play access for Android App)</li>" |
78 | 83 | . "<li><b>play.google.com</b> (Google Play access for Android App)</li>" |
@@ -116,13 +121,14 @@ discard block |
||
116 | 121 | require_once(Config::$AUTHENTICATION['ssp-path-to-autoloader']); |
117 | 122 | |
118 | 123 | $as = new SimpleSAML_Auth_Simple(Config::$AUTHENTICATION['ssp-authsource']); |
119 | - if ($as->isAuthenticated()) |
|
120 | - $out.='<script type="text/javascript">goAdmin()</script>'; |
|
121 | - else { |
|
122 | - if (Config::$CONSORTIUM['selfservice_registration'] === NULL) |
|
123 | - $out .= sprintf(_("You must have received an invitation from your national %s operator before being able to manage your institution. If that is the case, please continue and log in."), Config::$CONSORTIUM['name']); |
|
124 | - else |
|
125 | - $out .= _("Please authenticate yourself and login"); |
|
124 | + if ($as->isAuthenticated()) { |
|
125 | + $out.='<script type="text/javascript">goAdmin()</script>'; |
|
126 | + } else { |
|
127 | + if (Config::$CONSORTIUM['selfservice_registration'] === NULL) { |
|
128 | + $out .= sprintf(_("You must have received an invitation from your national %s operator before being able to manage your institution. If that is the case, please continue and log in."), Config::$CONSORTIUM['name']); |
|
129 | + } else { |
|
130 | + $out .= _("Please authenticate yourself and login"); |
|
131 | + } |
|
126 | 132 | $out .= "<p><button onclick='goAdmin(); return(false);'>" . _("Login") . "</button>"; |
127 | 133 | } |
128 | 134 | break; |
@@ -16,7 +16,7 @@ |
||
16 | 16 | |
17 | 17 | // extract request parameters; action is mandatory |
18 | 18 | if(!isset($_REQUEST['action'])) |
19 | - exit; |
|
19 | + exit; |
|
20 | 20 | |
21 | 21 | $action = $_REQUEST['action']; |
22 | 22 | $id = ( isset($_REQUEST['id']) ? $_REQUEST['id'] : FALSE ); |
@@ -10,23 +10,23 @@ discard block |
||
10 | 10 | * |
11 | 11 | * @package UserAPI |
12 | 12 | */ |
13 | -include(dirname(dirname(dirname(__FILE__)))."/config/_config.php"); |
|
13 | +include(dirname(dirname(dirname(__FILE__))) . "/config/_config.php"); |
|
14 | 14 | include_once("UserAPI.php"); |
15 | 15 | $API = new UserAPI(); |
16 | 16 | |
17 | 17 | // extract request parameters; action is mandatory |
18 | -if(!isset($_REQUEST['action'])) |
|
18 | +if (!isset($_REQUEST['action'])) |
|
19 | 19 | exit; |
20 | 20 | |
21 | 21 | $action = $_REQUEST['action']; |
22 | -$id = ( isset($_REQUEST['id']) ? $_REQUEST['id'] : FALSE ); |
|
23 | -$lang = ( isset($_REQUEST['lang']) ? $_REQUEST['lang'] : FALSE ); |
|
24 | -$profile = ( isset($_REQUEST['profile']) ? $_REQUEST['profile'] : FALSE ); |
|
25 | -$disco = ( isset($_REQUEST['disco']) ? $_REQUEST['disco'] : FALSE ); |
|
26 | -$sort = ( isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 0 ); |
|
27 | -$generatedfor = ( isset($_REQUEST['generatedfor']) ? $_REQUEST['generatedfor'] : 'user' ); |
|
22 | +$id = (isset($_REQUEST['id']) ? $_REQUEST['id'] : FALSE); |
|
23 | +$lang = (isset($_REQUEST['lang']) ? $_REQUEST['lang'] : FALSE); |
|
24 | +$profile = (isset($_REQUEST['profile']) ? $_REQUEST['profile'] : FALSE); |
|
25 | +$disco = (isset($_REQUEST['disco']) ? $_REQUEST['disco'] : FALSE); |
|
26 | +$sort = (isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 0); |
|
27 | +$generatedfor = (isset($_REQUEST['generatedfor']) ? $_REQUEST['generatedfor'] : 'user'); |
|
28 | 28 | |
29 | -debug(4,"cat_back action: ".$action.':'.$id.':'.$lang.':'.$profile.':'.$disco."\n"); |
|
29 | +debug(4, "cat_back action: " . $action . ':' . $id . ':' . $lang . ':' . $profile . ':' . $disco . "\n"); |
|
30 | 30 | |
31 | 31 | switch ($action) { |
32 | 32 | case 'listLanguages': |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | break; |
44 | 44 | case 'listProfiles': // needs $id set - abort if not |
45 | 45 | if ($id === FALSE) exit; |
46 | - $API->JSON_listProfiles($id,$sort); |
|
46 | + $API->JSON_listProfiles($id, $sort); |
|
47 | 47 | break; |
48 | 48 | case 'listDevices': |
49 | 49 | $API->JSON_listDevices($id); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | break; |
55 | 55 | case 'downloadInstaller': // needs $id and $profile set optional $generatedfor |
56 | 56 | if ($id === FALSE || $profile === FALSE) exit; |
57 | - $API->downloadInstaller($id, $profile,$generatedfor); |
|
57 | + $API->downloadInstaller($id, $profile, $generatedfor); |
|
58 | 58 | break; |
59 | 59 | case 'profileAttributes': // needs $id set |
60 | 60 | if ($id === FALSE) exit; |
@@ -15,8 +15,9 @@ discard block |
||
15 | 15 | $API = new UserAPI(); |
16 | 16 | |
17 | 17 | // extract request parameters; action is mandatory |
18 | -if(!isset($_REQUEST['action'])) |
|
18 | +if(!isset($_REQUEST['action'])) { |
|
19 | 19 | exit; |
20 | +} |
|
20 | 21 | |
21 | 22 | $action = $_REQUEST['action']; |
22 | 23 | $id = ( isset($_REQUEST['id']) ? $_REQUEST['id'] : FALSE ); |
@@ -42,29 +43,41 @@ discard block |
||
42 | 43 | $API->JSON_listIdentityProvidersForDisco(); |
43 | 44 | break; |
44 | 45 | case 'listProfiles': // needs $id set - abort if not |
45 | - if ($id === FALSE) exit; |
|
46 | + if ($id === FALSE) { |
|
47 | + exit; |
|
48 | + } |
|
46 | 49 | $API->JSON_listProfiles($id,$sort); |
47 | 50 | break; |
48 | 51 | case 'listDevices': |
49 | 52 | $API->JSON_listDevices($id); |
50 | 53 | break; |
51 | 54 | case 'generateInstaller': // needs $id and $profile set |
52 | - if ($id === FALSE || $profile === FALSE) exit; |
|
55 | + if ($id === FALSE || $profile === FALSE) { |
|
56 | + exit; |
|
57 | + } |
|
53 | 58 | $API->JSON_generateInstaller($id, $profile); |
54 | 59 | break; |
55 | 60 | case 'downloadInstaller': // needs $id and $profile set optional $generatedfor |
56 | - if ($id === FALSE || $profile === FALSE) exit; |
|
61 | + if ($id === FALSE || $profile === FALSE) { |
|
62 | + exit; |
|
63 | + } |
|
57 | 64 | $API->downloadInstaller($id, $profile,$generatedfor); |
58 | 65 | break; |
59 | 66 | case 'profileAttributes': // needs $id set |
60 | - if ($id === FALSE) exit; |
|
67 | + if ($id === FALSE) { |
|
68 | + exit; |
|
69 | + } |
|
61 | 70 | $API->JSON_profileAttributes($id); |
62 | 71 | break; |
63 | 72 | case 'sendLogo': // needs $id and $disco set |
64 | - if ($id === FALSE) exit; |
|
73 | + if ($id === FALSE) { |
|
74 | + exit; |
|
75 | + } |
|
65 | 76 | $API->sendLogo($id, $disco); |
66 | 77 | case 'deviceInfo': // needs $id and profile set |
67 | - if ($id === FALSE || $profile === FALSE) exit; |
|
78 | + if ($id === FALSE || $profile === FALSE) { |
|
79 | + exit; |
|
80 | + } |
|
68 | 81 | $API->deviceInfo($id, $profile); |
69 | 82 | break; |
70 | 83 | case 'locateUser': |
@@ -2,63 +2,63 @@ discard block |
||
2 | 2 | $FAQ = []; |
3 | 3 | |
4 | 4 | array_push($FAQ, |
5 | - [ |
|
5 | + [ |
|
6 | 6 | 'title'=>sprintf(_("My institution is not listed. Can't I just use any of the other ones?")), |
7 | 7 | 'text'=>sprintf(_("No! The installers contain security settings which are specific to the institution. If you are not from that institution, 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 institution installer is <i>guaranteed to not work</i>!")) |
8 | - ]); |
|
8 | + ]); |
|
9 | 9 | |
10 | 10 | array_push($FAQ, |
11 | - [ |
|
11 | + [ |
|
12 | 12 | 'title'=>sprintf(_("What can I do to get my institution listed?")), |
13 | 13 | 'text'=>sprintf(_("Contact %s administrators at your home institution and complain. It will take at most one hour of their time to get things done."),Config::$CONSORTIUM['name']) |
14 | 14 | ]); |
15 | 15 | |
16 | 16 | array_push($FAQ, |
17 | - [ |
|
17 | + [ |
|
18 | 18 | 'title'=>sprintf(_("My device is not listed! Does that mean I can't do %s?"),Config::$CONSORTIUM['name']), |
19 | 19 | '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::$CONSORTIUM['name'],Config::$CONSORTIUM['name']) |
20 | - ]); |
|
20 | + ]); |
|
21 | 21 | |
22 | 22 | array_push($FAQ, |
23 | - [ |
|
23 | + [ |
|
24 | 24 | 'title'=>sprintf(_("I can connect to %s simply by providing username and password, what is the point of using an installer?"),Config::$CONSORTIUM['name']), |
25 | 25 | '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.")) |
26 | 26 | ]); |
27 | 27 | |
28 | 28 | if (Config::$CONSORTIUM['name'] == "eduroam") { |
29 | - array_push($FAQ, |
|
30 | - [ |
|
31 | - 'title'=>sprintf(_("What is this eduroam thing anyway?")), |
|
32 | - 'text'=>sprintf(_("eduroam is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all eduroam hotspots on the planet. There are several million eduroam users already, enjoying free internet access on more than 6.000 hotspots! Visit <a href='http://www.eduroam.org'>the eduroam homepage</a> for more details.")) |
|
33 | - ]); |
|
29 | + array_push($FAQ, |
|
30 | + [ |
|
31 | + 'title'=>sprintf(_("What is this eduroam thing anyway?")), |
|
32 | + 'text'=>sprintf(_("eduroam is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all eduroam hotspots on the planet. There are several million eduroam users already, enjoying free internet access on more than 6.000 hotspots! Visit <a href='http://www.eduroam.org'>the eduroam homepage</a> for more details.")) |
|
33 | + ]); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | array_push($FAQ, |
37 | - [ |
|
37 | + [ |
|
38 | 38 | 'title'=>sprintf(_("Is it safe to use %s installers?"),Config::$APPEARANCE['productname']), |
39 | 39 | '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::$CONSORTIUM['signer_name']) && Config::$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::$CONSORTIUM['signer_name']):""), |
40 | 40 | |
41 | 41 | ]); |
42 | 42 | |
43 | 43 | array_push($FAQ, |
44 | - [ |
|
44 | + [ |
|
45 | 45 | 'title'=>_("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"), |
46 | 46 | '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::$CONSORTIUM['signer_name']) && Config::$CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."),Config::$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>") |
47 | 47 | |
48 | 48 | ]); |
49 | 49 | |
50 | 50 | array_push($FAQ, |
51 | - [ |
|
51 | + [ |
|
52 | 52 | 'title'=>sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"),Config::$CONSORTIUM['name']), |
53 | - '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 home institution and report the problem, the administrators should be able to trace your connections."),Config::$CONSORTIUM[ |
|
53 | + '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 home institution and report the problem, the administrators should be able to trace your connections."),Config::$CONSORTIUM[ |
|
54 | 54 | 'name']) |
55 | 55 | ]); |
56 | 56 | |
57 | 57 | array_push($FAQ, |
58 | - [ |
|
58 | + [ |
|
59 | 59 | 'title'=>sprintf(_("I have a question about this web site. Whom should I contact?")), |
60 | 60 | 'text'=>sprintf(_("You should send a mail to %s."),Config::$APPEARANCE['support-contact']['display']) |
61 | - ]); |
|
61 | + ]); |
|
62 | 62 | |
63 | 63 | |
64 | 64 | |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | <?php |
87 | 87 | $i =0; |
88 | 88 | foreach ($FAQ as $faq) { |
89 | - print '<a href="#toc'.$i.'">'.$faq['title']."</a><br>\n"; |
|
90 | - $i++; |
|
89 | + print '<a href="#toc'.$i.'">'.$faq['title']."</a><br>\n"; |
|
90 | + $i++; |
|
91 | 91 | } |
92 | 92 | ?> |
93 | 93 | </div> |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | <?php |
96 | 96 | $i =0; |
97 | 97 | foreach ($FAQ as $faq) { |
98 | - print "<dt><a name=toc$i>".$faq['title']."</a></dt>\n<dd>".$faq['text']."</dd>\n"; |
|
99 | - $i++; |
|
98 | + print "<dt><a name=toc$i>".$faq['title']."</a></dt>\n<dd>".$faq['text']."</dd>\n"; |
|
99 | + $i++; |
|
100 | 100 | } |
101 | 101 | ?> |
102 | 102 | </dl> |
@@ -10,18 +10,18 @@ discard block |
||
10 | 10 | array_push($FAQ, |
11 | 11 | [ |
12 | 12 | 'title'=>sprintf(_("What can I do to get my institution listed?")), |
13 | - 'text'=>sprintf(_("Contact %s administrators at your home institution and complain. It will take at most one hour of their time to get things done."),Config::$CONSORTIUM['name']) |
|
13 | + 'text'=>sprintf(_("Contact %s administrators at your home institution and complain. It will take at most one hour of their time to get things done."), Config::$CONSORTIUM['name']) |
|
14 | 14 | ]); |
15 | 15 | |
16 | 16 | array_push($FAQ, |
17 | 17 | [ |
18 | - 'title'=>sprintf(_("My device is not listed! Does that mean I can't do %s?"),Config::$CONSORTIUM['name']), |
|
19 | - '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::$CONSORTIUM['name'],Config::$CONSORTIUM['name']) |
|
18 | + 'title'=>sprintf(_("My device is not listed! Does that mean I can't do %s?"), Config::$CONSORTIUM['name']), |
|
19 | + '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::$CONSORTIUM['name'], Config::$CONSORTIUM['name']) |
|
20 | 20 | ]); |
21 | 21 | |
22 | 22 | array_push($FAQ, |
23 | 23 | [ |
24 | - 'title'=>sprintf(_("I can connect to %s simply by providing username and password, what is the point of using an installer?"),Config::$CONSORTIUM['name']), |
|
24 | + 'title'=>sprintf(_("I can connect to %s simply by providing username and password, what is the point of using an installer?"), Config::$CONSORTIUM['name']), |
|
25 | 25 | '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.")) |
26 | 26 | ]); |
27 | 27 | |
@@ -35,29 +35,29 @@ discard block |
||
35 | 35 | |
36 | 36 | array_push($FAQ, |
37 | 37 | [ |
38 | - 'title'=>sprintf(_("Is it safe to use %s installers?"),Config::$APPEARANCE['productname']), |
|
39 | - '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::$CONSORTIUM['signer_name']) && Config::$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::$CONSORTIUM['signer_name']):""), |
|
38 | + 'title'=>sprintf(_("Is it safe to use %s installers?"), Config::$APPEARANCE['productname']), |
|
39 | + '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::$CONSORTIUM['signer_name']) && Config::$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::$CONSORTIUM['signer_name']) : ""), |
|
40 | 40 | |
41 | 41 | ]); |
42 | 42 | |
43 | 43 | array_push($FAQ, |
44 | 44 | [ |
45 | 45 | 'title'=>_("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"), |
46 | - '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::$CONSORTIUM['signer_name']) && Config::$CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."),Config::$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>") |
|
46 | + '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::$CONSORTIUM['signer_name']) && Config::$CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), Config::$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>") |
|
47 | 47 | |
48 | 48 | ]); |
49 | 49 | |
50 | 50 | array_push($FAQ, |
51 | 51 | [ |
52 | - 'title'=>sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"),Config::$CONSORTIUM['name']), |
|
53 | - '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 home institution and report the problem, the administrators should be able to trace your connections."),Config::$CONSORTIUM[ |
|
52 | + 'title'=>sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"), Config::$CONSORTIUM['name']), |
|
53 | + '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 home institution and report the problem, the administrators should be able to trace your connections."), Config::$CONSORTIUM[ |
|
54 | 54 | 'name']) |
55 | 55 | ]); |
56 | 56 | |
57 | 57 | array_push($FAQ, |
58 | 58 | [ |
59 | 59 | 'title'=>sprintf(_("I have a question about this web site. Whom should I contact?")), |
60 | - 'text'=>sprintf(_("You should send a mail to %s."),Config::$APPEARANCE['support-contact']['display']) |
|
60 | + 'text'=>sprintf(_("You should send a mail to %s."), Config::$APPEARANCE['support-contact']['display']) |
|
61 | 61 | ]); |
62 | 62 | |
63 | 63 | |
@@ -84,18 +84,18 @@ discard block |
||
84 | 84 | </h1> |
85 | 85 | <div class="faq_toc" style="background:white; padding:5px;"> |
86 | 86 | <?php |
87 | - $i =0; |
|
87 | + $i = 0; |
|
88 | 88 | foreach ($FAQ as $faq) { |
89 | - print '<a href="#toc'.$i.'">'.$faq['title']."</a><br>\n"; |
|
89 | + print '<a href="#toc' . $i . '">' . $faq['title'] . "</a><br>\n"; |
|
90 | 90 | $i++; |
91 | 91 | } |
92 | 92 | ?> |
93 | 93 | </div> |
94 | 94 | <dl> |
95 | 95 | <?php |
96 | - $i =0; |
|
96 | + $i = 0; |
|
97 | 97 | foreach ($FAQ as $faq) { |
98 | - print "<dt><a name=toc$i>".$faq['title']."</a></dt>\n<dd>".$faq['text']."</dd>\n"; |
|
98 | + print "<dt><a name=toc$i>" . $faq['title'] . "</a></dt>\n<dd>" . $faq['text'] . "</dd>\n"; |
|
99 | 99 | $i++; |
100 | 100 | } |
101 | 101 | ?> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | // extract request parameters; action is mandatory |
18 | 18 | if(!isset($_REQUEST['action'])) |
19 | - exit; |
|
19 | + exit; |
|
20 | 20 | |
21 | 21 | $action = $_REQUEST['action']; |
22 | 22 | $id = ( isset($_REQUEST['id']) ? $_REQUEST['id'] : FALSE ); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | break; |
49 | 49 | case 'listIdentityProviders': |
50 | 50 | if(! $federation) |
51 | - $federation = $id; |
|
51 | + $federation = $id; |
|
52 | 52 | $API->JSON_listIdentityProviders($federation); |
53 | 53 | break; |
54 | 54 | case 'listAllIdentityProviders': |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | break; |
57 | 57 | case 'listProfiles': // needs $idp set - abort if not |
58 | 58 | if(! $idp) |
59 | - $idp = $id; |
|
59 | + $idp = $id; |
|
60 | 60 | if ($idp === FALSE) exit; |
61 | 61 | $API->JSON_listProfiles($idp,$sort); |
62 | 62 | break; |
63 | 63 | case 'listDevices': |
64 | 64 | if(! $profile) |
65 | - $profile = $id; |
|
65 | + $profile = $id; |
|
66 | 66 | $API->JSON_listDevices($profile); |
67 | 67 | break; |
68 | 68 | case 'generateInstaller': // needs $id and $profile set |
@@ -79,13 +79,13 @@ discard block |
||
79 | 79 | break; |
80 | 80 | case 'profileAttributes': // needs $id set |
81 | 81 | if(! $profile) |
82 | - $profile = $id; |
|
82 | + $profile = $id; |
|
83 | 83 | if ($profile === FALSE) exit; |
84 | 84 | $API->JSON_profileAttributes($profile); |
85 | 85 | break; |
86 | 86 | case 'sendLogo': // needs $id and $disco set |
87 | 87 | if(! $idp) |
88 | - $idp = $id; |
|
88 | + $idp = $id; |
|
89 | 89 | if ($idp === FALSE) exit; |
90 | 90 | $API->sendLogo($idp, $disco,$width,$height); |
91 | 91 | break; |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | break; |
104 | 104 | case 'orderIdentityProviders': |
105 | 105 | if(! $federation) |
106 | - $federation = $id; |
|
107 | - if($location) { |
|
106 | + $federation = $id; |
|
107 | + if($location) { |
|
108 | 108 | $A=explode(':',$location); |
109 | 109 | $L = ['lat'=>$A[0],'lon'=>$A[1]]; |
110 | - } else |
|
110 | + } else |
|
111 | 111 | $L = NULL; |
112 | 112 | $API->JSON_orderIdentityProviders($federation,$L); |
113 | 113 | break; |
@@ -10,28 +10,28 @@ discard block |
||
10 | 10 | * |
11 | 11 | * @package UserAPI |
12 | 12 | */ |
13 | -include(dirname(dirname(dirname(__FILE__)))."/config/_config.php"); |
|
13 | +include(dirname(dirname(dirname(__FILE__))) . "/config/_config.php"); |
|
14 | 14 | include_once("UserAPI.php"); |
15 | 15 | $API = new UserAPI(); |
16 | 16 | |
17 | 17 | // extract request parameters; action is mandatory |
18 | -if(!isset($_REQUEST['action'])) |
|
18 | +if (!isset($_REQUEST['action'])) |
|
19 | 19 | exit; |
20 | 20 | |
21 | 21 | $action = $_REQUEST['action']; |
22 | -$id = ( isset($_REQUEST['id']) ? $_REQUEST['id'] : FALSE ); |
|
23 | -$device = ( isset($_REQUEST['device']) ? $_REQUEST['device'] : FALSE ); |
|
24 | -$lang = ( isset($_REQUEST['lang']) ? $_REQUEST['lang'] : FALSE ); |
|
25 | -$idp = ( isset($_REQUEST['idp']) ? $_REQUEST['idp'] : FALSE ); |
|
26 | -$profile = ( isset($_REQUEST['profile']) ? $_REQUEST['profile'] : FALSE ); |
|
27 | -$federation = ( isset($_REQUEST['federation']) ? $_REQUEST['federation'] : FALSE ); |
|
28 | -$disco = ( isset($_REQUEST['disco']) ? $_REQUEST['disco'] : FALSE ); |
|
29 | -$width = ( isset($_REQUEST['width']) ? $_REQUEST['width'] : 0 ); |
|
30 | -$height = ( isset($_REQUEST['height']) ? $_REQUEST['height'] : 0 ); |
|
31 | -$sort = ( isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 0 ); |
|
32 | -$location = ( isset($_REQUEST['location']) ? $_REQUEST['location'] : 0 ); |
|
33 | -$api_version = ( isset($_REQUEST['api_version']) ? $_REQUEST['api_version'] : 1 ); |
|
34 | -$generatedfor = ( isset($_REQUEST['generatedfor']) ? $_REQUEST['generatedfor'] : 'user' ); |
|
22 | +$id = (isset($_REQUEST['id']) ? $_REQUEST['id'] : FALSE); |
|
23 | +$device = (isset($_REQUEST['device']) ? $_REQUEST['device'] : FALSE); |
|
24 | +$lang = (isset($_REQUEST['lang']) ? $_REQUEST['lang'] : FALSE); |
|
25 | +$idp = (isset($_REQUEST['idp']) ? $_REQUEST['idp'] : FALSE); |
|
26 | +$profile = (isset($_REQUEST['profile']) ? $_REQUEST['profile'] : FALSE); |
|
27 | +$federation = (isset($_REQUEST['federation']) ? $_REQUEST['federation'] : FALSE); |
|
28 | +$disco = (isset($_REQUEST['disco']) ? $_REQUEST['disco'] : FALSE); |
|
29 | +$width = (isset($_REQUEST['width']) ? $_REQUEST['width'] : 0); |
|
30 | +$height = (isset($_REQUEST['height']) ? $_REQUEST['height'] : 0); |
|
31 | +$sort = (isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 0); |
|
32 | +$location = (isset($_REQUEST['location']) ? $_REQUEST['location'] : 0); |
|
33 | +$api_version = (isset($_REQUEST['api_version']) ? $_REQUEST['api_version'] : 1); |
|
34 | +$generatedfor = (isset($_REQUEST['generatedfor']) ? $_REQUEST['generatedfor'] : 'user'); |
|
35 | 35 | |
36 | 36 | /* in order to provide bacwards compatibility, both $id and new named arguments are supported. |
37 | 37 | Support for $id will be removed in the futute |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $API->JSON_listCountries(); |
48 | 48 | break; |
49 | 49 | case 'listIdentityProviders': |
50 | - if(! $federation) |
|
50 | + if (!$federation) |
|
51 | 51 | $federation = $id; |
52 | 52 | $API->JSON_listIdentityProviders($federation); |
53 | 53 | break; |
@@ -55,42 +55,42 @@ discard block |
||
55 | 55 | $API->JSON_listIdentityProvidersForDisco(); |
56 | 56 | break; |
57 | 57 | case 'listProfiles': // needs $idp set - abort if not |
58 | - if(! $idp) |
|
58 | + if (!$idp) |
|
59 | 59 | $idp = $id; |
60 | 60 | if ($idp === FALSE) exit; |
61 | - $API->JSON_listProfiles($idp,$sort); |
|
61 | + $API->JSON_listProfiles($idp, $sort); |
|
62 | 62 | break; |
63 | 63 | case 'listDevices': |
64 | - if(! $profile) |
|
64 | + if (!$profile) |
|
65 | 65 | $profile = $id; |
66 | 66 | $API->JSON_listDevices($profile); |
67 | 67 | break; |
68 | 68 | case 'generateInstaller': // needs $id and $profile set |
69 | - if(! $device) |
|
69 | + if (!$device) |
|
70 | 70 | $device = $id; |
71 | 71 | if ($device === FALSE || $profile === FALSE) exit; |
72 | 72 | $API->JSON_generateInstaller($device, $profile); |
73 | 73 | break; |
74 | 74 | case 'downloadInstaller': // needs $id and $profile set optional $generatedfor |
75 | - if(! $device) |
|
75 | + if (!$device) |
|
76 | 76 | $device = $id; |
77 | 77 | if ($device === FALSE || $profile === FALSE) exit; |
78 | - $API->downloadInstaller($device, $profile,$generatedfor); |
|
78 | + $API->downloadInstaller($device, $profile, $generatedfor); |
|
79 | 79 | break; |
80 | 80 | case 'profileAttributes': // needs $id set |
81 | - if(! $profile) |
|
81 | + if (!$profile) |
|
82 | 82 | $profile = $id; |
83 | 83 | if ($profile === FALSE) exit; |
84 | 84 | $API->JSON_profileAttributes($profile); |
85 | 85 | break; |
86 | 86 | case 'sendLogo': // needs $id and $disco set |
87 | - if(! $idp) |
|
87 | + if (!$idp) |
|
88 | 88 | $idp = $id; |
89 | 89 | if ($idp === FALSE) exit; |
90 | - $API->sendLogo($idp, $disco,$width,$height); |
|
90 | + $API->sendLogo($idp, $disco, $width, $height); |
|
91 | 91 | break; |
92 | 92 | case 'deviceInfo': // needs $id and profile set |
93 | - if(! $device) |
|
93 | + if (!$device) |
|
94 | 94 | $device = $id; |
95 | 95 | if ($id === FALSE || $profile === FALSE) exit; |
96 | 96 | $API->deviceInfo($device, $profile); |
@@ -102,16 +102,16 @@ discard block |
||
102 | 102 | $API->JSON_detectOS(); |
103 | 103 | break; |
104 | 104 | case 'orderIdentityProviders': |
105 | - if(! $federation) |
|
105 | + if (!$federation) |
|
106 | 106 | $federation = $id; |
107 | - if($location) { |
|
108 | - $A=explode(':',$location); |
|
109 | - $L = ['lat'=>$A[0],'lon'=>$A[1]]; |
|
107 | + if ($location) { |
|
108 | + $A = explode(':', $location); |
|
109 | + $L = ['lat'=>$A[0], 'lon'=>$A[1]]; |
|
110 | 110 | } else |
111 | 111 | $L = NULL; |
112 | - $API->JSON_orderIdentityProviders($federation,$L); |
|
112 | + $API->JSON_orderIdentityProviders($federation, $L); |
|
113 | 113 | break; |
114 | 114 | } |
115 | -debug(4,"UserAPI action: ".$action.':'.$id.':'.$lang.':'.$profile.':'.$disco."\n"); |
|
115 | +debug(4, "UserAPI action: " . $action . ':' . $id . ':' . $lang . ':' . $profile . ':' . $disco . "\n"); |
|
116 | 116 | |
117 | 117 | ?> |
@@ -15,8 +15,9 @@ discard block |
||
15 | 15 | $API = new UserAPI(); |
16 | 16 | |
17 | 17 | // extract request parameters; action is mandatory |
18 | -if(!isset($_REQUEST['action'])) |
|
18 | +if(!isset($_REQUEST['action'])) { |
|
19 | 19 | exit; |
20 | +} |
|
20 | 21 | |
21 | 22 | $action = $_REQUEST['action']; |
22 | 23 | $id = ( isset($_REQUEST['id']) ? $_REQUEST['id'] : FALSE ); |
@@ -47,52 +48,72 @@ discard block |
||
47 | 48 | $API->JSON_listCountries(); |
48 | 49 | break; |
49 | 50 | case 'listIdentityProviders': |
50 | - if(! $federation) |
|
51 | - $federation = $id; |
|
51 | + if(! $federation) { |
|
52 | + $federation = $id; |
|
53 | + } |
|
52 | 54 | $API->JSON_listIdentityProviders($federation); |
53 | 55 | break; |
54 | 56 | case 'listAllIdentityProviders': |
55 | 57 | $API->JSON_listIdentityProvidersForDisco(); |
56 | 58 | break; |
57 | 59 | case 'listProfiles': // needs $idp set - abort if not |
58 | - if(! $idp) |
|
59 | - $idp = $id; |
|
60 | - if ($idp === FALSE) exit; |
|
60 | + if(! $idp) { |
|
61 | + $idp = $id; |
|
62 | + } |
|
63 | + if ($idp === FALSE) { |
|
64 | + exit; |
|
65 | + } |
|
61 | 66 | $API->JSON_listProfiles($idp,$sort); |
62 | 67 | break; |
63 | 68 | case 'listDevices': |
64 | - if(! $profile) |
|
65 | - $profile = $id; |
|
69 | + if(! $profile) { |
|
70 | + $profile = $id; |
|
71 | + } |
|
66 | 72 | $API->JSON_listDevices($profile); |
67 | 73 | break; |
68 | 74 | case 'generateInstaller': // needs $id and $profile set |
69 | - if(! $device) |
|
70 | - $device = $id; |
|
71 | - if ($device === FALSE || $profile === FALSE) exit; |
|
75 | + if(! $device) { |
|
76 | + $device = $id; |
|
77 | + } |
|
78 | + if ($device === FALSE || $profile === FALSE) { |
|
79 | + exit; |
|
80 | + } |
|
72 | 81 | $API->JSON_generateInstaller($device, $profile); |
73 | 82 | break; |
74 | 83 | case 'downloadInstaller': // needs $id and $profile set optional $generatedfor |
75 | - if(! $device) |
|
76 | - $device = $id; |
|
77 | - if ($device === FALSE || $profile === FALSE) exit; |
|
84 | + if(! $device) { |
|
85 | + $device = $id; |
|
86 | + } |
|
87 | + if ($device === FALSE || $profile === FALSE) { |
|
88 | + exit; |
|
89 | + } |
|
78 | 90 | $API->downloadInstaller($device, $profile,$generatedfor); |
79 | 91 | break; |
80 | 92 | case 'profileAttributes': // needs $id set |
81 | - if(! $profile) |
|
82 | - $profile = $id; |
|
83 | - if ($profile === FALSE) exit; |
|
93 | + if(! $profile) { |
|
94 | + $profile = $id; |
|
95 | + } |
|
96 | + if ($profile === FALSE) { |
|
97 | + exit; |
|
98 | + } |
|
84 | 99 | $API->JSON_profileAttributes($profile); |
85 | 100 | break; |
86 | 101 | case 'sendLogo': // needs $id and $disco set |
87 | - if(! $idp) |
|
88 | - $idp = $id; |
|
89 | - if ($idp === FALSE) exit; |
|
102 | + if(! $idp) { |
|
103 | + $idp = $id; |
|
104 | + } |
|
105 | + if ($idp === FALSE) { |
|
106 | + exit; |
|
107 | + } |
|
90 | 108 | $API->sendLogo($idp, $disco,$width,$height); |
91 | 109 | break; |
92 | 110 | case 'deviceInfo': // needs $id and profile set |
93 | - if(! $device) |
|
94 | - $device = $id; |
|
95 | - if ($id === FALSE || $profile === FALSE) exit; |
|
111 | + if(! $device) { |
|
112 | + $device = $id; |
|
113 | + } |
|
114 | + if ($id === FALSE || $profile === FALSE) { |
|
115 | + exit; |
|
116 | + } |
|
96 | 117 | $API->deviceInfo($device, $profile); |
97 | 118 | break; |
98 | 119 | case 'locateUser': |
@@ -102,13 +123,15 @@ discard block |
||
102 | 123 | $API->JSON_detectOS(); |
103 | 124 | break; |
104 | 125 | case 'orderIdentityProviders': |
105 | - if(! $federation) |
|
106 | - $federation = $id; |
|
126 | + if(! $federation) { |
|
127 | + $federation = $id; |
|
128 | + } |
|
107 | 129 | if($location) { |
108 | 130 | $A=explode(':',$location); |
109 | 131 | $L = ['lat'=>$A[0],'lon'=>$A[1]]; |
110 | - } else |
|
111 | - $L = NULL; |
|
132 | + } else { |
|
133 | + $L = NULL; |
|
134 | + } |
|
112 | 135 | $API->JSON_orderIdentityProviders($federation,$L); |
113 | 136 | break; |
114 | 137 | } |
@@ -23,33 +23,33 @@ discard block |
||
23 | 23 | //debug(4,$_REQUEST); |
24 | 24 | |
25 | 25 | /** |
26 | - * Menu class helps to define the menu on the main page |
|
27 | - */ |
|
26 | + * Menu class helps to define the menu on the main page |
|
27 | + */ |
|
28 | 28 | class Menu { |
29 | 29 | /** |
30 | - * the constructor takes an array argument defining menu items. |
|
31 | - * the array must be indexed by strings which will be passed to user/cat_info.php a the page argument |
|
32 | - * the values of the array can be either a simple string which is passed to user/cat_info.php |
|
33 | - * as the title argument or an two element array - the first element of this array will be |
|
34 | - * the title and the second is a style specification applied to the given menu item |
|
30 | + * the constructor takes an array argument defining menu items. |
|
31 | + * the array must be indexed by strings which will be passed to user/cat_info.php a the page argument |
|
32 | + * the values of the array can be either a simple string which is passed to user/cat_info.php |
|
33 | + * as the title argument or an two element array - the first element of this array will be |
|
34 | + * the title and the second is a style specification applied to the given menu item |
|
35 | 35 | */ |
36 | 36 | public function __construct($menu_array) { |
37 | - $this->menu = $menu_array; |
|
37 | + $this->menu = $menu_array; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | private function printMenuLine($index,$title="",$style="") { |
41 | 41 | if ($style !== "") |
42 | - print "<tr><td style='$style'><a href='javascript:infoCAT(\"$index\",\"".rawurlencode($title)."\")'>$title</a></td></tr>\n"; |
|
42 | + print "<tr><td style='$style'><a href='javascript:infoCAT(\"$index\",\"".rawurlencode($title)."\")'>$title</a></td></tr>\n"; |
|
43 | 43 | else |
44 | - print "<tr><td><a href='javascript:infoCAT(\"$index\",\"".rawurlencode($title)."\")'>$title</a></td></tr>\n"; |
|
44 | + print "<tr><td><a href='javascript:infoCAT(\"$index\",\"".rawurlencode($title)."\")'>$title</a></td></tr>\n"; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function printMenu() { |
48 | - foreach ($this->menu as $index => $title) |
|
49 | - if(is_array($title)) |
|
50 | - $this->printMenuLine($index,$title[0],$title[1]); |
|
51 | - else |
|
52 | - $this->printMenuLine($index,$title); |
|
48 | + foreach ($this->menu as $index => $title) |
|
49 | + if(is_array($title)) |
|
50 | + $this->printMenuLine($index,$title[0],$title[1]); |
|
51 | + else |
|
52 | + $this->printMenuLine($index,$title); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | private $menu; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $OS = $Gui->detectOS(); |
95 | 95 | debug(4,$OS); |
96 | 96 | if($OS) |
97 | - print "recognised_os = '".$OS['device']."';\n"; |
|
97 | + print "recognised_os = '".$OS['device']."';\n"; |
|
98 | 98 | $download_message = sprintf(_("Download your %s installer"),Config::$CONSORTIUM['name']); |
99 | 99 | print 'download_message = "'.$download_message.'";'; |
100 | 100 | //TODO modify this based on OS detection |
@@ -149,13 +149,13 @@ discard block |
||
149 | 149 | <table id="left_menu"> |
150 | 150 | <?php |
151 | 151 | $menu = new Menu( [ |
152 | - "about_consortium"=>[sprintf(_("About %s"), Config::$CONSORTIUM['name']),'padding-bottom:20px;font-weight: bold; '], |
|
153 | - "about"=>sprintf(_("About %s"), Config::$APPEARANCE['productname']), |
|
154 | - "tou"=>sprintf(_("Terms of use")), |
|
155 | - "faq"=>sprintf(_("FAQ")), |
|
156 | - "report"=>sprintf(_("Report a problem")), |
|
157 | - "develop"=>sprintf(_("Become a CAT developer")), |
|
158 | - "admin"=>[sprintf(_("%s admin:<br>manage your IdP"), Config::$CONSORTIUM['name']),'padding-top:30px;'], |
|
152 | + "about_consortium"=>[sprintf(_("About %s"), Config::$CONSORTIUM['name']),'padding-bottom:20px;font-weight: bold; '], |
|
153 | + "about"=>sprintf(_("About %s"), Config::$APPEARANCE['productname']), |
|
154 | + "tou"=>sprintf(_("Terms of use")), |
|
155 | + "faq"=>sprintf(_("FAQ")), |
|
156 | + "report"=>sprintf(_("Report a problem")), |
|
157 | + "develop"=>sprintf(_("Become a CAT developer")), |
|
158 | + "admin"=>[sprintf(_("%s admin:<br>manage your IdP"), Config::$CONSORTIUM['name']),'padding-top:30px;'], |
|
159 | 159 | ]); |
160 | 160 | |
161 | 161 | $menu->printMenu(); ?> |
@@ -224,9 +224,9 @@ discard block |
||
224 | 224 | <strong><?php echo _("Welcome aboard the eduroam® user community!")?></strong> |
225 | 225 | <p> |
226 | 226 | <span id="download_info"><?php |
227 | - /// the empty href is dynamically exchanged with the actual path by jQuery at runtime |
|
228 | - echo _("Your download will start shortly. In case of problems with the automatic download please use this direct <a href=''>link</a>."); |
|
229 | - ?></span> |
|
227 | + /// the empty href is dynamically exchanged with the actual path by jQuery at runtime |
|
228 | + echo _("Your download will start shortly. In case of problems with the automatic download please use this direct <a href=''>link</a>."); |
|
229 | + ?></span> |
|
230 | 230 | <p> |
231 | 231 | <?php printf(_("Dear user from %s,"),"<span class='inst_name'></span>") ?> |
232 | 232 | <br/> |
@@ -338,14 +338,14 @@ discard block |
||
338 | 338 | </td> |
339 | 339 | <td style="padding-left:80px; text-align:right;"> |
340 | 340 | <?php |
341 | - if (Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") // SW: APPROVED |
|
342 | - echo " |
|
341 | + if (Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") // SW: APPROVED |
|
342 | + echo " |
|
343 | 343 | <span id='logos' style='position:fixed; left:50%;'><img src='resources/images/dante.png' alt='DANTE' style='height:23px;width:47px'/> |
344 | 344 | <img src='resources/images/eu.png' alt='EU' style='height:23px;width:27px;border-width:0px;'/></span> |
345 | 345 | <span id='eu_text' style='text-align:right;'><a href='http://ec.europa.eu/dgs/connect/index_en.htm' style='text-decoration:none; vertical-align:top;'>European Commission Communications Networks, Content and Technology</a></span>"; |
346 | - else |
|
347 | - echo " "; |
|
348 | - ?> |
|
346 | + else |
|
347 | + echo " "; |
|
348 | + ?> |
|
349 | 349 | </td> |
350 | 350 | </tr> |
351 | 351 | </table> |
@@ -37,19 +37,19 @@ discard block |
||
37 | 37 | $this->menu = $menu_array; |
38 | 38 | } |
39 | 39 | |
40 | -private function printMenuLine($index,$title="",$style="") { |
|
40 | +private function printMenuLine($index, $title = "", $style = "") { |
|
41 | 41 | if ($style !== "") |
42 | - print "<tr><td style='$style'><a href='javascript:infoCAT(\"$index\",\"".rawurlencode($title)."\")'>$title</a></td></tr>\n"; |
|
42 | + print "<tr><td style='$style'><a href='javascript:infoCAT(\"$index\",\"" . rawurlencode($title) . "\")'>$title</a></td></tr>\n"; |
|
43 | 43 | else |
44 | - print "<tr><td><a href='javascript:infoCAT(\"$index\",\"".rawurlencode($title)."\")'>$title</a></td></tr>\n"; |
|
44 | + print "<tr><td><a href='javascript:infoCAT(\"$index\",\"" . rawurlencode($title) . "\")'>$title</a></td></tr>\n"; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function printMenu() { |
48 | 48 | foreach ($this->menu as $index => $title) |
49 | - if(is_array($title)) |
|
50 | - $this->printMenuLine($index,$title[0],$title[1]); |
|
49 | + if (is_array($title)) |
|
50 | + $this->printMenuLine($index, $title[0], $title[1]); |
|
51 | 51 | else |
52 | - $this->printMenuLine($index,$title); |
|
52 | + $this->printMenuLine($index, $title); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | private $menu; |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | var download_message; |
93 | 93 | <?php |
94 | 94 | $OS = $Gui->detectOS(); |
95 | -debug(4,$OS); |
|
96 | -if($OS) |
|
97 | - print "recognised_os = '".$OS['device']."';\n"; |
|
98 | -$download_message = sprintf(_("Download your %s installer"),Config::$CONSORTIUM['name']); |
|
99 | -print 'download_message = "'.$download_message.'";'; |
|
95 | +debug(4, $OS); |
|
96 | +if ($OS) |
|
97 | + print "recognised_os = '" . $OS['device'] . "';\n"; |
|
98 | +$download_message = sprintf(_("Download your %s installer"), Config::$CONSORTIUM['name']); |
|
99 | +print 'download_message = "' . $download_message . '";'; |
|
100 | 100 | //TODO modify this based on OS detection |
101 | 101 | if (preg_match('/Android/', $_SERVER['HTTP_USER_AGENT'])) |
102 | 102 | $profile_list_size = 1; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | <div id="heading"> |
121 | 121 | <?php |
122 | 122 | print '<img src="resources/images/consortium_logo.png" alt="Consortium Logo" style="float:right; padding-right:20px; padding-top:20px"/>'; |
123 | - print '<div id="motd">'.( isset(Config::$APPEARANCE['MOTD']) ? Config::$APPEARANCE['MOTD'] : ' ' ).'</div>'; |
|
123 | + print '<div id="motd">' . (isset(Config::$APPEARANCE['MOTD']) ? Config::$APPEARANCE['MOTD'] : ' ') . '</div>'; |
|
124 | 124 | print '<h1 style="padding-bottom:0px; height:1em;">' . sprintf(_("Welcome to %s"), Config::$APPEARANCE['productname']) . '</h1> |
125 | 125 | <h2 style="padding-bottom:0px; height:0px; vertical-align:bottom;">' . Config::$APPEARANCE['productname_long'] . '</h2>'; |
126 | 126 | echo '<table id="lang_select"><tr><td>'; |
@@ -142,20 +142,20 @@ discard block |
||
142 | 142 | </div> |
143 | 143 | <form id="cat_form" name="cat_form" method="POST" accept-charset="UTF-8" action="<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/'); ?>/"> |
144 | 144 | <div id="main_body"> |
145 | -<?php if(! isset($_REQUEST['idp']) || ! $_REQUEST['idp']) { ?> |
|
145 | +<?php if (!isset($_REQUEST['idp']) || !$_REQUEST['idp']) { ?> |
|
146 | 146 | <table id="front_page"> |
147 | 147 | <tr> |
148 | 148 | <td rowspan=2 id="menu_column"> |
149 | 149 | <table id="left_menu"> |
150 | 150 | <?php |
151 | - $menu = new Menu( [ |
|
152 | - "about_consortium"=>[sprintf(_("About %s"), Config::$CONSORTIUM['name']),'padding-bottom:20px;font-weight: bold; '], |
|
151 | + $menu = new Menu([ |
|
152 | + "about_consortium"=>[sprintf(_("About %s"), Config::$CONSORTIUM['name']), 'padding-bottom:20px;font-weight: bold; '], |
|
153 | 153 | "about"=>sprintf(_("About %s"), Config::$APPEARANCE['productname']), |
154 | 154 | "tou"=>sprintf(_("Terms of use")), |
155 | 155 | "faq"=>sprintf(_("FAQ")), |
156 | 156 | "report"=>sprintf(_("Report a problem")), |
157 | 157 | "develop"=>sprintf(_("Become a CAT developer")), |
158 | - "admin"=>[sprintf(_("%s admin:<br>manage your IdP"), Config::$CONSORTIUM['name']),'padding-top:30px;'], |
|
158 | + "admin"=>[sprintf(_("%s admin:<br>manage your IdP"), Config::$CONSORTIUM['name']), 'padding-top:30px;'], |
|
159 | 159 | ]); |
160 | 160 | |
161 | 161 | $menu->printMenu(); ?> |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | <span id="line5"> |
178 | 178 | <?php |
179 | 179 | if (isset(Config::$CONSORTIUM['signer_name']) && Config::$CONSORTIUM['signer_name'] != "") |
180 | - echo sprintf(_("Digitally signed by the organisation that coordinates %s: %s"),Config::$CONSORTIUM['name'],Config::$CONSORTIUM['signer_name']); |
|
180 | + echo sprintf(_("Digitally signed by the organisation that coordinates %s: %s"), Config::$CONSORTIUM['name'], Config::$CONSORTIUM['signer_name']); |
|
181 | 181 | ?> |
182 | 182 | </span> |
183 | 183 | </div> |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | echo _("Your download will start shortly. In case of problems with the automatic download please use this direct <a href=''>link</a>."); |
229 | 229 | ?></span> |
230 | 230 | <p> |
231 | - <?php printf(_("Dear user from %s,"),"<span class='inst_name'></span>") ?> |
|
231 | + <?php printf(_("Dear user from %s,"), "<span class='inst_name'></span>") ?> |
|
232 | 232 | <br/> |
233 | 233 | <br/> |
234 | 234 | <?php echo _("we would like to warmly welcome you among the several million users of eduroam®! From now on, you will be able to use internet access resources on thousands of universities, research centres and other places all over the globe. All of this completely free of charge!") ?> |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | <p> |
237 | 237 | <?php echo _("Now that you have downloaded and installed a client configurator, all you need to do is find an eduroam® hotspot in your vicinity and enter your user credentials (this is our fancy name for 'username and password' or 'personal certificate') - and be online!") ?> |
238 | 238 | <p> |
239 | - <?php printf(_("Should you have any problems using this service, please always contact the helpdesk of %s. They will diagnose the problem and help you out. You can reach them via the means shown above."),"<span class='inst_name'></span>") ?> |
|
239 | + <?php printf(_("Should you have any problems using this service, please always contact the helpdesk of %s. They will diagnose the problem and help you out. You can reach them via the means shown above."), "<span class='inst_name'></span>") ?> |
|
240 | 240 | </p> |
241 | 241 | <p> |
242 | 242 | <a href="javascript:back_to_downloads()"><strong><?php echo _("Back to downloads") ?></strong></a> |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | </span> |
253 | 253 | </div> <!-- id="profile_redirect" --> |
254 | 254 | <div id="devices" class="device_list"> |
255 | -<?php if($OS) { ?> <!-- this part is shown when we have guessed the OS --> |
|
255 | +<?php if ($OS) { ?> <!-- this part is shown when we have guessed the OS --> |
|
256 | 256 | |
257 | 257 | <div class="sub_h" id="guess_os"> |
258 | 258 | <table id='browser'> |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | foreach ($Gui->listDevices(isset($_REQUEST['hidden']) ? $_REQUEST['hidden'] : 0) as $group => $G) { |
303 | 303 | $ct = count($G); |
304 | 304 | $i = 0; |
305 | - print '<tbody><tr><td class="vendor" rowspan="' . $ct . '"><img src="resources/images/vendorlogo/' . $group . '.png" alt="'.$group.' Device"></td>'; |
|
305 | + print '<tbody><tr><td class="vendor" rowspan="' . $ct . '"><img src="resources/images/vendorlogo/' . $group . '.png" alt="' . $group . ' Device"></td>'; |
|
306 | 306 | foreach ($G as $d => $D) { |
307 | 307 | if ($i) |
308 | 308 | print '<tr>'; |
309 | - $j = ($i+1)*20; |
|
309 | + $j = ($i + 1) * 20; |
|
310 | 310 | print "<td><button id='" . $d . "'>" . $D['display'] . "</button>"; |
311 | 311 | print "<div class='device_info' id='info_" . $d . "'></div></td>"; |
312 | 312 | print "<td><button class='more_info_b' id='info_b_" . $d . "'></button></td></tr>\n"; |
@@ -38,19 +38,22 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | private function printMenuLine($index,$title="",$style="") { |
41 | -if ($style !== "") |
|
41 | +if ($style !== "") { |
|
42 | 42 | print "<tr><td style='$style'><a href='javascript:infoCAT(\"$index\",\"".rawurlencode($title)."\")'>$title</a></td></tr>\n"; |
43 | -else |
|
43 | +} else { |
|
44 | 44 | print "<tr><td><a href='javascript:infoCAT(\"$index\",\"".rawurlencode($title)."\")'>$title</a></td></tr>\n"; |
45 | 45 | } |
46 | +} |
|
46 | 47 | |
47 | 48 | public function printMenu() { |
48 | - foreach ($this->menu as $index => $title) |
|
49 | - if(is_array($title)) |
|
50 | - $this->printMenuLine($index,$title[0],$title[1]); |
|
51 | - else |
|
52 | - $this->printMenuLine($index,$title); |
|
53 | -} |
|
49 | + foreach ($this->menu as $index => $title) { |
|
50 | + if(is_array($title)) |
|
51 | + $this->printMenuLine($index,$title[0],$title[1]); |
|
52 | + } |
|
53 | + else { |
|
54 | + $this->printMenuLine($index,$title); |
|
55 | + } |
|
56 | + } |
|
54 | 57 | |
55 | 58 | private $menu; |
56 | 59 | } |
@@ -93,15 +96,17 @@ discard block |
||
93 | 96 | <?php |
94 | 97 | $OS = $Gui->detectOS(); |
95 | 98 | debug(4,$OS); |
96 | -if($OS) |
|
99 | +if($OS) { |
|
97 | 100 | print "recognised_os = '".$OS['device']."';\n"; |
101 | +} |
|
98 | 102 | $download_message = sprintf(_("Download your %s installer"),Config::$CONSORTIUM['name']); |
99 | 103 | print 'download_message = "'.$download_message.'";'; |
100 | 104 | //TODO modify this based on OS detection |
101 | -if (preg_match('/Android/', $_SERVER['HTTP_USER_AGENT'])) |
|
105 | +if (preg_match('/Android/', $_SERVER['HTTP_USER_AGENT'])) { |
|
102 | 106 | $profile_list_size = 1; |
103 | -else |
|
107 | +} else { |
|
104 | 108 | $profile_list_size = 4; |
109 | +} |
|
105 | 110 | include("user/js/roll.php"); |
106 | 111 | include("user/js/cat_js.php"); |
107 | 112 | ?> |
@@ -176,8 +181,9 @@ discard block |
||
176 | 181 | <span id="line4"><?php echo _("Custom built for your home institution") ?></span> |
177 | 182 | <span id="line5"> |
178 | 183 | <?php |
179 | - if (isset(Config::$CONSORTIUM['signer_name']) && Config::$CONSORTIUM['signer_name'] != "") |
|
180 | - echo sprintf(_("Digitally signed by the organisation that coordinates %s: %s"),Config::$CONSORTIUM['name'],Config::$CONSORTIUM['signer_name']); |
|
184 | + if (isset(Config::$CONSORTIUM['signer_name']) && Config::$CONSORTIUM['signer_name'] != "") { |
|
185 | + echo sprintf(_("Digitally signed by the organisation that coordinates %s: %s"),Config::$CONSORTIUM['name'],Config::$CONSORTIUM['signer_name']); |
|
186 | + } |
|
181 | 187 | ?> |
182 | 188 | </span> |
183 | 189 | </div> |
@@ -304,8 +310,9 @@ discard block |
||
304 | 310 | $i = 0; |
305 | 311 | print '<tbody><tr><td class="vendor" rowspan="' . $ct . '"><img src="resources/images/vendorlogo/' . $group . '.png" alt="'.$group.' Device"></td>'; |
306 | 312 | foreach ($G as $d => $D) { |
307 | - if ($i) |
|
308 | - print '<tr>'; |
|
313 | + if ($i) { |
|
314 | + print '<tr>'; |
|
315 | + } |
|
309 | 316 | $j = ($i+1)*20; |
310 | 317 | print "<td><button id='" . $d . "'>" . $D['display'] . "</button>"; |
311 | 318 | print "<div class='device_info' id='info_" . $d . "'></div></td>"; |
@@ -338,13 +345,15 @@ discard block |
||
338 | 345 | </td> |
339 | 346 | <td style="padding-left:80px; text-align:right;"> |
340 | 347 | <?php |
341 | - if (Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") // SW: APPROVED |
|
348 | + if (Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") { |
|
349 | + // SW: APPROVED |
|
342 | 350 | echo " |
343 | 351 | <span id='logos' style='position:fixed; left:50%;'><img src='resources/images/dante.png' alt='DANTE' style='height:23px;width:47px'/> |
344 | 352 | <img src='resources/images/eu.png' alt='EU' style='height:23px;width:27px;border-width:0px;'/></span> |
345 | 353 | <span id='eu_text' style='text-align:right;'><a href='http://ec.europa.eu/dgs/connect/index_en.htm' style='text-decoration:none; vertical-align:top;'>European Commission Communications Networks, Content and Technology</a></span>"; |
346 | - else |
|
347 | - echo " "; |
|
354 | + } else { |
|
355 | + echo " "; |
|
356 | + } |
|
348 | 357 | ?> |
349 | 358 | </td> |
350 | 359 | </tr> |
@@ -42,8 +42,8 @@ |
||
42 | 42 | $p = new Profile($profile_id); |
43 | 43 | |
44 | 44 | if(!$p->institution || $p->institution !== $inst_id) { |
45 | - header("HTTP/1.0 404 Not Found"); |
|
46 | - return; |
|
45 | + header("HTTP/1.0 404 Not Found"); |
|
46 | + return; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | // now we generate the installer |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * @package UserGUI |
14 | 14 | */ |
15 | 15 | |
16 | -include(dirname(dirname(__FILE__))."/config/_config.php"); |
|
16 | +include(dirname(dirname(__FILE__)) . "/config/_config.php"); |
|
17 | 17 | require_once("UserAPI.php"); |
18 | 18 | $Gui = new UserAPI(); |
19 | 19 | |
@@ -28,26 +28,26 @@ discard block |
||
28 | 28 | |
29 | 29 | |
30 | 30 | if ($generated_for != "admin" && $generated_for != "user") { |
31 | - debug(2,"Invalid downloads triggered (neither for admin nor user???)"); |
|
31 | + debug(2, "Invalid downloads triggered (neither for admin nor user???)"); |
|
32 | 32 | print("Invalid downloads triggered (neither for admin nor user???)"); |
33 | 33 | exit(1); |
34 | 34 | } |
35 | 35 | |
36 | 36 | //print_r($_REQUEST); |
37 | 37 | |
38 | -debug(4,"download: profile:$profile_id; inst:$inst_id; device:$device\n"); |
|
38 | +debug(4, "download: profile:$profile_id; inst:$inst_id; device:$device\n"); |
|
39 | 39 | |
40 | 40 | // first block will test if the user input was valid. |
41 | 41 | |
42 | 42 | $p = new Profile($profile_id); |
43 | 43 | |
44 | -if(!$p->institution || $p->institution !== $inst_id) { |
|
44 | +if (!$p->institution || $p->institution !== $inst_id) { |
|
45 | 45 | header("HTTP/1.0 404 Not Found"); |
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
49 | 49 | // now we generate the installer |
50 | 50 | |
51 | -$Gui->downloadInstaller($device,$profile_id, $generated_for); |
|
51 | +$Gui->downloadInstaller($device, $profile_id, $generated_for); |
|
52 | 52 | |
53 | 53 | ?> |
@@ -205,14 +205,14 @@ |
||
205 | 205 | </td> |
206 | 206 | <td style="padding-left:80px; padding-right:20px; text-align:right; vertical-align:top;"> |
207 | 207 | <?php |
208 | - if (Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") // SW: APPROVED |
|
209 | - echo " |
|
208 | + if (Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") // SW: APPROVED |
|
209 | + echo " |
|
210 | 210 | <span id='logos' style='position:fixed; left:50%;'><img src='resources/images/dante.png' alt='DANTE' style='height:23px;width:47px'/> |
211 | 211 | <img src='resources/images/eu.png' alt='EU' style='height:23px;width:27px;border-width:0px;'/></span> |
212 | 212 | <span id='eu_text' style='text-align:right;'><a href='http://ec.europa.eu/dgs/connect/index_en.htm' style='text-decoration:none; vertical-align:top;'>European Commission Communications Networks, Content and Technology</a></span>"; |
213 | - else |
|
214 | - echo " "; |
|
215 | - ?> |
|
213 | + else |
|
214 | + echo " "; |
|
215 | + ?> |
|
216 | 216 | </td> |
217 | 217 | </tr> |
218 | 218 | </table> |
@@ -23,7 +23,7 @@ |
||
23 | 23 | <div id="heading"> |
24 | 24 | <?php |
25 | 25 | print '<img src="resources/images/consortium_logo.png" alt="Consortium Logo" style="float:right; padding-right:20px; padding-top:20px"/>'; |
26 | - print '<div id="motd">'.( isset(Config::$APPEARANCE['MOTD']) ? Config::$APPEARANCE['MOTD'] : ' ' ).'</div>'; |
|
26 | + print '<div id="motd">' . (isset(Config::$APPEARANCE['MOTD']) ? Config::$APPEARANCE['MOTD'] : ' ') . '</div>'; |
|
27 | 27 | print '<h1 style="padding-bottom:0px; height:1em;">' . sprintf(_("%s Copyright and Licensing"), Config::$APPEARANCE['productname']) . '</h1> |
28 | 28 | <h2 style="padding-bottom:0px; height:0px; vertical-align:bottom;">' . Config::$APPEARANCE['productname_long'] . '</h2>'; |
29 | 29 | echo '<table id="lang_select"><tr><td>'; |
@@ -196,22 +196,25 @@ |
||
196 | 196 | // this variable gets set during "make distribution" only |
197 | 197 | $RELEASE = "THERELEASE"; |
198 | 198 | echo Config::$APPEARANCE['productname'] . " - "; |
199 | - if ($RELEASE != "THERELEASE") |
|
200 | - echo sprintf(_("Release %s"), $RELEASE); |
|
201 | - else |
|
202 | - echo _("Unreleased SVN Revision"); |
|
199 | + if ($RELEASE != "THERELEASE") { |
|
200 | + echo sprintf(_("Release %s"), $RELEASE); |
|
201 | + } else { |
|
202 | + echo _("Unreleased SVN Revision"); |
|
203 | + } |
|
203 | 204 | echo " © 2011-15 GÉANT Ltd. on behalf of the GN3 and GN3plus consortia and others <a href='copyright.php'>Full Copyright and Licenses</a>"; |
204 | 205 | ?> |
205 | 206 | </td> |
206 | 207 | <td style="padding-left:80px; padding-right:20px; text-align:right; vertical-align:top;"> |
207 | 208 | <?php |
208 | - if (Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") // SW: APPROVED |
|
209 | + if (Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") { |
|
210 | + // SW: APPROVED |
|
209 | 211 | echo " |
210 | 212 | <span id='logos' style='position:fixed; left:50%;'><img src='resources/images/dante.png' alt='DANTE' style='height:23px;width:47px'/> |
211 | 213 | <img src='resources/images/eu.png' alt='EU' style='height:23px;width:27px;border-width:0px;'/></span> |
212 | 214 | <span id='eu_text' style='text-align:right;'><a href='http://ec.europa.eu/dgs/connect/index_en.htm' style='text-decoration:none; vertical-align:top;'>European Commission Communications Networks, Content and Technology</a></span>"; |
213 | - else |
|
214 | - echo " "; |
|
215 | + } else { |
|
216 | + echo " "; |
|
217 | + } |
|
215 | 218 | ?> |
216 | 219 | </td> |
217 | 220 | </tr> |