loginController.php 825 Bytes
<?php

Class LoginController Extends baseController {

//protected $_navig = array('name'=>"info");

public function index()
{
	if ($_SERVER["REQUEST_METHOD"] == "POST") {
		$people = new People($this->lang);
		$this->error = $people->login($this->postParam);
		if(!$this->error){
		 $_SESSION["people"] = array("login"=>$this->postParam['login'],"psw"=>$this->postParam['psw']);
		 Redirect($this->url.'/people/login_ok/');
		}
	}
}

public function reg(){
  if ($_SERVER["REQUEST_METHOD"] == "POST") {
     $people = new People($this->lang);
	 $this->error = $people->valid($this->postParam,$_FILES);
     if(!$this->error){
      $people_id = $people->save($this->postParam,$_FILES);
	  $people->sendLoginPswPeople($people_id);
      Redirect($this->url.'/login/reg_ok/');
     }
  }
}

public function reg_ok(){

}

}
?>