Initial commit

This commit is contained in:
2026-01-14 23:04:53 +01:00
parent 2f7d11b7d2
commit d9b4c73baa
25 changed files with 3742 additions and 30 deletions

View File

@@ -0,0 +1,68 @@
<div class="dbm-content-header">
<div class="dbm-breadcrumb">
<a href="<?php echo Config::get('URL'); ?>dbuser/index">Users</a>
<span class="separator">/</span>
<span>Create User</span>
</div>
<div class="dbm-title">
<h1>Create New User</h1>
</div>
</div>
<div class="dbm-content-body">
<div class="dbm-card">
<div class="dbm-card-body">
<form method="post" action="<?php echo Config::get('URL'); ?>dbuser/create">
<div class="dbm-form-group">
<label class="dbm-form-label">Username</label>
<input type="text" name="username" class="dbm-form-input" required pattern="[a-zA-Z0-9_]+" placeholder="username">
</div>
<div class="dbm-form-group">
<label class="dbm-form-label">Password</label>
<input type="password" name="password" class="dbm-form-input" required placeholder="password">
</div>
<div class="dbm-form-group">
<label class="dbm-form-label">Host</label>
<select name="host" class="dbm-form-select">
<option value="localhost">localhost</option>
<option value="%">% (any host)</option>
<option value="127.0.0.1">127.0.0.1</option>
</select>
</div>
<div class="dbm-form-group">
<label class="dbm-form-label">Privileges</label>
<div style="margin-top: 8px; padding: 12px; background: var(--dbm-bg-secondary); border-radius: var(--dbm-radius);">
<div style="margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--dbm-border);">
<label style="display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--dbm-text);">
<input type="checkbox" name="privileges[]" value="ALL PRIVILEGES" id="all-privs-check"
onchange="document.querySelectorAll('.priv-checkbox').forEach(cb => { cb.checked = this.checked; cb.disabled = this.checked; })">
ALL PRIVILEGES (*)
</label>
<small style="color: var(--dbm-text-muted); font-size: 11px; margin-left: 22px;">Grant all privileges on all databases</small>
</div>
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;">
<?php
$all_privileges = ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'CREATE', 'DROP', 'ALTER', 'INDEX', 'REFERENCES', 'CREATE TEMPORARY TABLES', 'LOCK TABLES', 'EXECUTE', 'CREATE VIEW', 'SHOW VIEW', 'CREATE ROUTINE', 'ALTER ROUTINE', 'EVENT', 'TRIGGER'];
foreach ($all_privileges as $priv):
?>
<label style="display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--dbm-text-secondary);">
<input type="checkbox" name="privileges[]" value="<?php echo $priv; ?>" class="priv-checkbox">
<?php echo $priv; ?>
</label>
<?php endforeach; ?>
</div>
</div>
</div>
<div style="margin-top: 20px; display: flex; gap: 8px;">
<button type="submit" name="submit_create_user" class="dbm-btn dbm-btn-success">
<i data-lucide="plus"></i>
Create User
</button>
<a href="<?php echo Config::get('URL'); ?>dbuser/index" class="dbm-btn dbm-btn-secondary">Cancel</a>
</div>
</form>
</div>
</div>
</div>