Blame view

modules/default/controller/loginController.php 825 Bytes
8d65d0ce   andryeyev   init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  <?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(){
  
  }
  
  }
  ?>