@@ -19,7 +19,7 @@ |
||
19 | 19 | * <base_url>/copyright.php after deploying the software |
20 | 20 | */ |
21 | 21 | |
22 | -require_once dirname(dirname(__DIR__)) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(__DIR__))."/config/_config.php"; |
|
23 | 23 | |
24 | 24 | $sociopath = new \core\diag\Sociopath(); |
25 | 25 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * License: see the web/copyright.inc.php file in the file structure or |
20 | 20 | * <base_url>/copyright.php after deploying the software |
21 | 21 | */ |
22 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
23 | 23 | $languageInstance = new \core\common\Language(); |
24 | 24 | $languageInstance->setTextDomain("diagnostics"); |
25 | 25 | |
@@ -56,119 +56,119 @@ discard block |
||
56 | 56 | $select = "<div id='sp_abuse_problem'> |
57 | 57 | <select style='margin-left: 0px;' id='select_sp_problem'>"; |
58 | 58 | foreach ($sp_problem as $pname => $pdesc) { |
59 | - $select = $select . "<option value='$pname'>$pdesc</option>\n"; |
|
59 | + $select = $select."<option value='$pname'>$pdesc</option>\n"; |
|
60 | 60 | } |
61 | - $select = $select . "</select></div>"; |
|
61 | + $select = $select."</select></div>"; |
|
62 | 62 | $res = " |
63 | 63 | <table id='sp_questions'> |
64 | 64 | <tr> |
65 | - <td>" . _("Select your problem") . "</td> |
|
65 | + <td>" . _("Select your problem")."</td> |
|
66 | 66 | <td>$select</td> |
67 | 67 | </tr> |
68 | 68 | <tr> |
69 | - <td>" . _("What is the realm of the IdP in question?") . "</td> |
|
69 | + <td>"._("What is the realm of the IdP in question?")."</td> |
|
70 | 70 | <td> |
71 | 71 | <input type='text' name='admin_realm' id='admin_realm' value=''> |
72 | 72 | <button id='realm_in_db_admin' accesskey='R' type='button'>" . |
73 | - _("Check if this value is registered") . |
|
73 | + _("Check if this value is registered"). |
|
74 | 74 | "</button> |
75 | 75 | </td> |
76 | 76 | </tr> |
77 | 77 | <tr class='hidden_row'> |
78 | - <td>" . _("What is the authentication timestamp of the user session in question?") . "</td> |
|
78 | + <td>" . _("What is the authentication timestamp of the user session in question?")."</td> |
|
79 | 79 | <td><input type='text' id='timestamp' name='timestamp'> |
80 | 80 | <div id='datepicker'></div> |
81 | 81 | </td> |
82 | 82 | </tr> |
83 | 83 | <tr class='hidden_row'> |
84 | - <td>" . _("What is the MAC address of the user session in question?") . "</td> |
|
84 | + <td>" . _("What is the MAC address of the user session in question?")."</td> |
|
85 | 85 | <td><input type='text' id='mac' name='mac'></td> |
86 | 86 | </tr> |
87 | 87 | <tr class='hidden_row'> |
88 | - <td>" . _("Additional comments") . "</td> |
|
88 | + <td>" . _("Additional comments")."</td> |
|
89 | 89 | <td><textarea id='freetext' name='freetext' cols='60' rows='5'></textarea></td> |
90 | 90 | </tr> |
91 | 91 | <tr class='hidden_row'> |
92 | - <td>" . _("Please specify an email address on which the IdP can contact you") . "</td> |
|
92 | + <td>" . _("Please specify an email address on which the IdP can contact you")."</td> |
|
93 | 93 | <td><input type='text' id='email' name='email'></td> |
94 | 94 | </tr> |
95 | 95 | <tr class='hidden_row' id='send_query_to_idp'> |
96 | - <td>" . _("Now you can send your query") . "</td> |
|
97 | - <td><button type='submit' id='submit_idp_query' name='go'>" . _("Send") . "</button></td> |
|
96 | + <td>" . _("Now you can send your query")."</td> |
|
97 | + <td><button type='submit' id='submit_idp_query' name='go'>" . _("Send")."</button></td> |
|
98 | 98 | </tr> |
99 | 99 | </table>"; |
100 | - $res = $res . $javascript; |
|
100 | + $res = $res.$javascript; |
|
101 | 101 | } |
102 | 102 | if ($queryType == 'idp') { |
103 | 103 | $select = "<div id='idp_reported_problem' style='display:;'> |
104 | 104 | <select style='margin-left:0px;' id='select_idp_problem'>"; |
105 | 105 | foreach ($idp_problem as $pname => $pdesc) { |
106 | - $select = $select . "<option value='$pname'>$pdesc</option>\n"; |
|
106 | + $select = $select."<option value='$pname'>$pdesc</option>\n"; |
|
107 | 107 | } |
108 | - $select = $select . "</select></div>"; |
|
108 | + $select = $select."</select></div>"; |
|
109 | 109 | $res = " |
110 | 110 | <table id='idp_questions'> |
111 | 111 | <tr> |
112 | - <td>" . _("Select your problem") . "</td> |
|
112 | + <td>" . _("Select your problem")."</td> |
|
113 | 113 | <td>$select</td> |
114 | 114 | </tr> |
115 | 115 | <tr> |
116 | - <td>" . _("Identify the SP by one of following means") . "</td> |
|
116 | + <td>"._("Identify the SP by one of following means")."</td> |
|
117 | 117 | <td></td> |
118 | 118 | </tr> |
119 | 119 | <tr id='by_opname'> |
120 | - <td>" . _("SP Operator-Name attribute") . "</td> |
|
120 | + <td>" . _("SP Operator-Name attribute")."</td> |
|
121 | 121 | <td><input type='text' id='opname' name='opname' value=''></td> |
122 | 122 | </tr> |
123 | 123 | <tr id='spmanually'> |
124 | - <td>" . _("Select the SP manually:") . "</td> |
|
124 | + <td>" . _("Select the SP manually:")."</td> |
|
125 | 125 | <td> |
126 | 126 | <div id='select_asp_country'><a href='' id='asp_countries_list'> |
127 | - <span id='opnameselect'>" . _("click to select country and organisation") . "</a></span> |
|
127 | + <span id='opnameselect'>" . _("click to select country and organisation")."</a></span> |
|
128 | 128 | </div> |
129 | 129 | <div id='select_asp_area'></div> |
130 | 130 | </td> |
131 | 131 | </tr> |
132 | 132 | <tr id='asp_desc' style='display: none;'> |
133 | - <td>" . _("or") . ' ' . _("at least describe the SP location") . "</td> |
|
133 | + <td>" . _("or").' '._("at least describe the SP location")."</td> |
|
134 | 134 | <td><input type='text' id='asp_location' name='asp_location' value=''></td> |
135 | 135 | </tr> |
136 | 136 | <tr> |
137 | - <td>" . _("What is the outer ID of the user session in question?") . "</td> |
|
137 | + <td>" . _("What is the outer ID of the user session in question?")."</td> |
|
138 | 138 | <td><input type='text' id='outer_id' name='outer_id' value=''></td> |
139 | 139 | </tr> |
140 | 140 | <tr> |
141 | - <td>" . _("What is the authentication timestamp of the user session in question?") . "</td> |
|
141 | + <td>" . _("What is the authentication timestamp of the user session in question?")."</td> |
|
142 | 142 | <td> |
143 | 143 | <input type='text' id='timestamp' name='timestamp'> |
144 | 144 | <div id='datepicker'></div> |
145 | 145 | </td> |
146 | 146 | </tr> |
147 | 147 | <tr> |
148 | - <td>" . _("What is the MAC address of the user session in question?") . "</td> |
|
148 | + <td>" . _("What is the MAC address of the user session in question?")."</td> |
|
149 | 149 | <td><input type='text' id='mac' name='mac'></td> |
150 | 150 | </tr> |
151 | 151 | <tr> |
152 | - <td>" . _("Additional comments about the problem") . "</td> |
|
152 | + <td>" . _("Additional comments about the problem")."</td> |
|
153 | 153 | <td><textarea id='freetext' name='freetext' cols='60' rows='5'></textarea></td> |
154 | 154 | </tr> |
155 | 155 | <tr> |
156 | - <td>" . _("Do you have any contact details by which the user wishes to be contacted by the SP?") . "</td> |
|
156 | + <td>" . _("Do you have any contact details by which the user wishes to be contacted by the SP?")."</td> |
|
157 | 157 | <td><textarea id='c_details' name='c_details' cols='60' rows='5'></textarea></td> |
158 | 158 | </tr> |
159 | 159 | <tr> |
160 | - <td>" . _("Please specify an email address on which the SP can contact you") . "</td> |
|
160 | + <td>" . _("Please specify an email address on which the SP can contact you")."</td> |
|
161 | 161 | <td><input type='text' id='email' name='email'></td> |
162 | 162 | </tr> |
163 | 163 | <tr class='hidden_row' id='send_query_to_sp'> |
164 | - <td>" . _("Now you can send your query") . "</td> |
|
165 | - <td><button type='submit' id='submit_sp_query' name='go'>" . _("Send") . "</button></td> |
|
164 | + <td>" . _("Now you can send your query")."</td> |
|
165 | + <td><button type='submit' id='submit_sp_query' name='go'>" . _("Send")."</button></td> |
|
166 | 166 | </tr> |
167 | 167 | </table>"; |
168 | - $res = $res . $javascript; |
|
168 | + $res = $res.$javascript; |
|
169 | 169 | } |
170 | 170 | if ($queryType == 'idp_send' || $queryType == 'sp_send') { |
171 | - include_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
171 | + include_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
172 | 172 | $cat = new \core\CAT(); |
173 | 173 | $returnArray = array(); |
174 | 174 | if (count((array) $o) > 0) { |
@@ -95,17 +95,17 @@ |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | // does the file exist in the current skin's directory? Has precedence |
98 | - if ($submodule !== '' && file_exists(__DIR__ . "/../../skins/" . $this->skin . "/" . $submodule . $path . $filename)) { |
|
99 | - $extrapath = "/skins/" . $this->skin . "/" . $submodule; |
|
98 | + if ($submodule !== '' && file_exists(__DIR__."/../../skins/".$this->skin."/".$submodule.$path.$filename)) { |
|
99 | + $extrapath = "/skins/".$this->skin."/".$submodule; |
|
100 | 100 | } |
101 | - elseif (file_exists(__DIR__ . "/../../skins/" . $this->skin . $path . $filename)) { |
|
102 | - $extrapath = "/skins/" . $this->skin; |
|
103 | - } elseif (file_exists(__DIR__ . "/../../" . $path . $filename)) { |
|
101 | + elseif (file_exists(__DIR__."/../../skins/".$this->skin.$path.$filename)) { |
|
102 | + $extrapath = "/skins/".$this->skin; |
|
103 | + } elseif (file_exists(__DIR__."/../../".$path.$filename)) { |
|
104 | 104 | $extrapath = ""; |
105 | 105 | } else { |
106 | 106 | return FALSE; |
107 | 107 | } |
108 | - return htmlspecialchars(\core\CAT::getRootUrlPath() . $extrapath . $path . $filename, ENT_QUOTES); |
|
108 | + return htmlspecialchars(\core\CAT::getRootUrlPath().$extrapath.$path.$filename, ENT_QUOTES); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | } |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public static function deleteObsoleteTempDirs() { |
36 | 36 | $downloadsDirs = [ |
37 | - 'site_installers' => dirname(dirname(dirname(dirname(__FILE__)))) . "/var/installer_cache", |
|
38 | - 'silverbullet' => dirname(dirname(dirname(dirname(__FILE__)))) . "/var/silverbullet" |
|
37 | + 'site_installers' => dirname(dirname(dirname(dirname(__FILE__))))."/var/installer_cache", |
|
38 | + 'silverbullet' => dirname(dirname(dirname(dirname(__FILE__))))."/var/silverbullet" |
|
39 | 39 | ]; |
40 | 40 | $tm = time(); |
41 | 41 | $i = 0; |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | if ($entry === '.' || $entry === '..' || $entry === '.gitignore') { |
55 | 55 | continue; |
56 | 56 | } |
57 | - $ftime = $tm - filemtime($downloads . '/' . $entry); |
|
57 | + $ftime = $tm - filemtime($downloads.'/'.$entry); |
|
58 | 58 | if ($ftime < 3600) { |
59 | 59 | continue; |
60 | 60 | } |
61 | 61 | if (isset($Cache[$entry])) { |
62 | 62 | continue; |
63 | 63 | } |
64 | - \core\common\Entity::rrmdir($downloads . '/' . $entry); |
|
64 | + \core\common\Entity::rrmdir($downloads.'/'.$entry); |
|
65 | 65 | $i = $i + 1; |
66 | 66 | print "$entry\n"; |
67 | 67 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * @author Stefan Winter <[email protected]> |
26 | 26 | * @package Core |
27 | 27 | */ |
28 | -require_once dirname(dirname(__FILE__)) . "/config/_config.php"; |
|
28 | +require_once dirname(dirname(__FILE__))."/config/_config.php"; |
|
29 | 29 | |
30 | 30 | $Gui = new \web\lib\user\Gui(); |
31 | 31 | // ... unless overwritten by direct GET/POST parameter in the request or a SESSION setting |
@@ -16,12 +16,12 @@ |
||
16 | 16 | * License: see the web/copyright.inc.php file in the file structure or |
17 | 17 | * <base_url>/copyright.php after deploying the software |
18 | 18 | */?> |
19 | -<h1>Example Skin (Pick-Up and Status page for <?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>)</h1> |
|
20 | -<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","consortium_logo.png");?>"/> |
|
19 | +<h1>Example Skin (Pick-Up and Status page for <?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>)</h1> |
|
20 | +<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "consortium_logo.png"); ?>"/> |
|
21 | 21 | <p>This skin is much more sober and less bloated than the default one. As it happens, it also doesn't do anything.</p> |
22 | 22 | <p>But at least it goes to show that it's possible to include custom images/CSS/external software using findResourceUrl(..., $filename): |
23 | -<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","custom.png");?>"/> |
|
24 | -<p>For <?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>, this page can make use of the request status info we have collected prior to invocation of the skinned page:</p> |
|
23 | +<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "custom.png"); ?>"/> |
|
24 | +<p>For <?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>, this page can make use of the request status info we have collected prior to invocation of the skinned page:</p> |
|
25 | 25 | <pre> |
26 | - <?php print_r($statusInfo);?> |
|
26 | + <?php print_r($statusInfo); ?> |
|
27 | 27 | </pre> |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * @author Stefan Winter <[email protected]> |
26 | 26 | * @package Core |
27 | 27 | */ |
28 | -require_once dirname(dirname(__FILE__)) . "/config/_config.php"; |
|
28 | +require_once dirname(dirname(__FILE__))."/config/_config.php"; |
|
29 | 29 | |
30 | 30 | $Gui = new \web\lib\user\Gui(); |
31 | 31 | // ... unless overwritten by direct GET/POST parameter in the request or a SESSION setting |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $cryptoJson = openssl_encrypt($clearJson, 'AES-256-CBC', $encryptionKey, OPENSSL_RAW_DATA, $initVector); |
118 | 118 | $hmac = hash_hmac("sha1", $cryptoJson, $encryptionKey, TRUE); |
119 | 119 | |
120 | - $this->loggerInstance->debug(4, "Clear = $clearJson\nSalt = $salt\nPW = " . $password . "\nb(IV) = " . base64_encode($initVector) . "\nb(Cipher) = " . base64_encode($cryptoJson) . "\nb(HMAC) = " . base64_encode($hmac)); |
|
120 | + $this->loggerInstance->debug(4, "Clear = $clearJson\nSalt = $salt\nPW = ".$password."\nb(IV) = ".base64_encode($initVector)."\nb(Cipher) = ".base64_encode($cryptoJson)."\nb(HMAC) = ".base64_encode($hmac)); |
|
121 | 121 | |
122 | 122 | // now, generate the container that holds all the crypto data |
123 | 123 | $finalArray = [ |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | private function wiredBlock($eapdetails) { |
190 | 190 | return [ |
191 | - "GUID" => \core\common\Entity::uuid('', "wired-dot1x-ethernet") . "}", |
|
191 | + "GUID" => \core\common\Entity::uuid('', "wired-dot1x-ethernet")."}", |
|
192 | 192 | "Name" => "eduroam configuration (wired network)", |
193 | 193 | "Remove" => false, |
194 | 194 | "Type" => "Ethernet", |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | // if silverbullet, we deliver the client cert inline |
229 | 229 | |
230 | 230 | if ($selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
231 | - $eaparray['ClientCertRef'] = "[" . $this->clientCert['GUID'] . "]"; |
|
231 | + $eaparray['ClientCertRef'] = "[".$this->clientCert['GUID']."]"; |
|
232 | 232 | $eaparray['ClientCertType'] = "Ref"; |
233 | 233 | } |
234 | 234 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | $jsonArray = ["Type" => "UnencryptedConfiguration"]; |
262 | 262 | |
263 | 263 | foreach ($this->attributes['internal:CAs'][0] as $ca) { |
264 | - $caRefs[] = "{" . $ca['uuid'] . "}"; |
|
264 | + $caRefs[] = "{".$ca['uuid']."}"; |
|
265 | 265 | } |
266 | 266 | // define CA certificates |
267 | 267 | foreach ($this->attributes['internal:CAs'][0] as $ca) { |
@@ -271,15 +271,15 @@ discard block |
||
271 | 271 | if ($caSanitized1 === FALSE) { |
272 | 272 | throw new Exception("Error cropping PEM data at its BEGIN marker."); |
273 | 273 | } |
274 | - $this->loggerInstance->debug(4, $caSanitized1 . "\n"); |
|
274 | + $this->loggerInstance->debug(4, $caSanitized1."\n"); |
|
275 | 275 | // remove \n |
276 | 276 | $caSanitized = str_replace("\n", "", $caSanitized1); |
277 | - $jsonArray["Certificates"][] = ["GUID" => "{" . $ca['uuid'] . "}", "Remove" => false, "Type" => "Authority", "X509" => $caSanitized]; |
|
278 | - $this->loggerInstance->debug(3, $caSanitized . "\n"); |
|
277 | + $jsonArray["Certificates"][] = ["GUID" => "{".$ca['uuid']."}", "Remove" => false, "Type" => "Authority", "X509" => $caSanitized]; |
|
278 | + $this->loggerInstance->debug(3, $caSanitized."\n"); |
|
279 | 279 | } |
280 | 280 | // if we are doing silverbullet, include the unencrypted(!) P12 as a client certificate |
281 | 281 | if ($this->selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
282 | - $jsonArray["Certificates"][] = ["GUID" => "[" . $this->clientCert['GUID'] . "]", "PKCS12" => base64_encode($this->clientCert['certdataclear']), "Remove" => false, "Type" => "Client"]; |
|
282 | + $jsonArray["Certificates"][] = ["GUID" => "[".$this->clientCert['GUID']."]", "PKCS12" => base64_encode($this->clientCert['certdataclear']), "Remove" => false, "Type" => "Client"]; |
|
283 | 283 | } |
284 | 284 | $eaparray = $this->eapBlock($caRefs); |
285 | 285 | // define Wi-Fi networks |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | |
301 | 301 | file_put_contents('installer_profile', $finalJson); |
302 | 302 | |
303 | - $fileName = $this->installerBasename . '.onc'; |
|
303 | + $fileName = $this->installerBasename.'.onc'; |
|
304 | 304 | |
305 | 305 | if (!$this->sign) { |
306 | 306 | rename("installer_profile", $fileName); |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | // have the notion of signing |
312 | 312 | // but if they ever change their mind, we are prepared |
313 | 313 | |
314 | - $outputFromSigning = system($this->sign . " installer_profile '$fileName' > /dev/null"); |
|
314 | + $outputFromSigning = system($this->sign." installer_profile '$fileName' > /dev/null"); |
|
315 | 315 | if ($outputFromSigning === FALSE) { |
316 | 316 | $this->loggerInstance->debug(2, "Signing the ONC installer $fileName FAILED!\n"); |
317 | 317 | } |
@@ -138,8 +138,8 @@ |
||
138 | 138 | */ |
139 | 139 | private function zipInstaller() { |
140 | 140 | // one can always access $this->attributes to check things |
141 | - $fileName = $this->installerBasename . '.zip'; |
|
142 | - $output = system('zip -q ' . $fileName . ' *'); |
|
141 | + $fileName = $this->installerBasename.'.zip'; |
|
142 | + $output = system('zip -q '.$fileName.' *'); |
|
143 | 143 | if ($output === FALSE) { |
144 | 144 | $this->loggerInstance->debug(2, "unable to zip the installer\n"); |
145 | 145 | } |