Jump to content
Welcome Guest

Problema Panel


Robyx.exe

Recommended Posts

Nu stiu daca am voie sa postez aici, in fine.
Am o problema la un panel la login, in baza de date parolele sunt criptate dar in panel cand dai login iti spune ca parola e incorecta, din ce am inteles eu cu mintea mea de gaina e problema de la login.p.php unde codu nu citeste parolele criptate.

V-am lasat codul mai jos, mersi de ajutor.

<?php if(Config::isLogged()) { ?>
<?php 
$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Succes','You are logged in!','error');}</script>";
$_SESSION['AlertTime'] = time();
?>
<script>window.location.href = '<?php echo Config::$URL  ?>';</script>
<?php die(); } ?>

            
<?php if(isset($_POST['login'])) {
    $username = Config::antiXSS($_POST['username']);
  $password = Config::antiXSS(md5($_POST['password']));
    $passwordno = Config::antiXSS($_POST['password']);
  date_default_timezone_set('Europe/Bucharest');
$timex = time();
    if(!$username || !$password) {
      echo General::alertView("danger","Complete all fields (name / password).");
    } else {
        $kenny = Config::$g_con->prepare('SELECT * FROM `users` WHERE `name` = ? AND `password` = ?');
        $kenny->execute(array($username,$passwordno));
        if($kenny->rowCount()) {
            $account = $kenny->fetch(PDO::FETCH_OBJ);

if ($checksuspend == 0) { 

unset($_SESSION['pin_session']); // REMOVE SESSION PIN 

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Succes','You have successfully logged in.','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$account->name."';</script>";

$_SESSION['login_session'] = $account->id; // ADD SESSION LOGIN

} else { 

if ($suspend->Permanent == 0) { 
if ($suspend->ExpireDate < date('Y-m-d H-i', $timex)) {   

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','Your suspend has expired, congrats!','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$data->name."';</script>";

$_SESSION['login_session'] = $account->id; // ADD SESSION LOGIN

} else { 

$_SESSION['HomeAlert'] = Config::alertView("danger","You are suspended by ".$suspend->AdminName." for ".$suspend->Days." days. Reason: ".$suspend->Reason.". Expire at: ".$suspend->ExpireDate."!");
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '<?php echo Config::$URL  ?>';</script>";

}
}

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','You are suspended by'.$suspend->AdminName.' permanently. Reason: '.$suspend->Reason.The user or password is incorrect','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$account->name."';</script>";

}

}
/* - - - */ 

/* - - - */ 

        }
        
        echo "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','The user or password is incorrect','error')};</script>";

    } 
    ?>     
              <div style="width: 60%; margin-left:24%;" class="row card has-shadow">
			<div class="col-lg-12">
                    <div class="card-body">
                      <form method="POST">
                        <div class="form-group">
                          <label class="form-control-label">Username</label>
                          <input type="text" class="form-control" name="username" required>
                        </div>
                        <div class="form-group">       
                          <label class="form-control-label">Password</label>
                          <input type="password" class="form-control" name="password" required>
                        </div>
                        <div class="form-group">       
                          <input type="submit" value="Login" class="btn btn-primary btn-block" name="login">
                          <br>
                               <p style="text-align:center;">Forgot your password? Click <a href="<?php echo Config::$URL ?>recovery">here</a>.</p>
                        </div>
                      </form>
                    </div>
                </div>
              </div>

 

  • Haha 1

Graphic Designer

HTML/CSS/PHP Developer

Nimic

Link to comment
Share on other sites

  • 2 months later...
On 9/2/2023 at 8:01 PM, Robyx.exe said:

Nu stiu daca am voie sa postez aici, in fine.
Am o problema la un panel la login, in baza de date parolele sunt criptate dar in panel cand dai login iti spune ca parola e incorecta, din ce am inteles eu cu mintea mea de gaina e problema de la login.p.php unde codu nu citeste parolele criptate.

V-am lasat codul mai jos, mersi de ajutor.

<?php if(Config::isLogged()) { ?>
<?php 
$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Succes','You are logged in!','error');}</script>";
$_SESSION['AlertTime'] = time();
?>
<script>window.location.href = '<?php echo Config::$URL  ?>';</script>
<?php die(); } ?>

            
<?php if(isset($_POST['login'])) {
    $username = Config::antiXSS($_POST['username']);
  $password = Config::antiXSS(md5($_POST['password']));
    $passwordno = Config::antiXSS($_POST['password']);
  date_default_timezone_set('Europe/Bucharest');
$timex = time();
    if(!$username || !$password) {
      echo General::alertView("danger","Complete all fields (name / password).");
    } else {
        $kenny = Config::$g_con->prepare('SELECT * FROM `users` WHERE `name` = ? AND `password` = ?');
        $kenny->execute(array($username,$passwordno));
        if($kenny->rowCount()) {
            $account = $kenny->fetch(PDO::FETCH_OBJ);

if ($checksuspend == 0) { 

unset($_SESSION['pin_session']); // REMOVE SESSION PIN 

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Succes','You have successfully logged in.','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$account->name."';</script>";

$_SESSION['login_session'] = $account->id; // ADD SESSION LOGIN

} else { 

if ($suspend->Permanent == 0) { 
if ($suspend->ExpireDate < date('Y-m-d H-i', $timex)) {   

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','Your suspend has expired, congrats!','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$data->name."';</script>";

$_SESSION['login_session'] = $account->id; // ADD SESSION LOGIN

} else { 

$_SESSION['HomeAlert'] = Config::alertView("danger","You are suspended by ".$suspend->AdminName." for ".$suspend->Days." days. Reason: ".$suspend->Reason.". Expire at: ".$suspend->ExpireDate."!");
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '<?php echo Config::$URL  ?>';</script>";

}
}

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','You are suspended by'.$suspend->AdminName.' permanently. Reason: '.$suspend->Reason.The user or password is incorrect','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$account->name."';</script>";

}

}
/* - - - */ 

/* - - - */ 

        }
        
        echo "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','The user or password is incorrect','error')};</script>";

    } 
    ?>     
              <div style="width: 60%; margin-left:24%;" class="row card has-shadow">
			<div class="col-lg-12">
                    <div class="card-body">
                      <form method="POST">
                        <div class="form-group">
                          <label class="form-control-label">Username</label>
                          <input type="text" class="form-control" name="username" required>
                        </div>
                        <div class="form-group">       
                          <label class="form-control-label">Password</label>
                          <input type="password" class="form-control" name="password" required>
                        </div>
                        <div class="form-group">       
                          <input type="submit" value="Login" class="btn btn-primary btn-block" name="login">
                          <br>
                               <p style="text-align:center;">Forgot your password? Click <a href="<?php echo Config::$URL ?>recovery">here</a>.</p>
                        </div>
                      </form>
                    </div>
                </div>
              </div>

 

salut, depinde ce criptare ai la parole la gamemode ul pe care il folosesti, daca folosesti cumva md5, inlocuieste codul tau pe care ni l-ai trimis, cu asta
 

```

<?php if(Config::isLogged()) { ?>
<?php 
$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Succes','You are logged in!','error');}</script>";
$_SESSION['AlertTime'] = time();
?>
<script>window.location.href = '<?php echo Config::$URL  ?>';</script>
<?php die(); } ?>

            
<?php if(isset($_POST['login'])) {
    $username = Config::antiXSS($_POST['username']);
  $password = Config::antiXSS(md5($_POST['password']));
    $passwordno = Config::antiXSS($_POST['password']);
  date_default_timezone_set('Europe/Bucharest');
$timex = time();
    if(!$username || !$password) {
      echo General::alertView("danger","Complete all fields (name / password).");
    } else {
        $kenny = Config::$g_con->prepare('SELECT * FROM `users` WHERE `name` = ? AND `password` = ?');
        $kenny->execute(array($username,md5($passwordno));
        if($kenny->rowCount()) {
            $account = $kenny->fetch(PDO::FETCH_OBJ);

if ($checksuspend == 0) { 

unset($_SESSION['pin_session']); // REMOVE SESSION PIN 

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Succes','You have successfully logged in.','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$account->name."';</script>";

$_SESSION['login_session'] = $account->id; // ADD SESSION LOGIN

} else { 

if ($suspend->Permanent == 0) { 
if ($suspend->ExpireDate < date('Y-m-d H-i', $timex)) {   

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','Your suspend has expired, congrats!','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$data->name."';</script>";

$_SESSION['login_session'] = $account->id; // ADD SESSION LOGIN

} else { 

$_SESSION['HomeAlert'] = Config::alertView("danger","You are suspended by ".$suspend->AdminName." for ".$suspend->Days." days. Reason: ".$suspend->Reason.". Expire at: ".$suspend->ExpireDate."!");
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '<?php echo Config::$URL  ?>';</script>";

}
}

$_SESSION['HomeAlert'] = "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','You are suspended by'.$suspend->AdminName.' permanently. Reason: '.$suspend->Reason.The user or password is incorrect','error');}</script>";
$_SESSION['AlertTime'] = time();
echo "<script>window.location.href = '".Config::$URL ."profile/".$account->name."';</script>";

}

}
/* - - - */ 

/* - - - */ 

        }
        
        echo "<script>setTimeout(myFunction, 10);function myFunction() {swal('Error','The user or password is incorrect','error')};</script>";

    } 
    ?>     
              <div style="width: 60%; margin-left:24%;" class="row card has-shadow">
            <div class="col-lg-12">
                    <div class="card-body">
                      <form method="POST">
                        <div class="form-group">
                          <label class="form-control-label">Username</label>
                          <input type="text" class="form-control" name="username" required>
                        </div>
                        <div class="form-group">       
                          <label class="form-control-label">Password</label>
                          <input type="password" class="form-control" name="password" required>
                        </div>
                        <div class="form-group">       
                          <input type="submit" value="Login" class="btn btn-primary btn-block" name="login">
                          <br>
                               <p style="text-align:center;">Forgot your password? Click <a href="<?php echo Config::$URL ?>recovery">here</a>.</p>
                        </div>
                      </form>
                    </div>
                </div>
              </div>

```

l2p > above all

Link to comment
Share on other sites

  • 2 months later...
Guest
This topic is now closed to further replies.

About Us ABOUT US

L2P.RO este un site web dedicat comunității de gaming din România, care oferă resurse și informații utile pentru dezvoltatorii de jocuri și jucătorii de jocuri precum SAMP (San Andreas Multiplayer) și alte jocuri.

General IMPORTANT LINKS

Colors Chose your color

Header Backgrounds Chose your background

Styles Chose your style

Index Options Chose index options

2
3
Subforum Columns You can choose how many columns to display your subforums

Overall Options Chose overall options

Header Style Choose between a colored or black/white header
Header Position Choose between a relative or sticky header position
Sidebar Visibility You can hide or unhide your sidebar whenever you want
Back To Top Position You can choose where the back to top button should appear, left or right

×
×
  • Create New...