HEX
Server: LiteSpeed
System:
User: ()
PHP: 7.4.33
Disabled: sendmail,mail,exec,shell_exec,dl,system,passthru,pclose,proc_open,proc_nice,proc_terminate,proc_get_status,proc_close,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,escapeshellcmd,escapeshellarg shell-exec,fpassthru,crack_check,crack_closedict,crack_getlastmessage,crack_opendict,psockopen,php_uname,symlink,ini_restore,posix_getpwuid,posix_getegid,posix_getcwd,posix_geteuid,posix_getgroups,posix_uname,posix_setuid,eval,show_source,passthru,popen,allow_url_fopen,get_current_user,getmyuid,getmygid,entre2v2,index_changer_wp,index_changer_joomla,exec_mode_1,exec_mode_2,exec_mode_3,wsoFooter,wsoEx,wsoViewSize,wsoPerms,wsoPermsColor,ukuran,tulis,ambil,tukar,entre2v2,rapih,magicboom,goaction,scookie,showstat,index_changer
Upload Files
File: /home/muratemr/theotto.tr/admin/profile.php
<?php
/**
 * admin/profile.php
 * Profil & Şifre Değiştir
 */

declare(strict_types=1);

require_once __DIR__ . '/../includes/db.php';
require_once __DIR__ . '/../includes/auth.php';
require_once __DIR__ . '/../includes/csrf.php';
require_once __DIR__ . '/../includes/functions.php';

require_login();

$page_title  = 'Profilim';
$active_menu = 'profile';

$me = current_user();

require_once __DIR__ . '/../includes/admin_layout.php';
?>

<div class="d-flex justify-content-between align-items-center mb-4">
    <h4 class="mb-0"><i class="bi bi-person-circle me-2 text-warning"></i>Profilim</h4>
</div>

<div class="row justify-content-center">
    <div class="col-md-6">
        <div class="card">
            <div class="card-header">
                <i class="bi bi-info-circle me-2"></i>Hesap Bilgileri
            </div>
            <div class="card-body">
                <div class="mb-2">
                    <span class="text-muted">Ad Soyad:</span>
                    <strong class="ms-2"><?= e($me['full_name']) ?></strong>
                </div>
                <div class="mb-2">
                    <span class="text-muted">Kullanıcı Adı:</span>
                    <strong class="ms-2"><?= e($me['username']) ?></strong>
                </div>
                <div>
                    <span class="text-muted">Rol:</span>
                    <span class="badge bg-<?= $me['role'] === 'admin' ? 'warning text-dark' : 'info text-dark' ?> ms-2">
                        <?= $me['role'] === 'admin' ? 'Admin' : 'Staff' ?>
                    </span>
                </div>
            </div>
        </div>

        <div class="card mt-4">
            <div class="card-header">
                <i class="bi bi-key me-2"></i>Şifre Değiştir
            </div>
            <div class="card-body">
                <div class="mb-3">
                    <label class="form-label">Mevcut Şifre <span class="text-danger">*</span></label>
                    <input type="password" class="form-control" id="currentPassword" autocomplete="current-password">
                </div>
                <div class="mb-3">
                    <label class="form-label">Yeni Şifre <span class="text-danger">*</span></label>
                    <input type="password" class="form-control" id="newPassword" autocomplete="new-password">
                    <div class="form-text">En az 8 karakter.</div>
                </div>
                <div class="mb-3">
                    <label class="form-label">Yeni Şifre Tekrar <span class="text-danger">*</span></label>
                    <input type="password" class="form-control" id="newPasswordConfirm" autocomplete="new-password">
                </div>
                <button class="btn btn-warning w-100" onclick="changePassword()">
                    <i class="bi bi-check-lg me-2"></i>Şifreyi Güncelle
                </button>
            </div>
        </div>
    </div>
</div>

<script>
function changePassword() {
    const current = document.getElementById('currentPassword').value;
    const next    = document.getElementById('newPassword').value;
    const confirm = document.getElementById('newPasswordConfirm').value;

    if (!current) { showToast('Mevcut şifre zorunlu.', 'error'); return; }
    if (!next)    { showToast('Yeni şifre zorunlu.', 'error'); return; }
    if (next.length < 8) { showToast('Yeni şifre en az 8 karakter olmalı.', 'error'); return; }
    if (next !== confirm) { showToast('Yeni şifreler eşleşmiyor.', 'error'); return; }

    apiPost('/api/admin/profile.php', {
        action: 'change_password',
        current_password: current,
        new_password: next,
    }).then(r => {
        if (r.success) {
            showToast(r.message, 'success');
            document.getElementById('currentPassword').value = '';
            document.getElementById('newPassword').value = '';
            document.getElementById('newPasswordConfirm').value = '';
        } else {
            showToast(r.message, 'error');
        }
    });
}
</script>

<?php require_once __DIR__ . '/../includes/admin_layout_end.php'; ?>