Remove user rename feature; add www-data hint in WebDAV edit modal

- Removed PATCH /api/users/<name> route (rename_user)
- Removed renameModal from index.html
- Removed openRenameModal/submitRename from users.js
- Removed Rename button from users table
- Removed rename docs from README
- Added green info box in WebDAV edit modal: set group=www-data, mode=775

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
marcandClaude Sonnet 4.6 committed 2026-06-20 17:01:56 +02:00
1 parent f081496b4b
commit b6179865b5
5 files changed
+5 -70

No files matched your search

+5
View File
@@ -259,6 +259,11 @@ async function openEditModal(type, share) {
</label>
<input type="text" id="editWebdavUsers" class="form-control" value="${esc(share.users || '')}">
</div>
<div class="mb-3 px-2 py-2 rounded" style="background:#1a2a1a; border:1px solid #2d4a2d; font-size:.82rem; color:#8dba8d">
WebDAV writes files as <code style="color:#3fb950">www-data</code>.
Set the folder group to <code style="color:#3fb950">www-data</code> and mode to <code style="color:#3fb950">775</code> below,
or add <code style="color:#3fb950">www-data</code> to your share group.
</div>
${permSection}`;
} else {
const isRo = /\(ro[,)]/.test(share.clients);
-26
View File
@@ -22,8 +22,6 @@ async function loadUsers() {
</span>
</td>
<td>
<button class="btn btn-sm me-1" style="border:1px solid var(--border); color:var(--muted)"
onclick="openRenameModal(${nameJson})">Rename</button>
<button class="btn btn-sm me-1" style="border:1px solid var(--border); color:var(--muted)"
onclick="openPwModal(${nameJson})">Password</button>
<button class="btn btn-sm btn-danger"
@@ -97,30 +95,6 @@ async function submitPassword() {
showToast(`Password updated for "${name}".`);
}
function openRenameModal(name) {
document.getElementById('renameOldName').value = name;
document.getElementById('renameNewName').value = name;
new bootstrap.Modal(document.getElementById('renameModal')).show();
}
async function submitRename() {
const oldName = document.getElementById('renameOldName').value;
const newName = document.getElementById('renameNewName').value.trim();
if (!newName) return showToast('New username is required.', 'danger');
const res = await apiFetch(`/api/users/${encodeURIComponent(oldName)}`, {
method: 'PATCH', headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: newName}),
});
if (!res) return;
const data = await res.json();
bootstrap.Modal.getInstance(document.getElementById('renameModal')).hide();
if (!res.ok) return showToast('Error: ' + (data.error || res.status), 'danger');
if (data.warning) showToast(data.warning, 'warning');
else showToast(`Renamed to "${newName}".`);
loadUsers();
loadGroups();
}
function openAdminSettings() {
document.getElementById('adminCurrentPw').value = '';