2 /********************************************************************
6 Copyright 2008-2009 Radosław Pietruszewski
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 ********************************************************************/
23 class Login
extends Controller
25 function __construct()
31 * stronka z formularzem logowania
36 if(!$this->user
->isLoggedIn())
40 $this->addMeta('<style type="text/css">.loginform{text-align:left}.loginform label{float:left;width:130px;display:block}</style>');
42 echo $this->load
->view('login_form');
46 echo $this->load
->view('login_youareloggedin');
56 if($this->user
->isLoggedIn())
58 echo $this->load
->view('login_youareloggedin');
62 $login = $_POST['login'];
63 $pass = $_POST['password'];
64 $autologin = isset($_POST['autologin']);
66 $this->user
->Login($login, $pass, $autologin);
70 * formularz przysłania nowego hasła
73 function SendNewPassword()
75 setH1('Formularz wysyłania nowego hasła');
77 $this->addMeta('<style type="text/css">.sendpassform label{float:left;width:160px;display:block}</style>');
79 echo $this->load
->view('login_sendnewpassword');
88 $this->user
->logout();
90 echo $this->load
->view('login_loggedout');
94 * przysyłanie nowego hasła (walidacja itd.)
97 function SendNewPasswordSubmit()