kolejna partia drobniejszych zmian (wciąż możliwe, że zacommitowany watermelon nie...
[watermeloncms.git] / wtrmln / modules / controllers / login.php
blob7b6e3c8e000f93b8f741c973fd1e243e12ecb4c0
1 <?php
2 /********************************************************************
4 Watermelon CMS
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()
27 parent::Controller();
31 * stronka z formularzem logowania
34 function Index()
36 if(!$this->user->isLoggedIn())
38 setH1('Logowanie');
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');
44 else
46 echo $this->load->view('login_youareloggedin');
51 * samo logowanie
54 function Submit()
56 if($this->user->isLoggedIn())
58 echo $this->load->view('login_youareloggedin');
59 return;
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');
83 * wylogowanie
86 function Logout()
88 $this->user->logout();
90 echo $this->load->view('login_loggedout');
94 * przysyłanie nowego hasła (walidacja itd.)
97 function SendNewPasswordSubmit()
99 //TODO