50 lines
No EOL
4.7 KiB
PHP
50 lines
No EOL
4.7 KiB
PHP
<?php require_once __DIR__ . '/../inc/admin_header.php'; ?>
|
|
<div class="max-w-4xl w-full mx-auto mt-8 px-6">
|
|
<div class="mb-6 flex items-center justify-between">
|
|
<h1 class="text-2xl font-bold text-slate-100 font-mono tracking-tight">
|
|
<span class="text-emerald-500">></span> <?= htmlspecialchars($title) ?>
|
|
</h1>
|
|
<a href="<?= Config::get('BASE_URL') ?>admin/users" class="text-slate-500 hover:text-emerald-400 font-mono text-sm transition-colors">< Zurück zur Liste</a>
|
|
</div>
|
|
<div class="bg-slate-900/80 border border-slate-700/50 rounded-xl shadow-2xl p-6 sm:p-8 backdrop-blur-sm relative overflow-hidden">
|
|
<div class="absolute top-0 left-0 w-full h-1 bg-linear-to-r from-transparent via-emerald-500/40 to-transparent"></div>
|
|
<form action="<?= Config::get('BASE_URL') ?>admin/user_save" method="POST" class="space-y-6 relative z-10">
|
|
<input type="hidden" name="csrf_token" value="<?= Security::csrf() ?>">
|
|
<?php if($user): ?><input type="hidden" name="id" value="<?= $user['id'] ?>"><?php endif; ?>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
<div>
|
|
<label class="block text-slate-400 font-mono text-xs uppercase tracking-wider mb-2">Name</label>
|
|
<input type="text" name="name" value="<?= htmlspecialchars($user['name'] ?? '') ?>" required class="w-full bg-slate-950/80 border border-slate-700/80 rounded-lg p-3 text-slate-200 text-sm focus:outline-none focus:border-emerald-500/50 transition-colors">
|
|
</div>
|
|
<div>
|
|
<label class="block text-slate-400 font-mono text-xs uppercase tracking-wider mb-2">E-Mail (Login)</label>
|
|
<input type="email" name="email" value="<?= htmlspecialchars($user['email'] ?? '') ?>" required class="w-full bg-slate-950/80 border border-slate-700/80 rounded-lg p-3 text-slate-200 text-sm focus:outline-none focus:border-emerald-500/50 transition-colors">
|
|
</div>
|
|
<div>
|
|
<label class="block text-slate-400 font-mono text-xs uppercase tracking-wider mb-2">Passwort <?= $user ? '<span class="text-[10px] text-slate-600">(Leer lassen für keine Änderung)</span>' : '' ?></label>
|
|
<input type="password" name="password" <?= $user ? '' : 'required' ?> class="w-full bg-slate-950/80 border border-slate-700/80 rounded-lg p-3 text-slate-200 text-sm focus:outline-none focus:border-emerald-500/50 transition-colors">
|
|
</div>
|
|
<div>
|
|
<label class="block text-slate-400 font-mono text-xs uppercase tracking-wider mb-2">Status</label>
|
|
<select name="status" class="w-full bg-slate-950/80 border border-slate-700/80 rounded-lg p-3 text-slate-200 text-sm focus:outline-none focus:border-emerald-500/50 transition-colors">
|
|
<option value="Active" <?= ($user['status'] ?? '') === 'Active' ? 'selected' : '' ?>>Active</option>
|
|
<option value="Inactive" <?= ($user['status'] ?? '') === 'Inactive' ? 'selected' : '' ?>>Inactive</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label class="block text-slate-400 font-mono text-xs uppercase tracking-wider mb-2">Projekte (Kommasepariert)</label>
|
|
<input type="text" name="projects" placeholder="z.B. plants, storymachine, dinos" value="<?= htmlspecialchars(implode(', ', $user['projects'] ?? [])) ?>" class="w-full bg-slate-950/80 border border-slate-700/80 rounded-lg p-3 text-slate-200 text-sm focus:outline-none focus:border-emerald-500/50 transition-colors">
|
|
<p class="text-[10px] text-slate-500 font-mono mt-1">Verzeichnisse im Root für Zugriffsberechtigung.</p>
|
|
</div>
|
|
<div class="flex items-center gap-3 bg-slate-950/50 p-4 rounded-lg border border-slate-800">
|
|
<input type="checkbox" name="is_admin" id="is_admin" value="1" <?= (!empty($user['is_admin'])) ? 'checked' : '' ?> class="w-4 h-4 accent-emerald-500 bg-slate-900 border-slate-700 rounded">
|
|
<label for="is_admin" class="text-slate-300 font-mono text-sm cursor-pointer">Benutzer ist Administrator (Vollzugriff)</label>
|
|
</div>
|
|
<div class="pt-4 border-t border-slate-800">
|
|
<button type="submit" class="bg-emerald-500/20 border border-emerald-500/50 text-emerald-400 hover:bg-emerald-500/40 hover:text-emerald-300 font-bold font-mono uppercase tracking-wider py-3 px-6 rounded-lg transition-all duration-300">💾 Speichern</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<?php require_once __DIR__ . '/../inc/admin_footer.php'; ?>
|