source: pages/login.php

Last change on this file was 1, checked in by george, 16 years ago

Prvnotní import původních kódů z wowresource.

File size: 1.1 KB
Line 
1<?php
2if (isset($posted['login']))
3 {
4 $loaded = $db->query_fetch_assoc('SELECT `id`,`ban` FROM `users` WHERE (`name`="'.$posted['login'].'" AND `password` = "'.sha1($posted['password']).'" AND `active`=1)');
5 if (empty($loaded))
6 {
7 $tpl->output['name'] = $posted['login'];
8 $tpl->output['error'] = '<span class="error">'.$text['wrong_pass'].'</span>';
9 $tpl->output['botom'] = '';
10 }
11 else
12 {
13 if ($loaded['ban']==1)
14 {
15 $tpl->output['name'] = $posted['login'];
16 $tpl->output['error'] = '<span class="error">'.$text['banned'].'</span>';
17 $tpl->output['botom'] = '';
18 }
19 else
20 {
21 $_SESSION['id'] = $loaded['id'];
22 $tpl->output['error'] = '<span class="success" style="margin-top: 10px">'.$text['loging_ok'].'</span>';
23 $tpl->output['error'] .= '<script type="text/javascript"> opener.location.reload(); window.setTimeout("self.close()", 3000); </script><div style="display: none">';
24 $tpl->output['botom'] = '</div>';
25 }
26 }
27 }
28else
29 {
30 $tpl->output['name']='Login';
31 $tpl->output['error'] = '';
32 $tpl->output['botom'] = '';
33 }
34?>
Note: See TracBrowser for help on using the repository browser.