X7ROOT File Manager
Current Path:
/home/u126090504/domains/saiadarshainternationalschool.org.in/public_html/admin
home
/
u126090504
/
domains
/
saiadarshainternationalschool.org.in
/
public_html
/
admin
/
π
..
π
achievers.php
(21.44 KB)
π
achv_cat_manage.php
(7.99 KB)
π
achv_edit.php
(9.58 KB)
π
achv_list.php
(8.08 KB)
π
achv_upload.php
(13.39 KB)
π
admin-academic-calendar.php
(20.41 KB)
π
admin-public-disclosure.php
(18.36 KB)
π
admissions.php
(28.76 KB)
π
admissions_error.log
(56 KB)
π
assets
π
banners.php
(9.78 KB)
π
branding_settings.php
(5.93 KB)
π
change_password.php
(3.01 KB)
π
class_master.php
(4.32 KB)
π
contacts.php
(3.79 KB)
π
dashboard.php
(27.78 KB)
π
downloads.php
(4.91 KB)
π
edit_faculty.php
(6.85 KB)
π
export_franchise.php
(930 B)
π
faculty.php
(8.36 KB)
π
fees_list.php
(8.48 KB)
π
fees_upload.php
(6.19 KB)
π
forgot_password.php
(6.39 KB)
π
franchise.php
(7.28 KB)
π
gallery.php
(3.08 KB)
π
grievance-update.php
(1003 B)
π
grievance-view.php
(8.51 KB)
π
grievances.php
(9.55 KB)
π
homework_add.php
(5.98 KB)
π
homework_delete.php
(543 B)
π
homework_edit.php
(9.39 KB)
π
homework_list.php
(2.24 KB)
π
img
π
includes
π
index.php
(82 B)
π
login.php
(13.47 KB)
π
logout.php
(102 B)
π
manage_albums.php
(10.82 KB)
π
manage_media.php
(11.77 KB)
π
manage_photos.php
(6.35 KB)
π
manage_videos.php
(18.38 KB)
π
managing-committee.php
(13.64 KB)
π
master_menu.php
(5.75 KB)
π
master_menu_debug.php
(3.73 KB)
π
new_password.php
(3.9 KB)
π
non_academic_achievers.php
(21.2 KB)
π
notice.php
(15.52 KB)
π
notice_error.log
(38.45 KB)
π
notices.php
(8.24 KB)
π
payments.php
(14.96 KB)
π
phpmailer
π
popup.php
(14.07 KB)
π
reset_password.php
(2.27 KB)
π
section_master.php
(6.59 KB)
π
sections_by_class.php
(346 B)
π
secure_session.php
(1000 B)
π
settings.php
(8.35 KB)
π
student_photo_update.php
(1.8 KB)
π
subject_master.php
(6.16 KB)
π
submit-grievance.php
(4.97 KB)
π
testimonials.php
(15.15 KB)
π
update_status.php
(1.66 KB)
π
upi_settings.php
(1.52 KB)
Editing: login.php
<?php include 'secure_session.php'; require_once '../config.php'; /* βββββββββββββββββββββββββββββββ Branding setup (logo/bg upload) ββββββββββββββββββββββββββββββββ */ define('BRANDING_DIR', __DIR__ . '/assets/branding'); define('BRANDING_STATE', BRANDING_DIR . '/branding.json'); if (!defined('BRANDING_EDIT_TOKEN')) { // Set your own strong token in config.php as: // define('BRANDING_EDIT_TOKEN', 'YourSuperSecret!'); define('BRANDING_EDIT_TOKEN', 'Eduweb@2025_RedSecure!'); } if (!is_dir(BRANDING_DIR)) @mkdir(BRANDING_DIR, 0755, true); $branding = ['logo'=>'','background'=>'']; if (is_file(BRANDING_STATE)) { $json = json_decode(@file_get_contents(BRANDING_STATE), true); if (is_array($json)) $branding = array_merge($branding, $json); } $logoUrl = (!empty($branding['logo']) && file_exists(BRANDING_DIR.'/'.basename($branding['logo']))) ? 'assets/branding/'.basename($branding['logo']) : ''; $bgUrl = (!empty($branding['background']) && file_exists(BRANDING_DIR.'/'.basename($branding['background']))) ? 'assets/branding/'.basename($branding['background']) : ''; $success = $error = $brandingMsg = ""; /* βββββββββββββββββββββββββββββββ reCAPTCHA verify ββββββββββββββββββββββββββββββββ */ function verify_recaptcha_v2(string $token): bool { if (empty($token)) return false; $endpoint = 'https://www.google.com/recaptcha/api/siteverify'; $payload = http_build_query([ 'secret' => RECAPTCHA_SECRET_KEY, 'response' => $token, 'remoteip' => $_SERVER['REMOTE_ADDR'] ?? null, ]); if (function_exists('curl_init')) { $ch = curl_init($endpoint); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10 ]); $resp = curl_exec($ch); curl_close($ch); } else { $opts = ['http' => ['method'=>'POST','header'=>"Content-type: application/x-www-form-urlencoded\r\n",'content'=>$payload,'timeout'=>10]]; $resp = @file_get_contents($endpoint, false, stream_context_create($opts)); } if (!$resp) return false; $data = json_decode($resp, true); return isset($data['success']) && $data['success'] === true; } /* βββββββββββββββββββββββββββββββ Save uploaded images ββββββββββββββββββββββββββββββββ */ function save_uploaded_image(string $field, array $allowed, int $max = 2_000_000): ?string { if (!isset($_FILES[$field]) || $_FILES[$field]['error'] === UPLOAD_ERR_NO_FILE) return null; $f = $_FILES[$field]; if ($f['error'] !== UPLOAD_ERR_OK || $f['size'] > $max) return null; $tmp = $f['tmp_name']; if (!is_uploaded_file($tmp)) return null; $fi = new finfo(FILEINFO_MIME_TYPE); $mime = $fi->file($tmp) ?: ''; if (!in_array($mime, $allowed, true)) return null; $extMap = ['image/png'=>'png','image/jpeg'=>'jpg','image/webp'=>'webp','image/svg+xml'=>'svg']; $ext = $extMap[$mime] ?? 'img'; $name = 'brand_'.$field.'_'.date('Ymd_His').'_'.bin2hex(random_bytes(5)).'.'.$ext; $dest = BRANDING_DIR.'/'.$name; if (!@move_uploaded_file($tmp, $dest)) return null; return $name; } /* βββββββββββββββββββββββββββββββ Handle POST ββββββββββββββββββββββββββββββββ */ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $action = $_POST['action'] ?? 'login'; if ($action === 'upload_brand') { $token = $_POST['branding_token'] ?? ''; if (!hash_equals(BRANDING_EDIT_TOKEN, $token)) { $brandingMsg = "β Invalid token."; } else { $up = []; $logo = save_uploaded_image('logo', ['image/png','image/jpeg','image/webp','image/svg+xml']); if ($logo) $up['logo'] = $logo; $bg = save_uploaded_image('background', ['image/png','image/jpeg','image/webp']); if ($bg) $up['background'] = $bg; if ($up) { $state = array_merge($branding, $up); @file_put_contents(BRANDING_STATE, json_encode($state, JSON_PRETTY_PRINT)); header("Location:?customize=1&token=".urlencode($token)."&saved=1"); exit; } else { $brandingMsg = "βΉοΈ No valid image uploaded (PNG/JPG/WEBP; logo allows SVG)."; } } } else { $hp = trim($_POST['website'] ?? ''); if ($hp !== '') { $error = "β Verification failed."; } else { $tok = $_POST['g-recaptcha-response'] ?? ''; if (!verify_recaptcha_v2($tok)) { $error = "β Complete reCAPTCHA."; } else { $email = trim($_POST['email'] ?? ''); $pass = trim($_POST['password'] ?? ''); if ($email === '' || $pass === '') $error = "β Email and password required."; else { $stmt = $conn->prepare("SELECT id,username,password,usertype,email FROM register WHERE email=? LIMIT 1"); $stmt->bind_param("s", $email); $stmt->execute(); $res = $stmt->get_result(); if ($row = $res->fetch_assoc()) { if (password_verify($pass, $row['password']) && $row['usertype'] === 'admin') { session_regenerate_id(true); $_SESSION['admin_id'] = $row['id']; $_SESSION['admin_username'] = $row['username']; $_SESSION['admin_email'] = $row['email']; $success = "β Login successful! Redirectingβ¦"; header("Refresh:2;url=dashboard.php"); } else $error = "β Invalid credentials."; } else $error = "β Invalid credentials."; } } } } } $showCustomizer = isset($_GET['customize']) && $_GET['customize']=='1' && isset($_GET['token']) && hash_equals(BRANDING_EDIT_TOKEN, $_GET['token']); $savedFlag = isset($_GET['saved']) && $_GET['saved']=='1'; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <title>Admin Login</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" rel="stylesheet"> <style> :root{ --brand-red:#d10024; --brand-red2:#ff2e44; --deep-black:#0b0b0d; --border:rgba(255,255,255,0.12); } *{box-sizing:border-box} body{ min-height:100vh; margin:0; font-family:system-ui,Segoe UI,Roboto; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,var(--deep-black),#161618); color:#fff; padding:20px; position:relative; overflow:hidden; } .bg-image{ position:fixed; inset:0; background:url('<?php echo htmlspecialchars($bgUrl);?>') center/cover no-repeat; opacity:<?php echo $bgUrl?'0.25':'0';?>; z-index:-3; transition:opacity .4s; } .bg-overlay{position:fixed; inset:0; background:rgba(0,0,0,.65); z-index:-2;} /* Glassy card (more transparent) */ .login-card{ max-width:440px; width:100%; background:rgba(17,17,17,0.55); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); border-radius:20px; box-shadow:0 20px 60px rgba(0,0,0,.55); border:1px solid rgba(255,255,255,0.08); padding:28px; animation:fade .6s ease; } @keyframes fade{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}} .brand{display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:15px;} .brand img{max-height:56px; width:auto;} .brand h3{margin:0; font-weight:800;} label{color:#f0f2f8; font-weight:600;} .form-control{ background:rgba(255,255,255,0.10); border:1px solid var(--border); color:#fff; border-radius:12px; height:46px; } .form-control::placeholder{color:rgba(255,255,255,0.75)} .form-control:focus{ background:rgba(255,255,255,0.15); border-color:rgba(209,0,36,0.5); box-shadow:0 0 0 3px rgba(209,0,36,0.25); color:#fff; } /* Password toggle β perfectly centered */ .pwd-wrap{position:relative;} .pwd-wrap input.form-control{ padding-right:45px; /* space for icon */ display:flex; align-items:center; /* stabilize baseline across browsers */ } .pwd-toggle{ position:absolute; right:14px; top:0; height:100%; display:flex; align-items:center; justify-content:center; background:none; border:none; color:rgba(255,255,255,.85); cursor:pointer; transition:color .2s ease; } .pwd-toggle:hover{color:#fff} /* Button + animated red glow */ .btn-custom{ position:relative; overflow:visible; background:linear-gradient(90deg,var(--brand-red),var(--brand-red2)); color:#fff; font-weight:800; border-radius:12px; border:none; height:46px; box-shadow:0 8px 24px rgba(209,0,36,0.45); } .btn-custom::after{ content:""; position:absolute; left:50%; bottom:-10px; transform:translateX(-50%); width:72%; height:16px; filter:blur(16px); background:radial-gradient(closest-side, rgba(255,70,90,0.85), rgba(255,70,90,0.0) 70%); animation:pulse 2.2s ease-in-out infinite; pointer-events:none; } @keyframes pulse{ 0%,100%{opacity:.55; transform:translateX(-50%) scaleX(1)} 50%{opacity:1; transform:translateX(-50%) scaleX(1.08)} } .btn-custom:hover{box-shadow:0 12px 36px rgba(209,0,36,0.6)} /* Hidden honeypot */ .hp-field{position:absolute; left:-5000px; opacity:0; height:0; width:0} /* Branding panel */ .brand-panel{ max-width:440px; width:100%; margin-top:16px; padding:16px; border-radius:16px; background:rgba(0,0,0,0.6); color:#fff; border:1px solid rgba(255,255,255,0.08); } .preview-bg{ width:100%; height:150px; border-radius:12px; background:url('<?php echo htmlspecialchars($bgUrl);?>') center/cover no-repeat; border:1px dashed rgba(255,255,255,0.25); } </style> </head> <body> <?php if($bgUrl):?><div class="bg-image"></div><?php endif;?> <div class="bg-overlay"></div> <div class="login-card"> <div class="brand"> <?php if($logoUrl):?><img src="<?php echo htmlspecialchars($logoUrl);?>" alt="Logo"><?php endif;?> <h3>π Admin Login</h3> </div> <?php if($error):?><div class="alert alert-danger"><?php echo htmlspecialchars($error);?></div><?php endif;?> <?php if($success):?><div class="alert alert-success"><?php echo htmlspecialchars($success);?></div><?php endif;?> <form method="POST" novalidate> <input type="hidden" name="action" value="login"> <input type="text" name="website" class="hp-field" autocomplete="off"> <div class="form-group"> <label>Email address</label> <input type="email" name="email" class="form-control" placeholder="Enter email" required autocomplete="username"> </div> <div class="form-group pwd-wrap"> <label>Password</label> <input id="password" type="password" name="password" class="form-control" placeholder="Enter password" required autocomplete="current-password"> <button type="button" class="pwd-toggle" onclick="togglePwd()" aria-label="Show/Hide password"> <!-- Open eye (default) --> </button> </div> <div class="form-group"> <div class="g-recaptcha" data-sitekey="<?php echo htmlspecialchars(RECAPTCHA_SITE_KEY);?>"></div> </div> <button type="submit" class="btn btn-custom btn-block">Login</button> </form> <p class="mt-3 text-center"><a href="forgot_password.php" style="color:#ffd3d8;">Forgot your password?</a></p> </div> <?php if($showCustomizer):?> <div class="brand-panel"> <h5 class="mb-2">π¨ Branding (Admin)</h5> <?php if($savedFlag):?><div class="alert alert-success py-2">Saved successfully.</div><?php endif;?> <?php if($brandingMsg):?><div class="alert alert-warning py-2"><?php echo htmlspecialchars($brandingMsg);?></div><?php endif;?> <form method="POST" enctype="multipart/form-data"> <input type="hidden" name="action" value="upload_brand"> <input type="hidden" name="branding_token" value="<?php echo htmlspecialchars(BRANDING_EDIT_TOKEN);?>"> <div class="form-group"> <label>Logo (PNG/JPG/WEBP/SVG β€ 2MB)</label> <input type="file" name="logo" class="form-control-file" accept=".png,.jpg,.jpeg,.webp,.svg"> <?php if($logoUrl):?><small class="form-text text-light">Current: <code><?php echo htmlspecialchars(basename($logoUrl));?></code></small><?php endif;?> </div> <div class="form-group"> <label>Background (PNG/JPG/WEBP β€ 2MB)</label> <input type="file" name="background" class="form-control-file" accept=".png,.jpg,.jpeg,.webp"> <div class="preview-bg mt-2"></div> <?php if($bgUrl):?><small class="form-text text-light">Current: <code><?php echo htmlspecialchars(basename($bgUrl));?></code></small><?php endif;?> </div> <button class="btn btn-custom btn-block" type="submit">Save Branding</button> </form> </div> <?php endif;?> <!-- Scripts --> <script src="https://www.google.com/recaptcha/api.js" async defer></script> <script> function togglePwd(){ const input=document.getElementById('password'); const icon=document.getElementById('eyeIcon'); if(input.type==='password'){ input.type='text'; icon.innerHTML='<path d="M17.94 17.94A10.94 10.94 0 0 1 12 20c-7 0-11-8-11-8a20.46 20.46 0 0 1 3.23-4.64m3.55-2.58A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a20.46 20.46 0 0 1-3.23 4.64M1 1l22 22"/>'; }else{ input.type='password'; icon.innerHTML='<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8S1 12 1 12z"/><circle cx="12" cy="12" r="3"/>'; } } </script> </body> </html>
Upload File
Create Folder