Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['login_submit']) && !Config::isLogged()) {
- if(strlen($_POST['username']) && strlen($_POST['password']))
- {
- $wcodero = Config::$g_con->prepare('SELECT `id`,`IP` FROM `users` WHERE `name` = ? AND `password` = ?');
- $wcodero->execute(array($_POST['username'],$_POST['password']));
- if($wcodero->rowCount()) {
- $account = $wcodero->fetch(PDO::FETCH_OBJ);
- $c = Config::$g_con->prepare("SELECT `Text` FROM `wcode_editables` WHERE `Form` = 'login' AND `Text` = 'secured'"); $c->execute();
- if($c->rowCount()) {
- if($account->IP == $_SERVER['REMOTE_ADDR']) {
- Config::createSN("success","You've been logged in with success!");
- $_SESSION['account_panel'] = $account->id;
- } else Config::createSN("info","Your IP must be the same as the one you had last time in game!"); //nu apare mesajul
- } else {
- Config::createSN("success","You've been logged in with success!");
- $_SESSION['account_panel'] = $account->id;
- }
- }
- else Config::createSN("danger","Please provide valid username and password!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement