@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function htmlHeadCode() { |
48 | 48 | $cat = new \core\CAT(); |
49 | 49 | \core\common\Entity::intoThePotatoes(); |
50 | - $retval = "<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=" . \config\Master::APPEARANCE['google_maps_api_key'] . "'></script> |
|
50 | + $retval = "<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=".\config\Master::APPEARANCE['google_maps_api_key']."'></script> |
|
51 | 51 | <script type='text/javascript'> |
52 | 52 | // some global variables; |
53 | 53 | var center_lat=49.6114885608729; |
@@ -103,19 +103,19 @@ discard block |
||
103 | 103 | * |
104 | 104 | */ |
105 | 105 | function locator_magic() { |
106 | - geocoder.geocode({'address':\"" . preg_replace("/\"/", """, $this->instName) . "\", 'region':\"" . strtolower($this->fedName) . "\"}, |
|
106 | + geocoder.geocode({'address':\"" . preg_replace("/\"/", """, $this->instName)."\", 'region':\"".strtolower($this->fedName)."\"}, |
|
107 | 107 | function(r,status) { |
108 | 108 | if(status != google.maps.GeocoderStatus.OK) { |
109 | - locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name'] . "\"); |
|
109 | + locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name']."\"); |
|
110 | 110 | } else { |
111 | 111 | var i; |
112 | 112 | for(i = 0; i < r.length; i++) { |
113 | 113 | Addr = getAddressElements(r[i].address_components); |
114 | - if(Addr.country == \"" . strtoupper($this->fedName) . "\") |
|
114 | + if(Addr.country == \"" . strtoupper($this->fedName)."\") |
|
115 | 115 | break; |
116 | 116 | } |
117 | - if(Addr.country != \"" . strtoupper($this->fedName) . "\") |
|
118 | - locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name'] . "\"); |
|
117 | + if(Addr.country != \"" . strtoupper($this->fedName)."\") |
|
118 | + locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name']."\"); |
|
119 | 119 | else { |
120 | 120 | addMarker(r[i].geometry.location,15,null); |
121 | 121 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | function markerClicked(m) { |
130 | 130 | info_window.close(); |
131 | - var t = \"" . _("This is location ") . "\"+m.info; |
|
131 | + var t = \"" . _("This is location ")."\"+m.info; |
|
132 | 132 | info_window.setContent(t); |
133 | 133 | info_window.setPosition(m.getPosition()); |
134 | 134 | info_window.open(map,m); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | function getAddressLocation() { |
208 | 208 | var city = $('#address').val(); |
209 | 209 | if(city == '') { |
210 | - alert(\"" . _("nothing entered in the address field") . "\"); |
|
210 | + alert(\"" . _("nothing entered in the address field")."\"); |
|
211 | 211 | return false; |
212 | 212 | } |
213 | 213 | geocoder.geocode( { 'address': city}, function(results, status) { |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * trigger geolocation |
228 | 228 | */ |
229 | 229 | function locateMe() { |
230 | - $('#address').val(\"" . _("locating") . "\"); |
|
230 | + $('#address').val(\"" . _("locating")."\"); |
|
231 | 231 | navigator.geolocation.getCurrentPosition(locate_success,locate_fail,{maximumAge:3600000, timeout:5000}); |
232 | 232 | } |
233 | 233 | |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | if ($this->readOnly) { |
346 | 346 | return "<div id='map' class='googlemap'></div>"; |
347 | 347 | } else { |
348 | - return $this->htmlPreEdit($wizard, $additional) . $this->findLocationHtml() . "<div id='map' class='googlemap'></div>" . $this->htmlPostEdit(FALSE); |
|
348 | + return $this->htmlPreEdit($wizard, $additional).$this->findLocationHtml()."<div id='map' class='googlemap'></div>".$this->htmlPostEdit(FALSE); |
|
349 | 349 | } |
350 | 350 | } |
351 | 351 | |
@@ -358,11 +358,11 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public static function optionListDisplayCode($coords, $number) { |
360 | 360 | // quiesce warnings about unused variable |
361 | - if (strlen(sprintf("%s", $coords)) <0) { |
|
361 | + if (strlen(sprintf("%s", $coords)) < 0) { |
|
362 | 362 | throw new \Exception("A miracle! A string with negative length!"); |
363 | 363 | }; |
364 | 364 | \core\common\Entity::intoThePotatoes(); |
365 | - $retval = "<button id='location_b_" . $number . "' class='location_button'>" . _("Click to see location") . " $number</button>"; |
|
365 | + $retval = "<button id='location_b_".$number."' class='location_button'>"._("Click to see location")." $number</button>"; |
|
366 | 366 | \core\common\Entity::outOfThePotatoes(); |
367 | 367 | return $retval; |
368 | 368 | } |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | * @return string |
374 | 374 | */ |
375 | 375 | public function bodyTagCode() { |
376 | - return "onload='load(" . ($this->readOnly ? "0" : "1") . ")'"; |
|
376 | + return "onload='load(".($this->readOnly ? "0" : "1").")'"; |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | /** |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | */ |
384 | 384 | private function findLocationHtml() { |
385 | 385 | \core\common\Entity::intoThePotatoes(); |
386 | - $retval = "<p>" . _("Address:") . " <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>" . _("Find address") . "</button> <button type='button' onclick='locateMe()'>" . _("Locate Me!") . "</button></p>"; |
|
386 | + $retval = "<p>"._("Address:")." <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>"._("Find address")."</button> <button type='button' onclick='locateMe()'>"._("Locate Me!")."</button></p>"; |
|
387 | 387 | \core\common\Entity::outOfThePotatoes(); |
388 | 388 | return $retval; |
389 | 389 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | // use HTML5 geolocation |
85 | 85 | function locateMe() { |
86 | - $('#address').val(\"" . _("locating") . "\"); |
|
86 | + $('#address').val(\"" . _("locating")."\"); |
|
87 | 87 | navigator.geolocation.getCurrentPosition(locate_success,locate_fail,{maximumAge:3600000, timeout:5000}); |
88 | 88 | } |
89 | 89 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | view.fit(extent, {padding: [10, 0, 10, 0]}); |
206 | 206 | } else { |
207 | 207 | view.setCenter([0,0]); |
208 | - locate_country('" . $cat->knownFederations[strtoupper($this->fedName)]['name'] . "'); // use the federation code to locate the country |
|
208 | + locate_country('" . $cat->knownFederations[strtoupper($this->fedName)]['name']."'); // use the federation code to locate the country |
|
209 | 209 | map.setView(view); |
210 | 210 | } |
211 | 211 | view.setMaxZoom(20); |
@@ -227,14 +227,14 @@ discard block |
||
227 | 227 | function getAddressLocation() { |
228 | 228 | var city = $('#address').val(); |
229 | 229 | if(city == '') { |
230 | - alert(\"" . _("nothing entered in the address field") . "\"); |
|
230 | + alert(\"" . _("nothing entered in the address field")."\"); |
|
231 | 231 | return false; |
232 | 232 | } |
233 | 233 | city = city.replace(/\s*,\s*/g,',+'); |
234 | 234 | city = city.replace(/ +/,'+'); |
235 | 235 | $.get(addressService+'?format=json&addressdetails=0&q='+city, '', function(data) { |
236 | 236 | if (data[0] === undefined) { |
237 | - alert('" . _("Address not found, perhaps try another form, like putting the street number to the front.") . "'); |
|
237 | + alert('" . _("Address not found, perhaps try another form, like putting the street number to the front.")."'); |
|
238 | 238 | return; |
239 | 239 | } |
240 | 240 | showTmpPointer(data[0].lon, data[0].lat); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | if ($this->readOnly) { |
286 | 286 | return "<div id='map' class='locationmap'></div><script>generateMap('map')</script>"; |
287 | 287 | } else { |
288 | - return $this->htmlPreEdit($wizard, $additional) . $this->findLocationHtml() . "<span id='location-prompt'>You can drag the pointer to the final location before you save the results.</span><div id='map' class='locationmap'></div><script>generateMap('map')</script>" . $this->htmlPostEdit(FALSE); |
|
288 | + return $this->htmlPreEdit($wizard, $additional).$this->findLocationHtml()."<span id='location-prompt'>You can drag the pointer to the final location before you save the results.</span><div id='map' class='locationmap'></div><script>generateMap('map')</script>".$this->htmlPostEdit(FALSE); |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 | |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | // we don't need this parameter in this subclass |
311 | 311 | unset($coords); |
312 | 312 | \core\common\Entity::intoThePotatoes(); |
313 | - $retval = "<button id='location_b_" . $number . "' class='location_button'>" . _("Click to see location") . " $number</button>"; |
|
313 | + $retval = "<button id='location_b_".$number."' class='location_button'>"._("Click to see location")." $number</button>"; |
|
314 | 314 | \core\common\Entity::outOfThePotatoes(); |
315 | 315 | return $retval; |
316 | 316 | } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | */ |
323 | 323 | private function findLocationHtml() { |
324 | 324 | \core\common\Entity::intoThePotatoes(); |
325 | - $retval = "<p>" . _("Address:") . " <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>" . _("Find address") . "</button> <button type='button' onclick='locateMe()'>" . _("Locate Me!") . "</button></p>"; |
|
325 | + $retval = "<p>"._("Address:")." <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>"._("Find address")."</button> <button type='button' onclick='locateMe()'>"._("Locate Me!")."</button></p>"; |
|
326 | 326 | \core\common\Entity::outOfThePotatoes(); |
327 | 327 | return $retval; |
328 | 328 | } |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | $Gui->loggerInstance->debug(4, $operatingSystem); |
48 | 48 | $uiElements = new web\lib\admin\UIElements(); |
49 | 49 | if ($operatingSystem) { |
50 | - print "recognisedOS = '" . $operatingSystem['device'] . "';\n"; |
|
50 | + print "recognisedOS = '".$operatingSystem['device']."';\n"; |
|
51 | 51 | } |
52 | -require dirname(__DIR__) . '/user/js/cat_js.php'; |
|
52 | +require dirname(__DIR__).'/user/js/cat_js.php'; |
|
53 | 53 | ?> |
54 | 54 | var lang = "<?php echo($Gui->languageInstance->getLang()) ?>"; |
55 | 55 | </script> |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | <?php |
80 | 80 | switch ($statusInfo['errorcode']) { |
81 | 81 | case "GENERATOR_CONSUMED": |
82 | - echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to reuse download link"), TRUE) . "<p>"; |
|
82 | + echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to reuse download link"), TRUE)."<p>"; |
|
83 | 83 | break; |
84 | 84 | case NULL: |
85 | 85 | default: |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | echo " "; |
103 | 103 | echo sprintf(ngettext("<strong>%d</strong> of your credentials is not valid any more.", "<strong>%d</strong> of your credentials are not valid any more.", $noGoodCerts), $noGoodCerts); |
104 | 104 | } |
105 | - echo " <span id='detailtext'>" . _("I want to see the details.") . "</span>"; |
|
105 | + echo " <span id='detailtext'>"._("I want to see the details.")."</span>"; |
|
106 | 106 | echo "<table id='cert_details'></table>"; |
107 | 107 | } |
108 | 108 | } |
@@ -111,60 +111,60 @@ discard block |
||
111 | 111 | case \core\SilverbulletInvitation::SB_TOKENSTATUS_VALID: // treat both cases as equal |
112 | 112 | case \core\SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED: |
113 | 113 | if ($statusInfo['invitation_object']->activationsTotal > 1) { // only show this extra info in the non-trivial case. |
114 | - echo "<h3>" . sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining) . "</h3>"; |
|
114 | + echo "<h3>".sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining)."</h3>"; |
|
115 | 115 | } |
116 | 116 | if (!$statusInfo["OS"]) { |
117 | - echo "<p>" . _("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.") . "</p>"; |
|
117 | + echo "<p>"._("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.")."</p>"; |
|
118 | 118 | break; |
119 | 119 | } |
120 | 120 | |
121 | 121 | $dev = new \core\DeviceFactory($statusInfo['OS']['device']); |
122 | 122 | $dev->device->calculatePreferredEapType([new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET)]); |
123 | 123 | if ($dev->device->selectedEap == []) { |
124 | - echo "<p>" . sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display']) . "</p>"; |
|
124 | + echo "<p>".sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display'])."</p>"; |
|
125 | 125 | break; |
126 | 126 | } |
127 | - $message = $dev->device->options['message'] ?? '' ; |
|
127 | + $message = $dev->device->options['message'] ?? ''; |
|
128 | 128 | |
129 | 129 | $sbMessage = $dev->device->options['sb_message'] ?? ''; |
130 | 130 | if ($message != '' && $sbMessage != '') { |
131 | - $message = $message . "<p>" . $sbMessage; |
|
131 | + $message = $message."<p>".$sbMessage; |
|
132 | 132 | } else { |
133 | - $message = $message . $sbMessage; |
|
133 | + $message = $message.$sbMessage; |
|
134 | 134 | } |
135 | 135 | |
136 | - echo "<div id='sb_download_message'><p>" . sprintf(_("You can now download a personalised %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']); |
|
136 | + echo "<div id='sb_download_message'><p>".sprintf(_("You can now download a personalised %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']); |
|
137 | 137 | // echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']); |
138 | 138 | echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']); |
139 | - echo "<p style='color:red;'>" . sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), \config\ConfAssistant::CONSORTIUM['display_name']) . "</p>"; |
|
140 | - echo "<p>" . _("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.") . "</p></div>"; |
|
139 | + echo "<p style='color:red;'>".sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), \config\ConfAssistant::CONSORTIUM['display_name'])."</p>"; |
|
140 | + echo "<p>"._("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.")."</p></div>"; |
|
141 | 141 | |
142 | 142 | $importPassword = \core\common\Entity::randomString(4, "0123456789"); |
143 | 143 | $profile = new \core\ProfileSilverbullet($statusInfo['profile']->identifier, NULL); |
144 | 144 | |
145 | - echo "<h2>" . sprintf(_("Import PIN: %s"), $importPassword) . "</h2>"; |
|
145 | + echo "<h2>".sprintf(_("Import PIN: %s"), $importPassword)."</h2>"; |
|
146 | 146 | $_SESSION['individualtoken'] = $cleanToken; |
147 | 147 | $_SESSION['importpassword'] = $importPassword; |
148 | - echo "<input type='hidden' name='device' value='" . $statusInfo['OS']['device'] . "'/>"; |
|
148 | + echo "<input type='hidden' name='device' value='".$statusInfo['OS']['device']."'/>"; |
|
149 | 149 | echo "<input type='hidden' name='generatedfor' value='silverbullet'/>"; |
150 | - echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>" . sprintf(_("Click here to download your %s installer!"), \config\ConfAssistant::CONSORTIUM['display_name']) . "</span></button>"; |
|
150 | + echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>".sprintf(_("Click here to download your %s installer!"), \config\ConfAssistant::CONSORTIUM['display_name'])."</span></button>"; |
|
151 | 151 | echo "<div class='device_info' id='info_g_sb'></div>"; |
152 | 152 | break; |
153 | 153 | case \core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED: |
154 | 154 | echo "<h2>Invitation link expired</h2>"; |
155 | - echo "<p>" . sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), \config\ConfAssistant::CONSORTIUM['display_name'], $statusInfo['invitation_object']->expiry) . "</p>"; |
|
155 | + echo "<p>".sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), \config\ConfAssistant::CONSORTIUM['display_name'], $statusInfo['invitation_object']->expiry)."</p>"; |
|
156 | 156 | echo "<p>Below is all the information about your account's other login details, if any.</p>"; |
157 | 157 | // do NOT break, display full account info instead (this was a previously valid token after all) |
158 | 158 | case \core\SilverbulletInvitation::SB_TOKENSTATUS_REDEEMED: |
159 | 159 | // nothing to say really. User got the breakdown of certs above, and this link doesn't give him any new ones. |
160 | 160 | break; |
161 | 161 | case \core\SilverbulletInvitation::SB_TOKENSTATUS_INVALID: |
162 | - echo "<h2>" . _("Account information not found") . "</h2>"; |
|
163 | - echo "<p>" . sprintf(_("The invitation link you followed does not map to any invitation we have on file.") . "</p><p>" . _("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."),\config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::SILVERBULLET['realm_suffix']); |
|
162 | + echo "<h2>"._("Account information not found")."</h2>"; |
|
163 | + echo "<p>".sprintf(_("The invitation link you followed does not map to any invitation we have on file.")."</p><p>"._("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::SILVERBULLET['realm_suffix']); |
|
164 | 164 | } |
165 | 165 | if (isset($statusInfo['profile_id']) && isset($statusInfo['idp_id'])) { |
166 | - echo "<input type='hidden' name='profile' id='profile_id' value='" . $statusInfo['profile_id'] . "'/>"; |
|
167 | - echo "<input type='hidden' id='inst_id' name='idp' value='" . $statusInfo['idp_id'] . "'/>"; |
|
166 | + echo "<input type='hidden' name='profile' id='profile_id' value='".$statusInfo['profile_id']."'/>"; |
|
167 | + echo "<input type='hidden' id='inst_id' name='idp' value='".$statusInfo['idp_id']."'/>"; |
|
168 | 168 | } |
169 | 169 | ?> |
170 | 170 | </div> |
@@ -184,18 +184,18 @@ discard block |
||
184 | 184 | $attributes = $statusInfo['attributes']; |
185 | 185 | $supportInfo = ''; |
186 | 186 | if (!empty($attributes['local_url'])) { |
187 | - $supportInfo .= '<tr><td>' . ("WWW:") . '</td><td><a href="' . $attributes['local_url'] . '" target="_blank">' . $attributes['local_url'] . '</a></td></tr>'; |
|
187 | + $supportInfo .= '<tr><td>'.("WWW:").'</td><td><a href="'.$attributes['local_url'].'" target="_blank">'.$attributes['local_url'].'</a></td></tr>'; |
|
188 | 188 | } |
189 | 189 | if (!empty($attributes['local_email'])) { |
190 | - $supportInfo .= '<tr><td>' . ("email:") . '</td><td><a href="' . $attributes['local_email'] . '" target="_blank">' . $attributes['local_email'] . '</a></td></tr>'; |
|
190 | + $supportInfo .= '<tr><td>'.("email:").'</td><td><a href="'.$attributes['local_email'].'" target="_blank">'.$attributes['local_email'].'</a></td></tr>'; |
|
191 | 191 | } |
192 | 192 | if (!empty($attributes['local_phone'])) { |
193 | - $supportInfo .= '<tr><td>' . ("tel:") . '</td><td><a href="' . $attributes['local_phone'] . '" target="_blank">' . $attributes['local_phone'] . '</a></td></tr>'; |
|
193 | + $supportInfo .= '<tr><td>'.("tel:").'</td><td><a href="'.$attributes['local_phone'].'" target="_blank">'.$attributes['local_phone'].'</a></td></tr>'; |
|
194 | 194 | } |
195 | 195 | if ($supportInfo != '') { |
196 | - $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems, then you can obtain direct assistance from your organisation at:") . "</th></tr>$supportInfo</table>"; |
|
196 | + $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems, then you can obtain direct assistance from your organisation at:")."</th></tr>$supportInfo</table>"; |
|
197 | 197 | } else { |
198 | - $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems you should ask those who gave you your account for help.") . "</th></tr></table>"; |
|
198 | + $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems you should ask those who gave you your account for help.")."</th></tr></table>"; |
|
199 | 199 | } |
200 | 200 | ?> |
201 | 201 | <script> |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | var logo = <?php echo $statusInfo['idp_logo']; ?>; |
205 | 205 | var idpId = <?php echo $statusInfo['idp_id']; ?>; |
206 | 206 | <?php |
207 | - if($message != '') { |
|
207 | + if ($message != '') { |
|
208 | 208 | echo "message = \"$message\";\n"; |
209 | 209 | } |
210 | 210 | ?> |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * ****************************************************************************** |
10 | 10 | */ |
11 | 11 | |
12 | -require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php"; |
|
12 | +require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php"; |
|
13 | 13 | $auth = new \web\lib\admin\Authentication(); |
14 | 14 | $auth->authenticate(); |
15 | 15 | $languageInstance = new \core\common\Language(); |
@@ -372,20 +372,20 @@ discard block |
||
372 | 372 | ); |
373 | 373 | // Generate a new private (and public) key pair |
374 | 374 | $privkey = openssl_pkey_new(array( |
375 | - "private_key_bits" => 4096, |
|
376 | - "private_key_type" => OPENSSL_KEYTYPE_RSA)); |
|
375 | + "private_key_bits" => 4096, |
|
376 | + "private_key_type" => OPENSSL_KEYTYPE_RSA)); |
|
377 | 377 | // export private key to $clientprivateKey (as string) |
378 | 378 | openssl_pkey_export($privkey, $this->radsec_priv); |
379 | 379 | // Generate a certificate signing request |
380 | 380 | $csr = openssl_csr_new($dn, $privkey, |
381 | - array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf")); |
|
381 | + array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf")); |
|
382 | 382 | // get CA certificate and private key |
383 | 383 | $caprivkey = array(file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"), |
384 | 384 | \config\Master::MANAGEDSP['capass']); |
385 | 385 | $cacert = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
386 | 386 | $this->setTLSSerialNumber(); |
387 | 387 | $clientcert = openssl_csr_sign($csr, $cacert, $caprivkey, \config\Master::MANAGEDSP['daystoexpiry'], |
388 | - array('digest_alg'=>'sha512', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), $this->radsec_cert_serial_no); |
|
388 | + array('digest_alg'=>'sha512', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), $this->radsec_cert_serial_no); |
|
389 | 389 | openssl_x509_export($clientcert, $this->radsec_cert); |
390 | 390 | } |
391 | 391 | /** |
@@ -506,9 +506,9 @@ discard block |
||
506 | 506 | */ |
507 | 507 | public function renewtls() |
508 | 508 | { |
509 | - $id = $this->identifier; |
|
510 | - $futureTlsClient = $this->createTLScredentials(); |
|
511 | - $this->databaseHandle->exec("UPDATE deployment SET radsec_priv = ?, radsec_cert = ?, radsec_cert_serial_number = ? WHERE deployment_id = ?", "ssii", $this->radsec_priv, $this->radsec_cert, $this->radsec_cert_serial_no, $id); |
|
509 | + $id = $this->identifier; |
|
510 | + $futureTlsClient = $this->createTLScredentials(); |
|
511 | + $this->databaseHandle->exec("UPDATE deployment SET radsec_priv = ?, radsec_cert = ?, radsec_cert_serial_number = ? WHERE deployment_id = ?", "ssii", $this->radsec_priv, $this->radsec_cert, $this->radsec_cert_serial_no, $id); |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | /** |
@@ -518,38 +518,38 @@ discard block |
||
518 | 518 | */ |
519 | 519 | public function tlsfromcsr($csr) |
520 | 520 | { |
521 | - $id = $this->identifier; |
|
522 | - $dn = array(); |
|
523 | - $dn['rdnSequence'] = array(); |
|
524 | - $dn['rdnSequence'][0] = array(); |
|
525 | - $dn['rdnSequence'][0][] = array('type' => 'id-at-organizationName', 'value' => array()); |
|
526 | - $dn['rdnSequence'][0][0]['value']['utf8String'] = 'eduroam'; |
|
527 | - $dn['rdnSequence'][1] = array(); |
|
528 | - $dn['rdnSequence'][1][] = array('type' => 'id-at-organizationalUnitName', 'value' => array()); |
|
529 | - $dn['rdnSequence'][1][0]['value']['utf8String'] = 'eduroam Managed SP'; |
|
530 | - $dn['rdnSequence'][2] = array(); |
|
531 | - $dn['rdnSequence'][2][] = array('type' => 'id-at-commonName', 'value' => array()); |
|
532 | - $dn['rdnSequence'][2][0]['value']['utf8String'] = 'SP' . $this->identifier . "-" . $this->institution; |
|
533 | - $csr->setDN($dn); |
|
534 | - $pemcakey = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"); |
|
535 | - $cakey = \phpseclib3\Crypt\PublicKeyLoader::loadPrivateKey($pemcakey, \config\Master::MANAGEDSP['capass'] ); |
|
536 | - $pemca = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
537 | - $ca = new \phpseclib3\File\X509(); |
|
538 | - $ca->loadX509($pemca); |
|
539 | - $ca->setPrivateKey($cakey); |
|
540 | - // Sign the updated request, producing the certificate. |
|
541 | - $x509 = new \phpseclib3\File\X509(); |
|
542 | - $csr->setExtension('id-ce-keyUsage', ['digitalSignature', 'nonRepudiation', 'keyEncipherment']); |
|
543 | - $csr->setExtension('id-ce-extKeyUsage', ['id-kp-clientAuth']); |
|
544 | - $csr->setExtension('id-ce-basicConstraints', ['cA' => false], false); |
|
545 | - $x509->setEndDate('+' . \config\Master::MANAGEDSP['daystoexpiry'] . ' days'); |
|
546 | - $this->setTLSSerialNumber(999999999999999999); |
|
547 | - $x509->setSerialNumber($this->radsec_cert_serial_no, 10); |
|
548 | - $cert = $x509->loadX509($x509->saveX509($x509->sign($ca, $csr))); |
|
549 | - $this->radsec_cert = $x509->saveX509($cert); |
|
550 | - $this->radsec_priv = NULL; |
|
551 | - //$futureTlsClient = $this->createTLScredentials(); |
|
552 | - $this->databaseHandle->exec("UPDATE deployment SET radsec_priv = NULL, radsec_cert = ?, radsec_cert_serial_number = ? WHERE deployment_id = ?", "sii", $this->radsec_cert, $this->radsec_cert_serial_no, $id); |
|
521 | + $id = $this->identifier; |
|
522 | + $dn = array(); |
|
523 | + $dn['rdnSequence'] = array(); |
|
524 | + $dn['rdnSequence'][0] = array(); |
|
525 | + $dn['rdnSequence'][0][] = array('type' => 'id-at-organizationName', 'value' => array()); |
|
526 | + $dn['rdnSequence'][0][0]['value']['utf8String'] = 'eduroam'; |
|
527 | + $dn['rdnSequence'][1] = array(); |
|
528 | + $dn['rdnSequence'][1][] = array('type' => 'id-at-organizationalUnitName', 'value' => array()); |
|
529 | + $dn['rdnSequence'][1][0]['value']['utf8String'] = 'eduroam Managed SP'; |
|
530 | + $dn['rdnSequence'][2] = array(); |
|
531 | + $dn['rdnSequence'][2][] = array('type' => 'id-at-commonName', 'value' => array()); |
|
532 | + $dn['rdnSequence'][2][0]['value']['utf8String'] = 'SP' . $this->identifier . "-" . $this->institution; |
|
533 | + $csr->setDN($dn); |
|
534 | + $pemcakey = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"); |
|
535 | + $cakey = \phpseclib3\Crypt\PublicKeyLoader::loadPrivateKey($pemcakey, \config\Master::MANAGEDSP['capass'] ); |
|
536 | + $pemca = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
537 | + $ca = new \phpseclib3\File\X509(); |
|
538 | + $ca->loadX509($pemca); |
|
539 | + $ca->setPrivateKey($cakey); |
|
540 | + // Sign the updated request, producing the certificate. |
|
541 | + $x509 = new \phpseclib3\File\X509(); |
|
542 | + $csr->setExtension('id-ce-keyUsage', ['digitalSignature', 'nonRepudiation', 'keyEncipherment']); |
|
543 | + $csr->setExtension('id-ce-extKeyUsage', ['id-kp-clientAuth']); |
|
544 | + $csr->setExtension('id-ce-basicConstraints', ['cA' => false], false); |
|
545 | + $x509->setEndDate('+' . \config\Master::MANAGEDSP['daystoexpiry'] . ' days'); |
|
546 | + $this->setTLSSerialNumber(999999999999999999); |
|
547 | + $x509->setSerialNumber($this->radsec_cert_serial_no, 10); |
|
548 | + $cert = $x509->loadX509($x509->saveX509($x509->sign($ca, $csr))); |
|
549 | + $this->radsec_cert = $x509->saveX509($cert); |
|
550 | + $this->radsec_priv = NULL; |
|
551 | + //$futureTlsClient = $this->createTLScredentials(); |
|
552 | + $this->databaseHandle->exec("UPDATE deployment SET radsec_priv = NULL, radsec_cert = ?, radsec_cert_serial_number = ? WHERE deployment_id = ?", "sii", $this->radsec_cert, $this->radsec_cert_serial_no, $id); |
|
553 | 553 | } |
554 | 554 | /** |
555 | 555 | * marks the deployment as deactivated |
@@ -883,11 +883,11 @@ discard block |
||
883 | 883 | unlink("$zipdir/$key/detail.zip"); |
884 | 884 | $files = scandir("$zipdir/$key/"); |
885 | 885 | foreach($files as $file) { |
886 | - if ($file == '.' || $file == '..') continue; |
|
887 | - $data = file_get_contents("$zipdir/$key/$file"); |
|
888 | - $zipt->addFromString("radius-$key/$file", $data); |
|
889 | - $cnt += 1; |
|
890 | - unlink("$zipdir/$key/$file"); |
|
886 | + if ($file == '.' || $file == '..') continue; |
|
887 | + $data = file_get_contents("$zipdir/$key/$file"); |
|
888 | + $zipt->addFromString("radius-$key/$file", $data); |
|
889 | + $cnt += 1; |
|
890 | + unlink("$zipdir/$key/$file"); |
|
891 | 891 | } |
892 | 892 | if (file_exists("$zipdir/$key")) { |
893 | 893 | rmdir("$zipdir/$key"); |
@@ -883,7 +883,9 @@ |
||
883 | 883 | unlink("$zipdir/$key/detail.zip"); |
884 | 884 | $files = scandir("$zipdir/$key/"); |
885 | 885 | foreach($files as $file) { |
886 | - if ($file == '.' || $file == '..') continue; |
|
886 | + if ($file == '.' || $file == '..') { |
|
887 | + continue; |
|
888 | + } |
|
887 | 889 | $data = file_get_contents("$zipdir/$key/$file"); |
888 | 890 | $zipt->addFromString("radius-$key/$file", $data); |
889 | 891 | $cnt += 1; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id; |
338 | 338 | } |
339 | 339 | if ($clients > $maxSupportedClients * 0.9) { |
340 | - $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!"); |
|
340 | + $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!"); |
|
341 | 341 | } |
342 | 342 | } |
343 | 343 | if (count($serverCandidates) == 0 && $federation != "DEFAULT") { |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | * |
360 | 360 | * @throws Exception |
361 | 361 | */ |
362 | - private function setTLSSerialNumber($max=PHP_INT_MAX) { |
|
362 | + private function setTLSSerialNumber($max = PHP_INT_MAX) { |
|
363 | 363 | $nonDupSerialFound = FALSE; |
364 | 364 | do { |
365 | 365 | $serial = random_int(1000000000, $max); |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | */ |
380 | 380 | private function createTLScredentials() |
381 | 381 | { |
382 | - $clientName = 'SP' . $this->identifier . '-' . $this->institution; |
|
382 | + $clientName = 'SP'.$this->identifier.'-'.$this->institution; |
|
383 | 383 | $dn = array( |
384 | 384 | "organizationName" => "eduroam", |
385 | 385 | "organizationalUnitName" => "eduroam Managed SP", |
@@ -393,14 +393,14 @@ discard block |
||
393 | 393 | openssl_pkey_export($privkey, $this->radsec_priv); |
394 | 394 | // Generate a certificate signing request |
395 | 395 | $csr = openssl_csr_new($dn, $privkey, |
396 | - array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf")); |
|
396 | + array('digest_alg' => 'sha256', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf")); |
|
397 | 397 | // get CA certificate and private key |
398 | - $caprivkey = array(file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"), |
|
398 | + $caprivkey = array(file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.key"), |
|
399 | 399 | \config\Master::MANAGEDSP['capass']); |
400 | - $cacert = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
400 | + $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
401 | 401 | $this->setTLSSerialNumber(); |
402 | 402 | $clientcert = openssl_csr_sign($csr, $cacert, $caprivkey, \config\Master::MANAGEDSP['daystoexpiry'], |
403 | - array('digest_alg'=>'sha512', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), $this->radsec_cert_serial_no); |
|
403 | + array('digest_alg'=>'sha512', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf"), $this->radsec_cert_serial_no); |
|
404 | 404 | openssl_x509_export($clientcert, $this->radsec_cert); |
405 | 405 | } |
406 | 406 | /** |
@@ -425,8 +425,8 @@ discard block |
||
425 | 425 | $conditional1 = "AND activity_time > DATE_SUB(NOW(), INTERVAL $backlog SECOND )"; |
426 | 426 | $conditional2 = "DESC"; |
427 | 427 | } |
428 | - $client = 'SP' . $this->identifier . '-' . $this->institution; |
|
429 | - $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id, prot, outer_user FROM activity WHERE owner = ? $conditional1 ORDER BY activity_time $conditional2", "s", $client ); |
|
428 | + $client = 'SP'.$this->identifier.'-'.$this->institution; |
|
429 | + $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id, prot, outer_user FROM activity WHERE owner = ? $conditional1 ORDER BY activity_time $conditional2", "s", $client); |
|
430 | 430 | |
431 | 431 | return mysqli_fetch_all($stats, \MYSQLI_ASSOC); |
432 | 432 | } |
@@ -544,11 +544,11 @@ discard block |
||
544 | 544 | $dn['rdnSequence'][1][0]['value']['utf8String'] = 'eduroam Managed SP'; |
545 | 545 | $dn['rdnSequence'][2] = array(); |
546 | 546 | $dn['rdnSequence'][2][] = array('type' => 'id-at-commonName', 'value' => array()); |
547 | - $dn['rdnSequence'][2][0]['value']['utf8String'] = 'SP' . $this->identifier . "-" . $this->institution; |
|
547 | + $dn['rdnSequence'][2][0]['value']['utf8String'] = 'SP'.$this->identifier."-".$this->institution; |
|
548 | 548 | $csr->setDN($dn); |
549 | - $pemcakey = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"); |
|
550 | - $cakey = \phpseclib3\Crypt\PublicKeyLoader::loadPrivateKey($pemcakey, \config\Master::MANAGEDSP['capass'] ); |
|
551 | - $pemca = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
549 | + $pemcakey = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.key"); |
|
550 | + $cakey = \phpseclib3\Crypt\PublicKeyLoader::loadPrivateKey($pemcakey, \config\Master::MANAGEDSP['capass']); |
|
551 | + $pemca = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
552 | 552 | $ca = new \phpseclib3\File\X509(); |
553 | 553 | $ca->loadX509($pemca); |
554 | 554 | $ca->setPrivateKey($cakey); |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | $csr->setExtension('id-ce-keyUsage', ['digitalSignature', 'nonRepudiation', 'keyEncipherment']); |
558 | 558 | $csr->setExtension('id-ce-extKeyUsage', ['id-kp-clientAuth']); |
559 | 559 | $csr->setExtension('id-ce-basicConstraints', ['cA' => false], false); |
560 | - $x509->setEndDate('+' . \config\Master::MANAGEDSP['daystoexpiry'] . ' days'); |
|
560 | + $x509->setEndDate('+'.\config\Master::MANAGEDSP['daystoexpiry'].' days'); |
|
561 | 561 | $this->setTLSSerialNumber(999999999999999999); |
562 | 562 | $x509->setSerialNumber($this->radsec_cert_serial_no, 10); |
563 | 563 | $cert = $x509->loadX509($x509->saveX509($x509->sign($ca, $csr))); |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | { |
600 | 600 | $customAttrib = $this->getAttributes("managedsp:operatorname"); |
601 | 601 | if (count($customAttrib) == 0) { |
602 | - return "1sp." . $this->identifier . "-" . $this->institution . \config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
602 | + return "1sp.".$this->identifier."-".$this->institution.\config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
603 | 603 | } |
604 | 604 | return $customAttrib[0]["value"]; |
605 | 605 | } |
@@ -614,24 +614,24 @@ discard block |
||
614 | 614 | private function sendToRADIUS(int $idx, $post) |
615 | 615 | { |
616 | 616 | $hostname = "radius_hostname_$idx"; |
617 | - $p = "server$idx" . "_secret"; |
|
617 | + $p = "server$idx"."_secret"; |
|
618 | 618 | $key = $this->$p; |
619 | - $p = "server$idx" . "_iv"; |
|
619 | + $p = "server$idx"."_iv"; |
|
620 | 620 | $iv = $this->$p; |
621 | - $p = "server$idx" . "_token"; |
|
621 | + $p = "server$idx"."_token"; |
|
622 | 622 | $token = $this->$p; |
623 | - $encrypted = openssl_encrypt($post . "&token=$token", "CHACHA20", $key, 0, $iv); |
|
623 | + $encrypted = openssl_encrypt($post."&token=$token", "CHACHA20", $key, 0, $iv); |
|
624 | 624 | if ($encrypted !== false) { |
625 | - $post = "enc=". urlencode(base64_encode($encrypted)); |
|
625 | + $post = "enc=".urlencode(base64_encode($encrypted)); |
|
626 | 626 | } |
627 | - $ch = curl_init("http://" . $this->$hostname . ':' . \config\Master::MANAGEDSP['radiusconfigport']); |
|
627 | + $ch = curl_init("http://".$this->$hostname.':'.\config\Master::MANAGEDSP['radiusconfigport']); |
|
628 | 628 | if ($ch === FALSE) { |
629 | 629 | $res = 'FAILURE'; |
630 | 630 | } else { |
631 | 631 | curl_setopt($ch, CURLOPT_USERAGENT, "CAT-ManagedSP"); |
632 | 632 | curl_setopt($ch, CURLOPT_POST, 1); |
633 | 633 | curl_setopt($ch, CURLOPT_POSTFIELDS, $post); |
634 | - $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ':' . \config\Master::MANAGEDSP['radiusconfigport'] . "/$post\n"); |
|
634 | + $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.':'.\config\Master::MANAGEDSP['radiusconfigport']."/$post\n"); |
|
635 | 635 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
636 | 636 | curl_setopt($ch, CURLOPT_HEADER, 0); |
637 | 637 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
@@ -671,19 +671,19 @@ discard block |
||
671 | 671 | } else { |
672 | 672 | $txt = $remove ? _('Profile deactivation failed') : _('Profile activation/modification failed'); |
673 | 673 | } |
674 | - $txt = $txt . ' '; |
|
674 | + $txt = $txt.' '; |
|
675 | 675 | if (array_count_values($response)[$status] == 2) { |
676 | - $txt = $txt . _('on both RADIUS servers: primary and backup') . '.'; |
|
676 | + $txt = $txt._('on both RADIUS servers: primary and backup').'.'; |
|
677 | 677 | } else { |
678 | 678 | if ($response['res[1]'] == $status) { |
679 | - $txt = $txt . _('on primary RADIUS server') . '.'; |
|
679 | + $txt = $txt._('on primary RADIUS server').'.'; |
|
680 | 680 | } else { |
681 | - $txt = $txt . _('on backup RADIUS server') . '.'; |
|
681 | + $txt = $txt._('on backup RADIUS server').'.'; |
|
682 | 682 | } |
683 | 683 | } |
684 | 684 | $mail = \core\common\OutsideComm::mailHandle(); |
685 | 685 | $email = $this->getAttributes("support:email")[0]['value']; |
686 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System"; |
|
686 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System"; |
|
687 | 687 | $mail->addAddress($email); |
688 | 688 | if ($status == 'OK') { |
689 | 689 | $mail->Subject = _('RADIUS profile update problem fixed'); |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | return NULL; |
718 | 718 | } |
719 | 719 | $timeout = 10; |
720 | - curl_setopt($ch, CURLOPT_URL, 'http://' . $host); |
|
720 | + curl_setopt($ch, CURLOPT_URL, 'http://'.$host); |
|
721 | 721 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
722 | 722 | curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
723 | 723 | curl_exec($ch); |
@@ -811,52 +811,52 @@ discard block |
||
811 | 811 | { |
812 | 812 | $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => '')); |
813 | 813 | if ($torevoke != '') { |
814 | - $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . |
|
814 | + $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier. |
|
815 | 815 | "&torevoke=$torevoke"; |
816 | 816 | foreach (array_keys($toPost) as $key) { |
817 | 817 | $toPost[$key] = $toPostTemplate; |
818 | 818 | } |
819 | 819 | } else { |
820 | 820 | $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1; |
821 | - $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . |
|
822 | - '&secret=' . $this->secret . |
|
823 | - '&country=' . $this->getAttributes("internal:country")[0]['value'] . |
|
824 | - '&pskkey=' . $this->pskkey . '&'; |
|
821 | + $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier. |
|
822 | + '&secret='.$this->secret. |
|
823 | + '&country='.$this->getAttributes("internal:country")[0]['value']. |
|
824 | + '&pskkey='.$this->pskkey.'&'; |
|
825 | 825 | if ($remove) { |
826 | - $toPostTemplate = $toPostTemplate . 'remove=1&'; |
|
826 | + $toPostTemplate = $toPostTemplate.'remove=1&'; |
|
827 | 827 | } else { |
828 | - $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getOperatorName() . '&'; |
|
828 | + $toPostTemplate = $toPostTemplate.'operatorname='.$this->getOperatorName().'&'; |
|
829 | 829 | if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) { |
830 | 830 | $allRealms = $this->getAllRealms(); |
831 | 831 | if (!empty($allRealms)) { |
832 | - $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&'; |
|
833 | - $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&'; |
|
832 | + $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&'; |
|
833 | + $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&'; |
|
834 | 834 | } |
835 | 835 | } |
836 | 836 | if ($this->getAttributes("managedsp:guest_vlan")[0]['value'] ?? NULL) { |
837 | - $toPostTemplate = $toPostTemplate . 'guest_vlan=' . $this->getAttributes("managedsp:guest_vlan")[0]['value'] . '&'; |
|
837 | + $toPostTemplate = $toPostTemplate.'guest_vlan='.$this->getAttributes("managedsp:guest_vlan")[0]['value'].'&'; |
|
838 | 838 | } |
839 | 839 | } |
840 | 840 | foreach (array_keys($toPost) as $key) { |
841 | - $elem = 'port' . $key; |
|
842 | - $toPost[$key] = $toPostTemplate . 'port=' . $this->$elem; |
|
841 | + $elem = 'port'.$key; |
|
842 | + $toPost[$key] = $toPostTemplate.'port='.$this->$elem; |
|
843 | 843 | } |
844 | 844 | } |
845 | 845 | $response = array(); |
846 | 846 | foreach ($toPost as $key => $value) { |
847 | - $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n"); |
|
847 | + $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n"); |
|
848 | 848 | // temporarly one server $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
849 | 849 | /*if ($key == 2) { |
850 | 850 | $response['res[2]'] = 'OK'; |
851 | 851 | } else { */ |
852 | - $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
852 | + $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
853 | 853 | //} |
854 | 854 | } |
855 | 855 | if ($onlyone) { |
856 | - $response['res[' . ($onlyone == 1) ? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK; |
|
856 | + $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK; |
|
857 | 857 | } |
858 | 858 | foreach (array('OK', 'FAILURE') as $status) { |
859 | - if ( ( ($status == 'OK' && $notify) || ($status == 'FAILURE') ) && ( in_array($status, $response) ) ) { |
|
859 | + if ((($status == 'OK' && $notify) || ($status == 'FAILURE')) && (in_array($status, $response))) { |
|
860 | 860 | $this->sendMailtoAdmin($remove, $response, $status); |
861 | 861 | } |
862 | 862 | } |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | $randomiv = ""; |
876 | 876 | if ($logs) { |
877 | 877 | $randomiv = bin2hex(random_bytes(8)); |
878 | - $toPostTemplate = 'logid=DEBUG-' . $this->identifier . '-' .$this->institution . "&backlog=$logs&iv=$randomiv"; |
|
878 | + $toPostTemplate = 'logid=DEBUG-'.$this->identifier.'-'.$this->institution."&backlog=$logs&iv=$randomiv"; |
|
879 | 879 | foreach (array_keys($toPost) as $key) { |
880 | 880 | $toPost[$key] = $toPostTemplate; |
881 | 881 | } |
@@ -884,21 +884,21 @@ discard block |
||
884 | 884 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
885 | 885 | $zipdir = $tempdir['dir']; |
886 | 886 | foreach ($toPost as $key => $value) { |
887 | - $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n"); |
|
888 | - $p = "server$key" . "_secret"; |
|
887 | + $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n"); |
|
888 | + $p = "server$key"."_secret"; |
|
889 | 889 | $secret = $this->$p; |
890 | - $p = "server$key" . "_token"; |
|
890 | + $p = "server$key"."_token"; |
|
891 | 891 | $token = $this->$p; |
892 | - $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
892 | + $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
893 | 893 | $paths = []; |
894 | - if (substr($response['res[' . $key . ']'], 0, 8) == 'ZIPDATA:' && $randomiv != '') { |
|
895 | - $encrypted = substr($response['res[' . $key . ']'], 8); |
|
894 | + if (substr($response['res['.$key.']'], 0, 8) == 'ZIPDATA:' && $randomiv != '') { |
|
895 | + $encrypted = substr($response['res['.$key.']'], 8); |
|
896 | 896 | $data = openssl_decrypt($encrypted, "CHACHA20", $secret, 0, $randomiv); |
897 | 897 | if ($data !== false && substr($data, 0, strlen($token)) == $token) { |
898 | 898 | $data = substr($data, strlen($token)); |
899 | 899 | } |
900 | 900 | if (!file_exists("$zipdir/$key")) { |
901 | - mkdir("$zipdir/$key", 0755, true ); |
|
901 | + mkdir("$zipdir/$key", 0755, true); |
|
902 | 902 | } |
903 | 903 | $fileHandle = fopen("$zipdir/$key/detail.zip", "wb"); |
904 | 904 | fwrite($fileHandle, $data); |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | } |
907 | 907 | } |
908 | 908 | $zipt = new \ZipArchive; |
909 | - $zipt->open("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip', \ZipArchive::CREATE); |
|
909 | + $zipt->open("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip', \ZipArchive::CREATE); |
|
910 | 910 | $cnt = 0; |
911 | 911 | foreach ($toPost as $key => $value) { |
912 | 912 | if (file_exists("$zipdir/$key/detail.zip")) { |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | $zipf->close(); |
919 | 919 | unlink("$zipdir/$key/detail.zip"); |
920 | 920 | $files = scandir("$zipdir/$key/"); |
921 | - foreach($files as $file) { |
|
921 | + foreach ($files as $file) { |
|
922 | 922 | if ($file == '.' || $file == '..') continue; |
923 | 923 | $data = file_get_contents("$zipdir/$key/$file"); |
924 | 924 | $zipt->addFromString("radius-$key/$file", $data); |
@@ -934,14 +934,14 @@ discard block |
||
934 | 934 | $zipt->addEmptyDir('.'); |
935 | 935 | } |
936 | 936 | $zipt->close(); |
937 | - if (file_exists("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip')) { |
|
938 | - $data = file_get_contents("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip'); |
|
939 | - unlink("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip'); |
|
937 | + if (file_exists("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip')) { |
|
938 | + $data = file_get_contents("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip'); |
|
939 | + unlink("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip'); |
|
940 | 940 | rmdir($zipdir); |
941 | 941 | } |
942 | 942 | if ($data !== FALSE) { |
943 | 943 | header('Content-Type: application/zip'); |
944 | - header("Content-Disposition: attachment; filename=\"detail-".$this->identifier . '-' .$this->institution.".zip\""); |
|
944 | + header("Content-Disposition: attachment; filename=\"detail-".$this->identifier.'-'.$this->institution.".zip\""); |
|
945 | 945 | header("Content-Transfer-Encoding: binary"); |
946 | 946 | echo $data; |
947 | 947 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <?php |
29 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
29 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
30 | 30 | |
31 | 31 | $auth = new \web\lib\admin\Authentication(); |
32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | ?> |
93 | 93 | |
94 | 94 | <select name="INST-list" id="INST-list"> |
95 | - <option value=""><?php echo _('---PLEASE CHOOSE---');?></option> |
|
95 | + <option value=""><?php echo _('---PLEASE CHOOSE---'); ?></option> |
|
96 | 96 | <?php |
97 | 97 | $instdata = array(); |
98 | 98 | foreach ($extInsts as $iid => $oneInst) { |
99 | - print '<option value="' . $iid . '">' . $oneInst['name'] . '</option>'; |
|
99 | + print '<option value="'.$iid.'">'.$oneInst['name'].'</option>'; |
|
100 | 100 | $instdata[$iid] = array(); |
101 | 101 | $instdata[$iid]['name'] = $oneInst['name']; |
102 | 102 | $instdata[$iid]['type'] = _('no data'); |
@@ -110,22 +110,22 @@ discard block |
||
110 | 110 | $contactdata = ''; |
111 | 111 | foreach ($oneInst['contacts'] as $oneContact) { |
112 | 112 | if ($contactdata != '') { |
113 | - $contactdata = $contactdata . '<br>'; |
|
113 | + $contactdata = $contactdata.'<br>'; |
|
114 | 114 | } |
115 | 115 | if ($oneContact['name']) { |
116 | - $contactdata = $contactdata . $oneContact['name']; |
|
116 | + $contactdata = $contactdata.$oneContact['name']; |
|
117 | 117 | } |
118 | 118 | if ($contactdata != '') { |
119 | - $contactdata = $contactdata . '<br>'; |
|
119 | + $contactdata = $contactdata.'<br>'; |
|
120 | 120 | } |
121 | 121 | if ($oneContact['mail']) { |
122 | - $contactdata = $contactdata . $oneContact['mail']; |
|
122 | + $contactdata = $contactdata.$oneContact['mail']; |
|
123 | 123 | } |
124 | 124 | if ($contactdata != '') { |
125 | - $contactdata = $contactdata . '<br>'; |
|
125 | + $contactdata = $contactdata.'<br>'; |
|
126 | 126 | } |
127 | 127 | if ($oneContact['phone']) { |
128 | - $contactdata = $contactdata . $oneContact['phone']; |
|
128 | + $contactdata = $contactdata.$oneContact['phone']; |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | if ($contactdata == '') { |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | var instts = []; |
145 | 145 | <?php |
146 | 146 | foreach (array_keys($instdata) as $iid) { |
147 | - echo "instservers['" . $iid . "']='" . $instdata[$iid]['servers']. "';\n"; |
|
148 | - echo "instname['" . $iid . "']='" . $instdata[$iid]['name']. "';\n"; |
|
149 | - echo "insttype['" . $iid . "']='" . $instdata[$iid]['type']. "';\n"; |
|
150 | - echo "instcontact['" . $iid . "']='" . $instdata[$iid]['contacts']. "';\n"; |
|
151 | - echo "instts['" . $iid . "']='" . $instdata[$iid]['ts']. "';\n"; |
|
147 | + echo "instservers['".$iid."']='".$instdata[$iid]['servers']."';\n"; |
|
148 | + echo "instname['".$iid."']='".$instdata[$iid]['name']."';\n"; |
|
149 | + echo "insttype['".$iid."']='".$instdata[$iid]['type']."';\n"; |
|
150 | + echo "instcontact['".$iid."']='".$instdata[$iid]['contacts']."';\n"; |
|
151 | + echo "instts['".$iid."']='".$instdata[$iid]['ts']."';\n"; |
|
152 | 152 | } |
153 | 153 | ?> |
154 | 154 | $(document).ready(function(){ |
@@ -170,18 +170,18 @@ discard block |
||
170 | 170 | <div id="instdata_area"> |
171 | 171 | <table> |
172 | 172 | <tr><th align="left" width="350"> |
173 | - <?php echo _('Name');?> |
|
173 | + <?php echo _('Name'); ?> |
|
174 | 174 | </th><th align="left" width="100"> |
175 | - <?php echo _('Type');?> |
|
175 | + <?php echo _('Type'); ?> |
|
176 | 176 | </th> |
177 | 177 | <th align="left" width="200"> |
178 | - <?php echo _('Servers');?> |
|
178 | + <?php echo _('Servers'); ?> |
|
179 | 179 | </th> |
180 | 180 | <th align="left" width="200"> |
181 | - <?php echo _('Contact data');?> |
|
181 | + <?php echo _('Contact data'); ?> |
|
182 | 182 | </th> |
183 | 183 | <th align="left" width="100"> |
184 | - <?php echo _('Timestamp');?> |
|
184 | + <?php echo _('Timestamp'); ?> |
|
185 | 185 | </th> |
186 | 186 | </tr> |
187 | 187 | <tr id="toshow"></tr> |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <?php |
29 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
29 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
30 | 30 | |
31 | 31 | $auth = new \web\lib\admin\Authentication(); |
32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $feds = $user->getAttributes("user:fedadmin"); |
71 | 71 | foreach ($feds as $oneFed) { |
72 | 72 | $theFed = new \core\Federation($oneFed['value']); |
73 | - printf("<h2>" . _("Certificate Information for %s %s")."</h2>", $uiElements->nomenclatureFed, $theFed->name); |
|
73 | + printf("<h2>"._("Certificate Information for %s %s")."</h2>", $uiElements->nomenclatureFed, $theFed->name); |
|
74 | 74 | foreach ($theFed->listTlsCertificates() as $oneCert) { |
75 | 75 | if ($oneCert['STATUS'] == "REQUESTED") { |
76 | 76 | $theFed->updateCertificateStatus($oneCert['REQSERIAL']); |
@@ -81,13 +81,13 @@ discard block |
||
81 | 81 | foreach ($theFed->listTlsCertificates() as $oneCert) { // fetch list a second time, in case we got a cert |
82 | 82 | $status = $oneCert['STATUS']; |
83 | 83 | echo "<tr>"; |
84 | - echo "<td>" . $oneCert['REQSERIAL'] . "</td><td>" . $oneCert['DN'] . "</td><td>" . $status . "</td><td>" . $oneCert['EXPIRY'] . "</td>"; |
|
84 | + echo "<td>".$oneCert['REQSERIAL']."</td><td>".$oneCert['DN']."</td><td>".$status."</td><td>".$oneCert['EXPIRY']."</td>"; |
|
85 | 85 | if ($status == "ISSUED") { |
86 | 86 | ?> |
87 | 87 | <td> |
88 | 88 | <form action='inc/showCert.inc.php' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8' method="POST"> |
89 | - <input type="hidden" name="certdata" value="<?php echo $oneCert['CERT'];?>"/> |
|
90 | - <button type="submit"><?php echo _("Display");?></button> |
|
89 | + <input type="hidden" name="certdata" value="<?php echo $oneCert['CERT']; ?>"/> |
|
90 | + <button type="submit"><?php echo _("Display"); ?></button> |
|
91 | 91 | </form> |
92 | 92 | <td> |
93 | 93 | <?php |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $deployment = $validator->existingDeploymentManaged($_GET['deployment_id'], $inst); |
21 | 21 | $format = ''; |
22 | 22 | if (isset($_GET['as']) && $_GET['as']=='csv') { |
23 | - $format = 'csv'; |
|
23 | + $format = 'csv'; |
|
24 | 24 | } |
25 | 25 | if (!isset($_POST['stats'])) { |
26 | 26 | $backlog = $_GET['backlog']; |
@@ -47,25 +47,25 @@ discard block |
||
47 | 47 | |
48 | 48 | $userAuthData = $deployment->retrieveStatistics($backlogTime); |
49 | 49 | if ($format == 'csv') { |
50 | - header('Content-Type: text/csv'); |
|
50 | + header('Content-Type: text/csv'); |
|
51 | 51 | header('Content-Disposition: attachment; filename="backlog_'.$deployment->identifier.'_'.$backlog.'.csv"'); |
52 | - $fp = fopen('php://output', 'w'); |
|
53 | - fputcsv($fp, [_("Timestamp (UTC)"), _("Outer-Identity"), _("Result"), _("MAC Address"), |
|
54 | - _("Chargeable-User-Identity"), _("AP Identifier"), _("Protocol")], ';', '"', ''); |
|
55 | - foreach ($userAuthData as $oneRecord) { |
|
56 | - fputcsv($fp, [$oneRecord['activity_time'], $oneRecord['outer_user'], |
|
57 | - ($oneRecord['result'] == "OK" ? _("Success") : _("Failure")), |
|
58 | - $oneRecord['mac'], $oneRecord['cui'], |
|
59 | - $oneRecord['ap_id'], $oneRecord['prot']], ';', '"', ''); |
|
52 | + $fp = fopen('php://output', 'w'); |
|
53 | + fputcsv($fp, [_("Timestamp (UTC)"), _("Outer-Identity"), _("Result"), _("MAC Address"), |
|
54 | + _("Chargeable-User-Identity"), _("AP Identifier"), _("Protocol")], ';', '"', ''); |
|
55 | + foreach ($userAuthData as $oneRecord) { |
|
56 | + fputcsv($fp, [$oneRecord['activity_time'], $oneRecord['outer_user'], |
|
57 | + ($oneRecord['result'] == "OK" ? _("Success") : _("Failure")), |
|
58 | + $oneRecord['mac'], $oneRecord['cui'], |
|
59 | + $oneRecord['ap_id'], $oneRecord['prot']], ';', '"', ''); |
|
60 | 60 | } |
61 | - fclose($fp); |
|
61 | + fclose($fp); |
|
62 | 62 | } else { |
63 | 63 | ?> |
64 | 64 | |
65 | 65 | <h1><?php $tablecaption = _("Deployment Usage Records"); echo $tablecaption; ?></h1> |
66 | 66 | <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)"); |
67 | - echo _("Protocol is a protocol used between a client and RADIUS server, for TLS it is a /-separated tuple TLS/TLS-Client-Cert-Serial"); |
|
68 | - ?></p> |
|
67 | + echo _("Protocol is a protocol used between a client and RADIUS server, for TLS it is a /-separated tuple TLS/TLS-Client-Cert-Serial"); |
|
68 | + ?></p> |
|
69 | 69 | <table class='authrecord'> |
70 | 70 | <caption><?php echo $tablecaption;?></caption> |
71 | 71 | <tr> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * ****************************************************************************** |
10 | 10 | */ |
11 | 11 | |
12 | -require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php"; |
|
12 | +require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php"; |
|
13 | 13 | $auth = new \web\lib\admin\Authentication(); |
14 | 14 | $auth->authenticate(); |
15 | 15 | $languageInstance = new \core\common\Language(); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | if ($editMode == 'fullaccess') { |
20 | 20 | $deployment = $validator->existingDeploymentManaged($_GET['deployment_id'], $inst); |
21 | 21 | $format = ''; |
22 | - if (isset($_GET['as']) && $_GET['as']=='csv') { |
|
22 | + if (isset($_GET['as']) && $_GET['as'] == 'csv') { |
|
23 | 23 | $format = 'csv'; |
24 | 24 | } |
25 | 25 | if (!isset($_POST['stats'])) { |
@@ -67,19 +67,19 @@ discard block |
||
67 | 67 | echo _("Protocol is a protocol used between a client and RADIUS server, for TLS it is a /-separated tuple TLS/TLS-Client-Cert-Serial"); |
68 | 68 | ?></p> |
69 | 69 | <table class='authrecord'> |
70 | - <caption><?php echo $tablecaption;?></caption> |
|
70 | + <caption><?php echo $tablecaption; ?></caption> |
|
71 | 71 | <tr> |
72 | - <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th> |
|
73 | - <th scope="col"><strong><?php echo _("Outer-Identity");?></strong></th> |
|
74 | - <th scope="col"><strong><?php echo _("Result");?></strong></th> |
|
75 | - <th scope="col"><strong><?php echo _("MAC Address");?></strong></th> |
|
76 | - <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th> |
|
77 | - <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th> |
|
78 | - <th scope="col"><strong><?php echo _("Protocol");?></strong></th> |
|
72 | + <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th> |
|
73 | + <th scope="col"><strong><?php echo _("Outer-Identity"); ?></strong></th> |
|
74 | + <th scope="col"><strong><?php echo _("Result"); ?></strong></th> |
|
75 | + <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th> |
|
76 | + <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th> |
|
77 | + <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th> |
|
78 | + <th scope="col"><strong><?php echo _("Protocol"); ?></strong></th> |
|
79 | 79 | </tr> |
80 | 80 | <?php |
81 | 81 | foreach ($userAuthData as $oneRecord) { |
82 | - echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>" |
|
82 | + echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>" |
|
83 | 83 | . "<td>".$oneRecord['activity_time']."</td>" |
84 | 84 | // $oneRecord['CN'] is a simple string, not an array, so disable Scrutinizer type check here |
85 | 85 | . "<td>".$oneRecord['outer_user']."</td>" |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | * <base_url>/copyright.php after deploying the software |
21 | 21 | * */ |
22 | 22 | |
23 | - /** |
|
24 | - * This file is used to display a deployment. |
|
25 | - * |
|
26 | - * @author Maja Gorecka-Wolniewicz <[email protected]> |
|
27 | - */ |
|
23 | + /** |
|
24 | + * This file is used to display a deployment. |
|
25 | + * |
|
26 | + * @author Maja Gorecka-Wolniewicz <[email protected]> |
|
27 | + */ |
|
28 | 28 | ?> |
29 | 29 | <?php |
30 | 30 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | if ($deploymentObject->radsec_cert != NULL) { |
343 | 343 | echo "<i>"; |
344 | 344 | echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials') . '<br>' . |
345 | - _('click on "Renew RADIUS over TLS credentials" button') . '<br>'; |
|
345 | + _('click on "Renew RADIUS over TLS credentials" button') . '<br>'; |
|
346 | 346 | |
347 | 347 | echo '<br/>' . _('You can upload your own CSR to replace default TLS credentials.') . '<br>' . |
348 | 348 | _('Click on "Upload CSR to sign my own TLS credentials"'); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | <td> |
362 | 362 | <?php printf(_("PSK Identity: %s"), "<span id='pskid_data_$depId'>SP".$depId.'-'.$deploymentObject->institution.'</span>'); |
363 | 363 | echo copyIcon("pskid_icon_$depId"); |
364 | - ?> |
|
364 | + ?> |
|
365 | 365 | <br> |
366 | 366 | <?php printf(_("PSK hexphrase: %s"), "<span id='pskkey_data_$depId'>".$deploymentObject->pskkey."</span>"); |
367 | 367 | echo copyIcon("pskkey_icon_$depId"); |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | <h1><?php echo $tablecaption; ?></h1> |
565 | 565 | <h2><?php echo _("5 most recent authentications");?></h2> |
566 | 566 | <p><?php echo _("<b>AP Identifier</b> is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id") .'<br>'; |
567 | - echo _("<b>Protocol</b> is a protocol used between a client and RADIUS server, for TLS it is a /-separated tuple TLS/<i>TLS-Client-Cert-Serial</i>"); ?></p> |
|
567 | + echo _("<b>Protocol</b> is a protocol used between a client and RADIUS server, for TLS it is a /-separated tuple TLS/<i>TLS-Client-Cert-Serial</i>"); ?></p> |
|
568 | 568 | <table class='authrecord'> |
569 | 569 | <caption><?php echo $tablecaption;?></caption> |
570 | 570 | <tr style='text-align: left;'> |
@@ -585,9 +585,9 @@ discard block |
||
585 | 585 | . "<td>".$oneRecord['outer_user']."</td>" |
586 | 586 | . "<td>".($oneRecord['result'] == "OK" ? _("Success") : _("Failure"))."</td>" |
587 | 587 | . "<td>".$oneRecord['mac']."</td>" |
588 | - . "<td>".substr($oneRecord['cui'], 0, 18) |
|
589 | - . ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") |
|
590 | - . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>" |
|
588 | + . "<td>".substr($oneRecord['cui'], 0, 18) |
|
589 | + . ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") |
|
590 | + . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>" |
|
591 | 591 | . "<td>".$oneRecord['ap_id']."</td>" |
592 | 592 | . "<td>".$oneRecord['prot']."</td>" |
593 | 593 | . "</tr>"; |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | $query = 'inc/deploymentLogs.inc.php?inst_id='.$deploymentObject->institution."&deployment_id=$depId&backlog="; |
628 | 628 | ?></h2> |
629 | 629 | <?php echo _('You will receive zip file with logs from both RADIUS servers: primary (folder named radius-1) and secondary (folder named radius-2).') . '<br>' . |
630 | - _('If no logs are available an empty zip file is provided.');?> |
|
630 | + _('If no logs are available an empty zip file is provided.');?> |
|
631 | 631 | <div style='height:3px'></div> |
632 | 632 | <button name="logs" type="button" onclick="location.href='<?php echo $query;?>1';"><?php echo _('Today');?> |
633 | 633 | </button> |
@@ -659,9 +659,9 @@ discard block |
||
659 | 659 | foreach (array($dsp->host1_v4, $dsp->host2_v4) as $host) { |
660 | 660 | $connection = @fsockopen($host, \config\Master::MANAGEDSP['radiusconfigport']); |
661 | 661 | if (is_resource($connection)) { |
662 | - fclose($connection); |
|
662 | + fclose($connection); |
|
663 | 663 | } else { |
664 | - return false; |
|
664 | + return false; |
|
665 | 665 | } |
666 | 666 | } |
667 | 667 | return true; |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | </button> |
684 | 684 | <span style='color: red;'> |
685 | 685 | <?php if ($hasMail == 0) { |
686 | - echo _("Helpdesk mail address is required but missing!"); |
|
686 | + echo _("Helpdesk mail address is required but missing!"); |
|
687 | 687 | } |
688 | 688 | ?> |
689 | 689 | </span> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | <?php |
97 | 97 | function copyIcon($target) { |
98 | - return '<img class="copy_link" id="'.$target.'" src="../resources/images/icons/Tabler/copy.svg" title="'. _("Copy to clipboard").'" >'; |
|
98 | + return '<img class="copy_link" id="'.$target.'" src="../resources/images/icons/Tabler/copy.svg" title="'._("Copy to clipboard").'" >'; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @param \core\DeploymentManaged $deploymentObject the deployment to work with |
105 | 105 | * @throws Exception |
106 | 106 | */ |
107 | -function displayDeploymentPropertyWidget(&$deploymentObject, $errormsg=[]) { |
|
107 | +function displayDeploymentPropertyWidget(&$deploymentObject, $errormsg = []) { |
|
108 | 108 | // RADIUS status icons |
109 | 109 | $depId = $deploymentObject->identifier; |
110 | 110 | $radiusMessages = [ |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $radius_status = array(); |
115 | 115 | $radius_status[0] = $deploymentObject->radius_status_1; |
116 | 116 | $radius_status[1] = $deploymentObject->radius_status_2; |
117 | - $cacert = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
117 | + $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
118 | 118 | $retry = $deploymentObject->checkRADIUSHostandConfigDaemon(); |
119 | 119 | $isradiusready = radius_ready($deploymentObject); |
120 | 120 | if (is_array($retry)) { |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | } |
127 | 127 | ?> |
128 | 128 | <div style='display: table-row_id;'> |
129 | - <div class='profilebox' id="profilebox_<?php echo $depId;?>" style='display: table-cell;'> |
|
129 | + <div class='profilebox' id="profilebox_<?php echo $depId; ?>" style='display: table-cell;'> |
|
130 | 130 | <h2><?php |
131 | 131 | switch ($deploymentObject->consortium) { |
132 | 132 | case "eduroam": |
133 | - $displayname = config\ConfAssistant::CONSORTIUM['name'] . " " . core\DeploymentManaged::PRODUCTNAME. ": SP$depId-".$deploymentObject->institution; |
|
133 | + $displayname = config\ConfAssistant::CONSORTIUM['name']." ".core\DeploymentManaged::PRODUCTNAME.": SP$depId-".$deploymentObject->institution; |
|
134 | 134 | break; |
135 | 135 | case "OpenRoaming": |
136 | 136 | $displayname = "OpenRoaming ANP"; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | default: |
139 | 139 | throw new Exception("We are supposed to operate on a roaming consortium we don't know."); |
140 | 140 | } |
141 | - echo $displayname . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)"; |
|
141 | + echo $displayname." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)"; |
|
142 | 142 | ?></h2> |
143 | 143 | <table class="deployments"> |
144 | 144 | <caption><?php echo _("Deployment Details"); ?></caption> |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | <td> |
172 | 172 | <?php |
173 | 173 | if ($deploymentObject->status) { |
174 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] . |
|
175 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . |
|
176 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>"; |
|
174 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon']. |
|
175 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text']. |
|
176 | + "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>"; |
|
177 | 177 | } |
178 | 178 | ?> |
179 | 179 | </td> |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | <td> |
204 | 204 | <?php |
205 | 205 | if ($deploymentObject->status && $deploymentObject->radius_status_2) { |
206 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] . |
|
207 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . |
|
208 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>"; |
|
206 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon']. |
|
207 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text']. |
|
208 | + "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>"; |
|
209 | 209 | } |
210 | 210 | ?> |
211 | 211 | </td> |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | <tr style="vertical-align:bottom"> |
214 | 214 | <td><?php echo _("RADIUS shared secret for both servers"); ?></td> |
215 | 215 | <td> |
216 | - <span id="shared_data_<?php echo $deploymentObject->identifier;?>"><?php echo $deploymentObject->secret;?></span> |
|
216 | + <span id="shared_data_<?php echo $deploymentObject->identifier; ?>"><?php echo $deploymentObject->secret; ?></span> |
|
217 | 217 | <?php echo copyIcon("shared_icon_".$deploymentObject->identifier) ?> |
218 | 218 | </td> |
219 | 219 | <td></td> |
@@ -249,9 +249,9 @@ discard block |
||
249 | 249 | <td> |
250 | 250 | <?php |
251 | 251 | if ($deploymentObject->status) { |
252 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] . |
|
253 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . |
|
254 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>"; |
|
252 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon']. |
|
253 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text']. |
|
254 | + "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>"; |
|
255 | 255 | } |
256 | 256 | ?> |
257 | 257 | </td> |
@@ -281,9 +281,9 @@ discard block |
||
281 | 281 | <td> |
282 | 282 | <?php |
283 | 283 | if ($deploymentObject->status && $deploymentObject->radius_status_2) { |
284 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] . |
|
285 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . |
|
286 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>"; |
|
284 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon']. |
|
285 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text']. |
|
286 | + "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>"; |
|
287 | 287 | } |
288 | 288 | ?> |
289 | 289 | </td> |
@@ -299,27 +299,27 @@ discard block |
||
299 | 299 | <td> |
300 | 300 | <?php |
301 | 301 | if ($deploymentObject->radsec_priv == '') { |
302 | - echo _('The client certificate was created using an uploaded CSR, the private key is not available') . '<br><br>'; |
|
302 | + echo _('The client certificate was created using an uploaded CSR, the private key is not available').'<br><br>'; |
|
303 | 303 | } |
304 | - echo _('Subject:') . ' ' . $data['name'] . '<br>'; |
|
305 | - echo _('Serial number:') . ' ' . $data['serialNumberHex'] . '<br>'; |
|
306 | - $dleft = floor(($data['validTo_time_t']-time())/(24*60*60)); |
|
304 | + echo _('Subject:').' '.$data['name'].'<br>'; |
|
305 | + echo _('Serial number:').' '.$data['serialNumberHex'].'<br>'; |
|
306 | + $dleft = floor(($data['validTo_time_t'] - time()) / (24 * 60 * 60)); |
|
307 | 307 | if ($dleft < 30) { |
308 | 308 | echo '<font color="red">'; |
309 | 309 | } |
310 | - echo _('Not valid after:') . ' '. date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s') . ' UTC'; |
|
310 | + echo _('Not valid after:').' '.date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s').' UTC'; |
|
311 | 311 | if ($dleft > 2) { |
312 | - echo '<br>' . _('Number of days to expiry:') . ' ' . $dleft; |
|
312 | + echo '<br>'._('Number of days to expiry:').' '.$dleft; |
|
313 | 313 | } else { |
314 | - echo '<br>' . _('If you are using RADIUS over TLS you should urgently renew your credentials') . '!'; |
|
314 | + echo '<br>'._('If you are using RADIUS over TLS you should urgently renew your credentials').'!'; |
|
315 | 315 | } |
316 | 316 | if ($dleft < 30) { echo '</font>'; } |
317 | 317 | ?></td> |
318 | 318 | </tr><tr><td></td> |
319 | 319 | |
320 | 320 | <td> |
321 | - <span style="display: none;" id="cert_data_<?php echo $depId;?>"><?php echo $deploymentObject->radsec_cert;?></span> |
|
322 | - <span style="display: none;" id="ca_cert_data_<?php echo $depId;?>"><?php echo $cacert;?></span> |
|
321 | + <span style="display: none;" id="cert_data_<?php echo $depId; ?>"><?php echo $deploymentObject->radsec_cert; ?></span> |
|
322 | + <span style="display: none;" id="ca_cert_data_<?php echo $depId; ?>"><?php echo $cacert; ?></span> |
|
323 | 323 | <?php if ($deploymentObject->radsec_priv != '') { |
324 | 324 | echo _("private key").copyIcon("priv_key_icon_$depId")." "; |
325 | 325 | echo '<span style="display: none;" id="priv_key_data_'.$depId.'">'.$deploymentObject->radsec_priv.'</span>'; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | echo _("CA certificate").copyIcon("ca_cert_icon_$depId"); |
331 | 331 | ?> |
332 | 332 | <br/> |
333 | - <button name="sendzip" onclick="location.href='inc/sendZip.inc.php?inst_id=<?php echo $deploymentObject->institution;?>&dep_id=<?php echo $depId?>'" type="button"><?php echo _('download ZIP-file with full data');?></button> |
|
333 | + <button name="sendzip" onclick="location.href='inc/sendZip.inc.php?inst_id=<?php echo $deploymentObject->institution; ?>&dep_id=<?php echo $depId?>'" type="button"><?php echo _('download ZIP-file with full data'); ?></button> |
|
334 | 334 | |
335 | 335 | </td> |
336 | 336 | <td></td> |
@@ -341,10 +341,10 @@ discard block |
||
341 | 341 | <?php |
342 | 342 | if ($deploymentObject->radsec_cert != NULL) { |
343 | 343 | echo "<i>"; |
344 | - echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials') . '<br>' . |
|
345 | - _('click on "Renew RADIUS over TLS credentials" button') . '<br>'; |
|
344 | + echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials').'<br>'. |
|
345 | + _('click on "Renew RADIUS over TLS credentials" button').'<br>'; |
|
346 | 346 | |
347 | - echo '<br/>' . _('You can upload your own CSR to replace default TLS credentials.') . '<br>' . |
|
347 | + echo '<br/>'._('You can upload your own CSR to replace default TLS credentials.').'<br>'. |
|
348 | 348 | _('Click on "Upload CSR to sign my own TLS credentials"'); |
349 | 349 | echo "</i>"; |
350 | 350 | } |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | |
380 | 380 | ?> |
381 | 381 | <tr></tr> |
382 | - <tr><th colspan="2"><?php echo _('Additional deployment settings');?></th></tr> |
|
382 | + <tr><th colspan="2"><?php echo _('Additional deployment settings'); ?></th></tr> |
|
383 | 383 | <tr> |
384 | 384 | <td> |
385 | 385 | <?php |
@@ -459,12 +459,12 @@ discard block |
||
459 | 459 | if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) { |
460 | 460 | echo '<br>'; |
461 | 461 | if ($res['FAILURE'] == 2) { |
462 | - echo ' <span style="color: red;">' . _("Activation failure.") . '</span>'; |
|
462 | + echo ' <span style="color: red;">'._("Activation failure.").'</span>'; |
|
463 | 463 | } else { |
464 | 464 | if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') { |
465 | - echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>'; |
|
465 | + echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>'; |
|
466 | 466 | } else { |
467 | - echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>'; |
|
467 | + echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>'; |
|
468 | 468 | } |
469 | 469 | } |
470 | 470 | } |
@@ -491,12 +491,12 @@ discard block |
||
491 | 491 | if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) { |
492 | 492 | echo '<br>'; |
493 | 493 | if ($res['FAILURE'] == 2) { |
494 | - echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>'; |
|
494 | + echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>'; |
|
495 | 495 | } else { |
496 | 496 | if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') { |
497 | - echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>'; |
|
497 | + echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>'; |
|
498 | 498 | } else { |
499 | - echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>'; |
|
499 | + echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>'; |
|
500 | 500 | } |
501 | 501 | } |
502 | 502 | } |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | </div> |
545 | 545 | <?php |
546 | 546 | if (!$isradiusready) { |
547 | - echo '<p>'. _("We are not able to handle a new configuration request requiring contact with RADIUS servers now.") . '<br>' . _("Check later."); |
|
547 | + echo '<p>'._("We are not able to handle a new configuration request requiring contact with RADIUS servers now.").'<br>'._("Check later."); |
|
548 | 548 | |
549 | 549 | } |
550 | 550 | if (count($errormsg) > 0 && array_key_exists($deploymentObject->identifier, $errormsg)) { |
@@ -560,38 +560,38 @@ discard block |
||
560 | 560 | </div> |
561 | 561 | <div style='width:20px;'></div> <!-- QR code space, reserved --> |
562 | 562 | <div style='display: table-cell; min-width:200px;'> |
563 | - <?php $tablecaption = _("Hotspot Usage Statistics");?> |
|
563 | + <?php $tablecaption = _("Hotspot Usage Statistics"); ?> |
|
564 | 564 | <h1><?php echo $tablecaption; ?></h1> |
565 | - <h2><?php echo _("5 most recent authentications");?></h2> |
|
566 | - <p><?php echo _("<b>AP Identifier</b> is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id") .'<br>'; |
|
565 | + <h2><?php echo _("5 most recent authentications"); ?></h2> |
|
566 | + <p><?php echo _("<b>AP Identifier</b> is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id").'<br>'; |
|
567 | 567 | echo _("<b>Protocol</b> is a protocol used between a client and RADIUS server, for TLS it is a /-separated tuple TLS/<i>TLS-Client-Cert-Serial</i>"); ?></p> |
568 | 568 | <table class='authrecord'> |
569 | - <caption><?php echo $tablecaption;?></caption> |
|
569 | + <caption><?php echo $tablecaption; ?></caption> |
|
570 | 570 | <tr style='text-align: left;'> |
571 | - <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th> |
|
572 | - <th scope="col"><strong><?php echo _("Outer-Identity");?></strong></th> |
|
573 | - <th scope="col"><strong><?php echo _("Result");?></strong></th> |
|
574 | - <th scope="col"><strong><?php echo _("MAC Address");?></strong></th> |
|
575 | - <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th> |
|
576 | - <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th> |
|
577 | - <th scope="col"><strong><?php echo _("Protocol");?></strong></th> |
|
571 | + <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th> |
|
572 | + <th scope="col"><strong><?php echo _("Outer-Identity"); ?></strong></th> |
|
573 | + <th scope="col"><strong><?php echo _("Result"); ?></strong></th> |
|
574 | + <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th> |
|
575 | + <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th> |
|
576 | + <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th> |
|
577 | + <th scope="col"><strong><?php echo _("Protocol"); ?></strong></th> |
|
578 | 578 | </tr> |
579 | 579 | <?php |
580 | - $userAuthData = $deploymentObject->retrieveStatistics(0,5); |
|
580 | + $userAuthData = $deploymentObject->retrieveStatistics(0, 5); |
|
581 | 581 | $i = 0; |
582 | 582 | foreach ($userAuthData as $oneRecord) { |
583 | - echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>" |
|
583 | + echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>" |
|
584 | 584 | . "<td>".$oneRecord['activity_time']."</td>" |
585 | 585 | . "<td>".$oneRecord['outer_user']."</td>" |
586 | 586 | . "<td>".($oneRecord['result'] == "OK" ? _("Success") : _("Failure"))."</td>" |
587 | 587 | . "<td>".$oneRecord['mac']."</td>" |
588 | 588 | . "<td>".substr($oneRecord['cui'], 0, 18) |
589 | - . ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") |
|
589 | + . ($oneRecord['cui'] == '' ? "" : "... ".copyIcon("cui_icon_".$deploymentObject->identifier."_$i") |
|
590 | 590 | . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>" |
591 | 591 | . "<td>".$oneRecord['ap_id']."</td>" |
592 | 592 | . "<td>".$oneRecord['prot']."</td>" |
593 | 593 | . "</tr>"; |
594 | - if ($oneRecord['cui']!='') { |
|
594 | + if ($oneRecord['cui'] != '') { |
|
595 | 595 | $i++; |
596 | 596 | } |
597 | 597 | } |
@@ -613,11 +613,11 @@ discard block |
||
613 | 613 | echo _('Get statistics as CSV file:').' '; |
614 | 614 | $query = 'inc/deploymentStats.inc.php?inst_id='.$deploymentObject->institution."&deployment_id=$depId&as=csv&backlog="; |
615 | 615 | ?> |
616 | - <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>WEEK';"><?php echo _('Last week');?> |
|
616 | + <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>WEEK';"><?php echo _('Last week'); ?> |
|
617 | 617 | </button> |
618 | - <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>MONTH';"><?php echo _('Last 30 days');?> |
|
618 | + <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>MONTH';"><?php echo _('Last 30 days'); ?> |
|
619 | 619 | </button> |
620 | - <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>FULL';"><?php echo _('Last 6 months');?> |
|
620 | + <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>FULL';"><?php echo _('Last 6 months'); ?> |
|
621 | 621 | </button> |
622 | 622 | </div><!-- statistics space --> |
623 | 623 | <div style='height:5px'></div> |
@@ -626,14 +626,14 @@ discard block |
||
626 | 626 | <h2><?php echo _('To get detailed logs from RADIUS sites click a button below.'); |
627 | 627 | $query = 'inc/deploymentLogs.inc.php?inst_id='.$deploymentObject->institution."&deployment_id=$depId&backlog="; |
628 | 628 | ?></h2> |
629 | - <?php echo _('You will receive zip file with logs from both RADIUS servers: primary (folder named radius-1) and secondary (folder named radius-2).') . '<br>' . |
|
630 | - _('If no logs are available an empty zip file is provided.');?> |
|
629 | + <?php echo _('You will receive zip file with logs from both RADIUS servers: primary (folder named radius-1) and secondary (folder named radius-2).').'<br>'. |
|
630 | + _('If no logs are available an empty zip file is provided.'); ?> |
|
631 | 631 | <div style='height:3px'></div> |
632 | - <button name="logs" type="button" onclick="location.href='<?php echo $query;?>1';"><?php echo _('Today');?> |
|
632 | + <button name="logs" type="button" onclick="location.href='<?php echo $query; ?>1';"><?php echo _('Today'); ?> |
|
633 | 633 | </button> |
634 | - <button name="logs" type="button" onclick="location.href='<?php echo $query;?>2';"><?php echo _('Last 2 days');?> |
|
634 | + <button name="logs" type="button" onclick="location.href='<?php echo $query; ?>2';"><?php echo _('Last 2 days'); ?> |
|
635 | 635 | </button> |
636 | - <button name="logs" type="button" onclick="location.href='<?php echo $query;?>7';"><?php echo _('Last 7 days');?> |
|
636 | + <button name="logs" type="button" onclick="location.href='<?php echo $query; ?>7';"><?php echo _('Last 7 days'); ?> |
|
637 | 637 | </button> |
638 | 638 | </div> |
639 | 639 | </div> |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | <div> |
682 | 682 | <input type="hidden" name="consortium" value="eduroam"/> |
683 | 683 | <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'> |
684 | - <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?> |
|
684 | + <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?> |
|
685 | 685 | </button> |
686 | 686 | <span style='color: red;'> |
687 | 687 | <?php if ($hasMail == 0) { |