403Webshell
Server IP : 127.0.0.1  /  Your IP : 192.168.99.1
Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9
System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64
User : Administrator ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /laragon4/www/bpkd.test_/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /laragon4/www/bpkd.test_/admin/login.php
<?php
// Perbaiki admin/login.php
// Redirect jika diakses dengan .php ke tanpa .php
if (strpos($_SERVER['REQUEST_URI'], '.php') !== false) {
    $url = str_replace('.php', '', $_SERVER['REQUEST_URI']);
    header("Location: $url");
    exit;
}

// Load konfigurasi database dulu
require_once 'config/database.php';

// Load fungsi-fungsi umum (termasuk sanitize)
require_once '../includes/init.php';
require_once 'includes/init.php';

// Redirect if already logged in
if (isLoggedIn()) {
    redirect('dashboard.php');
}

$error = '';

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    // Sekarang fungsi sanitize sudah tersedia dari init.php
    $username = sanitize($_POST['username']);
    $password = md5($_POST['password']); // Note: Masih menggunakan MD5, sebaiknya upgrade ke password_hash()
    
    $query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
    $result = $conn->query($query);
    
    if ($result && $result->num_rows > 0) {
        $user = $result->fetch_assoc();
        $_SESSION['user_id'] = $user['id'];
        $_SESSION['username'] = $user['username'];
        $_SESSION['full_name'] = $user['full_name'];
        $_SESSION['role'] = $user['role'];
        
        // Update last login
        $conn->query("UPDATE users SET last_login = NOW() WHERE id = " . $user['id']);
        
        redirect('dashboard.php');
    } else {
        $error = 'Username atau password salah!';
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - CMS Admin</title>
    
    <!-- Google Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    
    <!-- Font Awesome 6 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <!-- Animate.css -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>

    <link rel="icon" type="image/x-icon" href="assets/images/favicon.png">
    <link rel="shortcut icon" href="assets/images/favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon" href="assets/images/favicon.png">
    
    <style>
        :root {
            --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --font-primary: 'Inter', sans-serif;
            --font-secondary: 'Poppins', sans-serif;
        }
        
        body {
            background: var(--primary-gradient);
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: var(--font-primary);
            position: relative;
            overflow: hidden;
        }
        
        body::before {
            content: '';
            position: absolute;
            width: 200%;
            height: 200%;
            background: repeating-linear-gradient(
                45deg,
                rgba(255,255,255,0.03) 0px,
                rgba(255,255,255,0.03) 20px,
                transparent 20px,
                transparent 40px
            );
            animation: moveBg 20s linear infinite;
        }
        
        @keyframes moveBg {
            0% { transform: translate(-10%, -10%) rotate(0deg); }
            100% { transform: translate(10%, 10%) rotate(10deg); }
        }
        
        .login-card {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 30px;
            box-shadow: 0 25px 50px rgba(0,0,0,0.3);
            padding: 50px;
            width: 100%;
            max-width: 450px;
            position: relative;
            z-index: 1;
            animation: slideInUp 0.8s ease-out;
        }
        
        @keyframes slideInUp {
            from {
                opacity: 0;
                transform: translateY(50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .login-header {
            text-align: center;
            margin-bottom: 40px;
        }
        
        .login-header .logo {
            width: 80px;
            height: 80px;
            background: var(--primary-gradient);
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 25px;
            color: white;
            font-size: 40px;
            transform: rotate(-5deg);
            transition: transform 0.3s;
            box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
        }
        
        .login-header .logo:hover {
            transform: rotate(0deg);
        }
        
        .login-header h3 {
            font-family: var(--font-secondary);
            color: #333;
            font-weight: 700;
            font-size: 2rem;
            margin-bottom: 10px;
            letter-spacing: -0.5px;
        }
        
        .login-header p {
            color: #666;
            font-size: 0.95rem;
            font-weight: 400;
        }
        
        .form-floating {
            margin-bottom: 20px;
        }
        
        .form-floating input {
            border: 2px solid #e9ecef;
            border-radius: 15px;
            padding: 1rem 1rem 1rem 3rem;
            height: auto;
            font-family: var(--font-primary);
            font-size: 1rem;
            transition: all 0.3s;
        }
        
        .form-floating input:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
            transform: translateY(-2px);
        }
        
        .form-floating label {
            padding-left: 3rem;
            color: #999;
        }
        
        .input-icon {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            z-index: 10;
            color: #667eea;
            font-size: 1.2rem;
        }
        
        .btn-login {
            background: var(--primary-gradient);
            border: none;
            color: white;
            padding: 15px;
            border-radius: 15px;
            font-weight: 600;
            width: 100%;
            transition: all 0.3s;
            font-size: 1.1rem;
            letter-spacing: 0.5px;
            margin-top: 20px;
            position: relative;
            overflow: hidden;
        }
        
        .btn-login::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.5s;
        }
        
        .btn-login:hover {
            transform: translateY(-3px);
            box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
        }
        
        .btn-login:hover::before {
            left: 100%;
        }
        
        .alert {
            border-radius: 15px;
            border: none;
            padding: 15px 20px;
            font-size: 0.95rem;
            animation: shake 0.5s;
        }
        
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
            20%, 40%, 60%, 80% { transform: translateX(5px); }
        }
        
        .demo-info {
            text-align: center;
            margin-top: 25px;
            padding: 20px;
            background: #f8f9fc;
            border-radius: 15px;
            font-size: 0.9rem;
        }
        
        .demo-info small {
            color: #666;
            display: block;
            margin-bottom: 5px;
        }
        
        .demo-info .badge {
            background: var(--primary-gradient);
            color: white;
            padding: 8px 15px;
            border-radius: 30px;
            font-weight: 500;
        }
        
        .floating-shape {
            position: absolute;
            background: rgba(255,255,255,0.1);
            border-radius: 50%;
            pointer-events: none;
        }
        
        .shape1 {
            width: 300px;
            height: 300px;
            top: -150px;
            right: -150px;
            background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
            animation: float 8s ease-in-out infinite;
        }
        
        .shape2 {
            width: 200px;
            height: 200px;
            bottom: -100px;
            left: -100px;
            background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
            animation: float 10s ease-in-out infinite reverse;
        }
        
        @keyframes float {
            0%, 100% { transform: translate(0, 0) rotate(0deg); }
            33% { transform: translate(30px, -30px) rotate(120deg); }
            66% { transform: translate(-20px, 20px) rotate(240deg); }
        }
    </style>
</head>
<body>
    <div class="floating-shape shape1"></div>
    <div class="floating-shape shape2"></div>
    
    <div class="login-card animate__animated animate__fadeIn">
        <div class="login-header">
            <div class="logo">
                <i class="fas fa-building"></i>
            </div>
            <h3>BPKD</h3>
            <p>Silakan login untuk mengakses dashboard</p>
        </div>
        
        <?php if ($error): ?>
            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                <i class="fas fa-exclamation-circle me-2"></i><?php echo $error; ?>
                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
        <?php endif; ?>
        
        <form method="POST" action="">
            <div class="form-floating mb-3">
                <i class="fas fa-user input-icon"></i>
                <input type="text" class="form-control" id="username" name="username" placeholder="Username" required autofocus>
                <label for="username">Username</label>
            </div>
            
            <div class="form-floating mb-4">
                <i class="fas fa-lock input-icon"></i>
                <input type="password" class="form-control" id="password" name="password" placeholder="Password" required>
                <label for="password">Password</label>
            </div>
            
            <button type="submit" class="btn btn-login">
                <i class="fas fa-sign-in-alt me-2"></i>Login
            </button>
        </form>
        
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit