diff options
| author | Simon Rettberg | 2025-07-07 13:37:19 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2025-07-07 13:37:19 +0200 |
| commit | 9a5106c288519b008e0dfe5e85371701af32c0f3 (patch) | |
| tree | fcfdc6efaf16d2ecefb2bc5822324e9324d6f29f /inc/user.inc.php | |
| parent | [locations] Copy permissions to children when deleting location (diff) | |
| download | slx-admin-9a5106c288519b008e0dfe5e85371701af32c0f3.tar.gz slx-admin-9a5106c288519b008e0dfe5e85371701af32c0f3.tar.xz slx-admin-9a5106c288519b008e0dfe5e85371701af32c0f3.zip | |
[locations] Cleanup Location class
There was a mess of functions which mostly, but not quite, did the same
things. Get rid of a couple of them and fix call sites to use
alternative ones that also fit the job.
While at it, add phpdoc and comments to the remaining functions, trying
to clarify what they were designed for.
Lastly, the return type of functions that retrieve a location id has
been changed from false|int to ?int (nullable types are just nicer).
Diffstat (limited to 'inc/user.inc.php')
| -rw-r--r-- | inc/user.inc.php | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/inc/user.inc.php b/inc/user.inc.php index cd35ac29..088f12c6 100644 --- a/inc/user.inc.php +++ b/inc/user.inc.php @@ -112,8 +112,7 @@ class User } if (self::$user['permissions'] & Permission::get('superadmin')) { if (Module::isAvailable('locations')) { - $a = array_keys(Location::getLocationsAssoc()); - $a[] = 0; + $a = Location::getAllLocationIds(0, true); } else { $a = [0]; } |
