@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * supported EAP types from the DB and stores them in the priv_ arrays. |
| 60 | 60 | * |
| 61 | 61 | * @param int $profileId identifier of the profile in the DB |
| 62 | - * @param IdP $idpObject optionally, the institution to which this Profile belongs. Saves the construction of the IdP instance. If omitted, an extra query and instantiation is executed to find out. |
|
| 62 | + * @param integer $idpObject optionally, the institution to which this Profile belongs. Saves the construction of the IdP instance. If omitted, an extra query and instantiation is executed to find out. |
|
| 63 | 63 | */ |
| 64 | 64 | public function __construct($profileId, $idpObject = 0) { |
| 65 | 65 | debug(3, "--- BEGIN Constructing new Profile object ... ---\n"); |
@@ -293,6 +293,8 @@ discard block |
||
| 293 | 293 | * |
| 294 | 294 | * @param string device the device identifier string |
| 295 | 295 | * @param string path the path where the new installer can be found |
| 296 | + * @param string $device |
|
| 297 | + * @param string $path |
|
| 296 | 298 | */ |
| 297 | 299 | public function updateCache($device, $path, $mime) { |
| 298 | 300 | $escapedDevice = DBConnection::escape_value($this->databaseType, $device); |
@@ -305,9 +307,9 @@ discard block |
||
| 305 | 307 | /** |
| 306 | 308 | * Log a new download for our stats |
| 307 | 309 | * |
| 308 | - * @param device the device id string |
|
| 309 | - * @param area either admin or user |
|
| 310 | - * @return TRUE if incrementing worked, FALSE if not |
|
| 310 | + * @param device string device id string |
|
| 311 | + * @param area string admin or user |
|
| 312 | + * @return boolean if incrementing worked, FALSE if not |
|
| 311 | 313 | */ |
| 312 | 314 | public function incrementDownloadStats($device, $area) { |
| 313 | 315 | $escapedDevice = DBConnection::escape_value($this->databaseType, $device); |
@@ -320,7 +322,7 @@ discard block |
||
| 320 | 322 | |
| 321 | 323 | /** |
| 322 | 324 | * Retrieve current download stats from database, either for one specific device or for all devices |
| 323 | - * @param string $device the device id string |
|
| 325 | + * @param integer $device the device id string |
|
| 324 | 326 | * @return mixed user downloads of this profile; if device is given, returns the counter as int, otherwise an array with devicename => counter |
| 325 | 327 | */ |
| 326 | 328 | public function getUserDownloadStats($device = 0) { |
@@ -353,7 +355,7 @@ discard block |
||
| 353 | 355 | * @param string $attrName name of the attribute to set |
| 354 | 356 | * @param string $attrValue value of the attribute to set |
| 355 | 357 | * @param int $eapType identifier of the EAP type in the database. 0 if the attribute is valid for all EAP types. |
| 356 | - * @param string $device identifier of the device in the databse. Omit the argument if attribute is valid for all devices. |
|
| 358 | + * @param integer $device identifier of the device in the databse. Omit the argument if attribute is valid for all devices. |
|
| 357 | 359 | */ |
| 358 | 360 | public function addAttribute($attrName, $attrValue, $eapType, $device = 0) { |
| 359 | 361 | $escapedAttrName = DBConnection::escape_value($this->databaseType, $attrName); |
@@ -463,7 +465,7 @@ discard block |
||
| 463 | 465 | /** Returns an array of the profile's attributes. |
| 464 | 466 | * |
| 465 | 467 | * @param string option_name the name of a specific option. If set, only returns option values for this option name |
| 466 | - * @param eapmethod the EAP type, in array ("OUTER/INNER") notation. If set, returns only attributes which are specific to that EAP type |
|
| 468 | + * @param eapmethod integer EAP type, in array ("OUTER/INNER") notation. If set, returns only attributes which are specific to that EAP type |
|
| 467 | 469 | * @param string device the device ID string. If set, returns only attributes which are specific to that device |
| 468 | 470 | * @return array attributes of the profile |
| 469 | 471 | */ |
@@ -557,7 +559,7 @@ discard block |
||
| 557 | 559 | /** |
| 558 | 560 | * list all devices marking their availabiblity and possible redirects |
| 559 | 561 | * |
| 560 | - * @param string $locale for text-based attributes, either returns values for the default value, or if specified here, in the locale specified |
|
| 562 | + * @param integer $locale for text-based attributes, either returns values for the default value, or if specified here, in the locale specified |
|
| 561 | 563 | * @return array of device ids display names and their status |
| 562 | 564 | */ |
| 563 | 565 | public function listDevices($locale = 0) { |
@@ -613,7 +615,7 @@ discard block |
||
| 613 | 615 | * as wel as the chosen language. |
| 614 | 616 | * can be called with an optional $eap argument |
| 615 | 617 | * |
| 616 | - * @param array $eap if specified, retrieves attributes specific to the given EAP type |
|
| 618 | + * @param integer $eap if specified, retrieves attributes specific to the given EAP type |
|
| 617 | 619 | * @return array list of attributes in collapsed style (index is the attrib name, value is an array of different values) |
| 618 | 620 | */ |
| 619 | 621 | public function getCollapsedAttributes($eap = 0) { |
@@ -134,14 +134,14 @@ |
||
| 134 | 134 | $localValueIfAny = (preg_match('/@/', $this->realm) ? substr($this->realm, 0, strpos($this->realm, '@')) : "anonymous" ); |
| 135 | 135 | |
| 136 | 136 | $internalAttributes = [ |
| 137 | - "internal:profile_count" => $idp->profileCount(), |
|
| 138 | - "internal:checkuser_outer" => $this->checkuser_outer, |
|
| 139 | - "internal:checkuser_value" => $this->checkuser_value, |
|
| 140 | - "internal:verify_userinput_suffix" => $this->verify, |
|
| 141 | - "internal:hint_userinput_suffix" => $this->hint, |
|
| 142 | - "internal:realm" => preg_replace('/^.*@/', '', $this->realm), |
|
| 143 | - "internal:use_anon_outer" => $this->use_anon_outer, |
|
| 144 | - "internal:anon_local_value" => $localValueIfAny, |
|
| 137 | + "internal:profile_count" => $idp->profileCount(), |
|
| 138 | + "internal:checkuser_outer" => $this->checkuser_outer, |
|
| 139 | + "internal:checkuser_value" => $this->checkuser_value, |
|
| 140 | + "internal:verify_userinput_suffix" => $this->verify, |
|
| 141 | + "internal:hint_userinput_suffix" => $this->hint, |
|
| 142 | + "internal:realm" => preg_replace('/^.*@/', '', $this->realm), |
|
| 143 | + "internal:use_anon_outer" => $this->use_anon_outer, |
|
| 144 | + "internal:anon_local_value" => $localValueIfAny, |
|
| 145 | 145 | ]; |
| 146 | 146 | |
| 147 | 147 | foreach ($internalAttributes as $attName => $attValue) { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $temparray[] = [ |
| 111 | 111 | "name" => $attributeQuery->option_name, |
| 112 | 112 | "value" => $attributeQuery->option_value, |
| 113 | - "level" => ($attributeQuery->device_id == NULL && $attributeQuery->method == 0 ? "Profile" : "Method" ), |
|
| 113 | + "level" => ($attributeQuery->device_id == NULL && $attributeQuery->method == 0 ? "Profile" : "Method"), |
|
| 114 | 114 | "row" => $attributeQuery->row, |
| 115 | 115 | "device" => $attributeQuery->device_id, |
| 116 | 116 | "flag" => $optinfo['flag'], |
@@ -120,8 +120,8 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | $temparray[] = [ |
| 122 | 122 | "name" => $attributeQuery->option_name, |
| 123 | - "value" => ( $decodedAttribute['lang'] == "" ? $decodedAttribute['content'] : serialize($decodedAttribute)), |
|
| 124 | - "level" => ($attributeQuery->device_id == NULL && $attributeQuery->method == 0 ? "Profile" : "Method" ), |
|
| 123 | + "value" => ($decodedAttribute['lang'] == "" ? $decodedAttribute['content'] : serialize($decodedAttribute)), |
|
| 124 | + "level" => ($attributeQuery->device_id == NULL && $attributeQuery->method == 0 ? "Profile" : "Method"), |
|
| 125 | 125 | "row" => $attributeQuery->row, |
| 126 | 126 | "flag" => $optinfo['flag'], |
| 127 | 127 | "device" => $attributeQuery->device_id, |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | // add internal attributes |
| 132 | 132 | // they share many attribute properties, so condense the generation |
| 133 | 133 | |
| 134 | - $localValueIfAny = (preg_match('/@/', $this->realm) ? substr($this->realm, 0, strpos($this->realm, '@')) : "anonymous" ); |
|
| 134 | + $localValueIfAny = (preg_match('/@/', $this->realm) ? substr($this->realm, 0, strpos($this->realm, '@')) : "anonymous"); |
|
| 135 | 135 | |
| 136 | 136 | $internalAttributes = [ |
| 137 | 137 | "internal:profile_count" => $idp->profileCount(), |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $escapedAttrValue = DBConnection::escape_value($this->databaseType, $attrValue); |
| 361 | 361 | |
| 362 | 362 | DBConnection::exec($this->databaseType, "INSERT INTO $this->entityOptionTable ($this->entityIdColumn, option_name, option_value, eap_method_id" . ($device !== 0 ? ",device_id" : "") . ") |
| 363 | - VALUES(" . $this->identifier . ", '$escapedAttrName', '$escapedAttrValue', $eapType" . ($device !== 0 ? ",'" . DBConnection::escape_value($this->databaseType, $device) . "'" : "" ) . ")"); |
|
| 363 | + VALUES(" . $this->identifier . ", '$escapedAttrName', '$escapedAttrValue', $eapType" . ($device !== 0 ? ",'" . DBConnection::escape_value($this->databaseType, $device) . "'" : "") . ")"); |
|
| 364 | 364 | $this->updateFreshness(); |
| 365 | 365 | } |
| 366 | 366 | |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | */ |
| 416 | 416 | public function setRealmCheckUser($shallwe, $localpart = NULL) { |
| 417 | 417 | DBConnection::exec($this->databaseType, "UPDATE profile SET checkuser_outer = " . ($shallwe == true ? "1" : "0") . |
| 418 | - ( $localpart !== NULL ? ", checkuser_value = '$localpart' " : "") . |
|
| 418 | + ($localpart !== NULL ? ", checkuser_value = '$localpart' " : "") . |
|
| 419 | 419 | " WHERE profile_id = $this->identifier"); |
| 420 | 420 | } |
| 421 | 421 | |