#4007 closed Defect (fixed)
isAdmin function missing from js class elggUser
| Reported by: | chris14679 | Owned by: | sembrestels |
|---|---|---|---|
| Priority: | normal | Milestone: | Elgg 1.8.1 |
| Component: | JavaScript | Version: | 1.8.1b1 |
| Severity: | minor | Keywords: | |
| Cc: | brett@… | Difficulty: |
Description
The elgglib.js javascript library function elgg.is_admin_logged_in() calls the function ElggUser.isAdmin(), which doesn't actually appear to exist!
elgg.is_admin_logged_in() is not used by core code so this error will not crop up until someone like me tries to use it in their own code.
Change History (7)
comment:1 Changed 19 months ago by cash
- Milestone changed from Needs Review to Elgg 1.8.1
comment:2 Changed 19 months ago by sembrestels
- Owner set to sembrestels
- Status changed from new to assigned
comment:3 Changed 19 months ago by sembrestels
Look at this: https://github.com/Elgg/Elgg/pull/84 (sorry for the merge commits)
Warnings to verify actions on the PHP side are missing.
comment:4 Changed 19 months ago by cash
- Resolution set to fixed
- Status changed from assigned to closed
Fixes #4007 merged in sembrestels fix for ElggUser.isAdmin but used prototype instead of extending object in constructor
Changeset: db5cac403c21cc05fa2e34d69c75d1cef583766a
comment:5 Changed 19 months ago by cash
Fixes #4007 merged in sembrestels fix for ElggUser.isAdmin but used prototype instead of extending object in constructor
Changeset: db5cac403c21cc05fa2e34d69c75d1cef583766a
comment:6 Changed 19 months ago by Cash Costello
Refs #4007 previous solution to admin population in ElggUser was throwing warnings
Changeset: c8f62956115245d023c5f049524e450f3fbcd5d6
comment:7 Changed 18 months ago by Cash Costello
Refs #4007 previous solution to admin population in ElggUser was throwing warnings
Changeset: a823e18207c814ca6020d64a89cb0ea1e365eadb

Looks like ElggUser needs a boolean added to store whether the user is admin. We should also add warnings to verify any action on the PHP side since the JavaScript state can be tampered with.