· 8 years ago · Apr 22, 2018, 07:12 PM
1<?php
2
3if($_SESSION["LANG_PREF"]) {
4
5 if(!$_GET['rob']) { header("Location: do.login"); exit; }
6 require_once("contents/".$_SESSION["LANG_PREF"]."/logowanie.lng.php");
7
8 class logowanie extends Mod {
9
10 function __construct()
11 {
12 $this->__do();
13 }
14
15 /** ==================================================================================
16 * @Logowanie na swoje konto
17 */
18 function do_login() {
19
20 global $lang;
21 $lang['title'] = $lang['menu']['login'];
22 $this->tpl = "login_tpl/login_log_form.tpl";
23 $browser = @get_browser(null, true);
24 if(!strstr($_SERVER['HTTP_USER_AGENT'],"Firefox"))
25 $GLOBALS['doit']['browser'] = 1;
26
27 if($_POST['hognet_login_submit']) {
28 $this->login = trim($_POST['hognet_kto']);
29 $this->pass = trim($_POST['hognet_pas']);
30 $this->login_start($this->login, $this->pass);
31 }
32 }
33
34 /** ==================================================================================
35 * @akcja - Logowanie na swoje konto
36 */
37 function login_start($l,$p) {
38 if($l && $p) {
39 $pyt = "SELECT id, pass FROM user WHERE login='".$l."';";
40 $this->login_check = $GLOBALS['sql']->fetch_array($pyt, __FILE__, __LINE__);
41
42 if($this->login_check['id']) {
43 require_once(LIB."class.crypt.php");
44 $enc = new crypt;
45 if($enc->encrypt($conf['key1'] , $p) == $this->login_check['pass'])
46 {
47 echo "jaaaa".timepl();
48 }
49 }
50
51 }
52 }
53
54 }
55
56 $login = new logowanie();
57
58try
59 {
60 $tpl = new optClass;
61 $tpl -> loadConfig($config);
62 $tpl -> httpHeaders(OPT_HTML);
63
64 $tpl -> assign('lang', $lang);
65 $tpl -> assign('doit', $doit);
66 $tpl -> assign('news', $news);
67
68 $tpl -> parse('login_tpl/login_head.tpl');
69 $tpl -> parse($login->load_tpl());
70 $tpl -> parse('login_tpl/login_foot.tpl');
71 }
72 catch(optException $exception)
73 {
74 optErrorHandler($exception);
75 }
76
77
78} else { echo "error, report it to admin: szarik +@+ gmail.com]"; }
79?>