panel admina
[watermeloncms.git] / wtrmln / modules / controllers / login.php
blob0d147ffbf3f94df2515db51ca6bf6f1f45aabe6a
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
26 * stronka z formularzem logowania
29 function Index()
31 if(!$this->user->isLoggedIn())
33 setH1('Logowanie');
35 $this->addMeta('<style type="text/css">.loginform{text-align:left}.loginform label{float:left;width:130px;display:block}</style>');
37 echo $this->load->view('login_form');
39 else
41 echo $this->load->view('login_youareloggedin');
46 * samo logowanie
49 function Submit()
51 if($this->user->isLoggedIn())
53 echo $this->load->view('login_youareloggedin');
54 return;
57 $login = $_POST['login'];
58 $pass = $_POST['password'];
59 $autologin = isset($_POST['autologin']);
61 $this->user->Login($login, $pass, $autologin);
65 * formularz przysłania nowego hasła
68 function SendNewPassword()
70 setH1('Formularz wysyłania nowego hasła');
72 $this->addMeta('<style type="text/css">.sendpassform label{float:left;width:160px;display:block}</style>');
74 echo $this->load->view('login_sendnewpassword');
78 * wylogowanie
81 function Logout()
83 $this->user->logout();
85 siteredirect('msg:login_loggedout');
89 * przysyłanie nowego hasła (walidacja itd.)
92 function SendNewPasswordSubmit()
94 //TODO