@@ -87,6 +87,7 @@ discard block |
||
| 87 | 87 | /** |
| 88 | 88 | * executes a query and triggers logging to the SQL audit log if it's not a SELECT |
| 89 | 89 | * @param string $querystring the query to be executed |
| 90 | + * @param string $db |
|
| 90 | 91 | * @return mixed the query result as mysqli_result object; or TRUE on non-return-value statements |
| 91 | 92 | */ |
| 92 | 93 | public static function exec($db, $querystring) { |
@@ -134,6 +135,8 @@ discard block |
||
| 134 | 135 | /** |
| 135 | 136 | * Checks if a raw data pointer is public data (return value FALSE) or if |
| 136 | 137 | * yes who the authorised admins to view it are (return array of user IDs) |
| 138 | + * @param string $table |
|
| 139 | + * @param string $row |
|
| 137 | 140 | */ |
| 138 | 141 | public static function isDataRestricted($table, $row) { |
| 139 | 142 | if ($table != "institution_option" && $table != "profile_option" && $table != "federation_option") |
@@ -175,6 +178,7 @@ discard block |
||
| 175 | 178 | |
| 176 | 179 | /** |
| 177 | 180 | * Retrieves the last auto-id of an INSERT. Needs to be called immediately after the corresponding exec() call |
| 181 | + * @param string $db |
|
| 178 | 182 | * @return int the last autoincrement-ID |
| 179 | 183 | */ |
| 180 | 184 | public static function lastID($db) { |
@@ -211,8 +211,9 @@ |
||
| 211 | 211 | exit(1); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - if ($db == "EXTERNAL" && Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") |
|
| 215 | - mysqli_query($this->connection, "SET NAMES 'latin1'"); |
|
| 214 | + if ($db == "EXTERNAL" && Config::$CONSORTIUM['name'] == "eduroam" && isset(Config::$CONSORTIUM['deployment-voodoo']) && Config::$CONSORTIUM['deployment-voodoo'] == "Operations Team") { |
|
| 215 | + mysqli_query($this->connection, "SET NAMES 'latin1'"); |
|
| 216 | + } |
|
| 216 | 217 | } |
| 217 | 218 | |
| 218 | 219 | } |
| 219 | 220 | \ No newline at end of file |
@@ -211,9 +211,9 @@ discard block |
||
| 211 | 211 | * @param boolean $by_fedadmin is the invitation token created for a federation admin or from an existing inst admin |
| 212 | 212 | * @param type $for identifier (typically email address) for which the invitation is created |
| 213 | 213 | * @param mixed $inst_identifier either an instance of the IdP class (for existing institutions to invite new admins) or a string (new institution - this is the inst name then) |
| 214 | - * @param string $external_id if the IdP to be created is related to an external DB entity, this parameter contains that ID |
|
| 215 | - * @param type $country if the institution is new (i.e. $inst is a string) this parameter needs to specify the federation of the new inst |
|
| 216 | - * @return mixed The function returns either the token (as string) or FALSE if something went wrong |
|
| 214 | + * @param integer $external_id if the IdP to be created is related to an external DB entity, this parameter contains that ID |
|
| 215 | + * @param integer $country if the institution is new (i.e. $inst is a string) this parameter needs to specify the federation of the new inst |
|
| 216 | + * @return string|false The function returns either the token (as string) or FALSE if something went wrong |
|
| 217 | 217 | */ |
| 218 | 218 | public function createToken($by_fedadmin, $for, $inst_identifier, $external_id = 0, $country = 0) { |
| 219 | 219 | $escapedFor = DBConnection::escape_value(UserManagement::$DB_TYPE, $for); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | /** |
| 244 | 244 | * Retrieves all pending invitations for an institution or for a federation. |
| 245 | 245 | * |
| 246 | - * @param type $idp_identifier the identifier of the institution. If not set, returns invitations for not-yet-created insts |
|
| 246 | + * @param integer $idp_identifier the identifier of the institution. If not set, returns invitations for not-yet-created insts |
|
| 247 | 247 | * @return if idp_identifier is set: an array of strings (mail addresses); otherwise an array of tuples (country;name;mail) |
| 248 | 248 | */ |
| 249 | 249 | public function listPendingInvitations($idp_identifier = 0) { |
@@ -250,7 +250,7 @@ |
||
| 250 | 250 | $retval = []; |
| 251 | 251 | $invitations = DBConnection::exec(UserManagement::$DB_TYPE, "SELECT cat_institution_id, country, name, invite_issuer_level, invite_dest_mail, invite_token |
| 252 | 252 | FROM invitations |
| 253 | - WHERE cat_institution_id " . ( $idp_identifier != 0 ? "= $idp_identifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0"); |
|
| 253 | + WHERE cat_institution_id " . ($idp_identifier != 0 ? "= $idp_identifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0"); |
|
| 254 | 254 | if ($idp_identifier != 0) { // list invitations for existing institution, must match cat_institution_id |
| 255 | 255 | while ($a = mysqli_fetch_object($invitations)) { |
| 256 | 256 | debug(4, "Retrieving pending invitations for IdP $idp_identifier.\n"); |
@@ -48,25 +48,29 @@ |
||
| 48 | 48 | // extended input checks |
| 49 | 49 | |
| 50 | 50 | $realm = FALSE; |
| 51 | -if (isset($_POST['realm']) && $_POST['realm'] != "") |
|
| 51 | +if (isset($_POST['realm']) && $_POST['realm'] != "") { |
|
| 52 | 52 | $realm = valid_Realm($_POST['realm']); |
| 53 | +} |
|
| 53 | 54 | |
| 54 | 55 | $anon = FALSE; |
| 55 | -if (isset($_POST['anon_support'])) |
|
| 56 | +if (isset($_POST['anon_support'])) { |
|
| 56 | 57 | $anon = valid_boolean($_POST['anon_support']); |
| 58 | +} |
|
| 57 | 59 | |
| 58 | 60 | $anon_local = "anonymous"; |
| 59 | 61 | if (isset($_POST['anon_local'])) { |
| 60 | 62 | $anon_local = valid_string_db($_POST['anon_local']); |
| 61 | 63 | } else if ($my_profile !== FALSE) { // get the old anon outer id from DB. People don't appreciate "forgetting" it when unchecking anon id |
| 62 | 64 | $local = $my_profile->getAttributes("internal:anon_local_value"); |
| 63 | - if (isset($local[0])) |
|
| 64 | - $anon_local = $local[0]['value']; |
|
| 65 | -} |
|
| 65 | + if (isset($local[0])) { |
|
| 66 | + $anon_local = $local[0]['value']; |
|
| 67 | + } |
|
| 68 | + } |
|
| 66 | 69 | |
| 67 | 70 | $checkuser = FALSE; |
| 68 | -if (isset($_POST['checkuser_support'])) |
|
| 71 | +if (isset($_POST['checkuser_support'])) { |
|
| 69 | 72 | $checkuser = valid_boolean($_POST['checkuser_support']); |
| 73 | +} |
|
| 70 | 74 | |
| 71 | 75 | $checkuser_name = "anonymous"; |
| 72 | 76 | if (isset($_POST['checkuser_local'])) { |