Add flash alert UX improvements, User_Model fetch security, and SCSS-SCOPE-01 BEM guidance
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -466,4 +466,37 @@ class User_Model extends Rsx_Site_Model_Abstract
|
||||
// Default: invitation is pending
|
||||
return self::INVITATION_PENDING;
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// AJAX FETCH
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* Ajax model fetch - allows JavaScript to load user records
|
||||
* Filters out invite_* fields for security
|
||||
*/
|
||||
#[Ajax_Endpoint_Model_Fetch]
|
||||
public static function fetch($id)
|
||||
{
|
||||
$user = static::withTrashed()->find($id);
|
||||
|
||||
if (!$user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$data = $user->toArray();
|
||||
|
||||
// Filter out invite_* fields - these contain sensitive invitation data
|
||||
foreach (array_keys($data) as $key) {
|
||||
if (str_starts_with($key, 'invite_')) {
|
||||
unset($data[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Augment with computed properties
|
||||
$data['get_full_name'] = $user->get_full_name();
|
||||
$data['get_display_name'] = $user->get_display_name();
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user