Compare commits
2 Commits
457170a1ae
...
fe610b094d
| Author | SHA1 | Date | |
|---|---|---|---|
| fe610b094d | |||
|
|
efc1fc3906 |
16
index.php
16
index.php
@@ -942,10 +942,20 @@
|
||||
.then(data => {
|
||||
bootstrap.Modal.getInstance(document.getElementById('loginModal')).hide();
|
||||
|
||||
// Show/hide settings button according to permissions
|
||||
if (!data.user.can_manage_settings) {
|
||||
document.querySelectorAll('.settings-btn').forEach(b => b.style.display = 'none');
|
||||
} else {
|
||||
document.querySelectorAll('.settings-btn').forEach(b => b.style.display = '');
|
||||
}
|
||||
|
||||
// Update user email in the dropdown and refresh profiles + projects
|
||||
if (data.user && data.user.email) {
|
||||
const userEl = document.getElementById('dropdownUserEmail');
|
||||
if (userEl) userEl.textContent = data.user.email;
|
||||
}
|
||||
|
||||
loadProfiles();
|
||||
fetchProjects();
|
||||
})
|
||||
.catch(ex => {
|
||||
@@ -1041,6 +1051,12 @@
|
||||
// Clear UI
|
||||
document.getElementById('projectGrid').innerHTML = '';
|
||||
|
||||
// Clear Profile List
|
||||
document.getElementById('profileSelect').innerHTML = '';
|
||||
|
||||
// Clear User Email
|
||||
document.getElementById('dropdownUserEmail').textContent = '';
|
||||
|
||||
// Show login modal
|
||||
new bootstrap.Modal(document.getElementById('loginModal')).show();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user