osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now
Completely overriding settings from external authentication
I just noticed a "small" problem. When I authenticate against an external data source (like AD), the system saves the user profile in its internal DB, and that could be OK. But then if some information gets updated in the external data source, the two archives remain out-of-sync.
For example I login for the first time as a staff member: a row gets added to ost_staff saying that I'm a staff member. Later, my profile gets "promoted" to admin on the external data source, but ost_staff insists on saying I'm still regular staff (seems I have no means to tell OsTicket that user level changed).
That quite completely defeats the purpose of having a central directory!
The only workaround I could find is manually updating ost_staff.isadmin every time it's different from what it should be with a direct query:
$sql='UPDATE '.STAFF_TABLE.' SET isadmin='.($isadmin?1:0).' WHERE staff_id='.$u;
every time my plugin's signOn() gets called.
Is there a better way, that doesn't require direct table manipulation?