diff options
Diffstat (limited to 'engine/lib/extender.php')
-rw-r--r-- | engine/lib/extender.php | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/engine/lib/extender.php b/engine/lib/extender.php index 988899409..206d98be4 100644 --- a/engine/lib/extender.php +++ b/engine/lib/extender.php @@ -327,20 +327,14 @@ * @param int $user_guid The GUID of the user
* @return true|false
*/
- function can_edit_extender($extender_id, $type, $user_guid = 0) {
+ function can_edit_extender($extender_id, $type, $user_guid = 0) { if (!isloggedin())
return false;
-
- if ($user_guid == 0) {
- if (isset($_SESSION['user'])) {
- $user = $_SESSION['user'];
- } else {
- $user = null;
- }
- } else {
- $user = get_entity($user_guid);
- }
+ + $user_guid = (int)$user_guid; + $user = get_entity($user_guid); + if (!$user) $user = get_loggedin_user();
$functionname = "get_{$type}";
if (is_callable($functionname)) {
|