This repository has been archived on 2020-05-04. You can view files and clone it, but cannot push or open issues or pull requests.
phunk/application/classes/controller/login.php
Alexander Yakovlev b7f2f24e23 The beginning
It works;
that's all I need
for the initial commit.
2012-07-02 19:38:50 +07:00

15 lines
548 B
PHP

<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Login extends Controller_Template {
public $template = 'login';
public function action_view() {
if(Auth::instance()->logged_in()) return $this->request->redirect('');
if ($_POST){
$user = ORM::factory('user');
$status = Auth::instance()->login($this->request->post('login'), $this->request->post('password'));
if ($status) return $this->request->redirect('');
else $this->template->error = "Неверный логин или пароль.";
}
}
}