<?php
/**
 * Copy Right IJH.CC
 * Each engineer has a duty to keep the code elegant
 * $Id$
 */
if(!defined('__CORE_DIR')){
    exit("Access Denied");
}


// 商户登录验证

class Ctl_XiChe_Mcenter_Login extends Ctl
{
   public $staff = array();

   // 载入登录表单
   public function index()
   {    
        // 判断是否有登录标识
        //$aunt = K::M('staff/aunt')->check_login();
		$this->tmpl = 'xiche/mcenter/login.html';  
   }

   // 登录提交判断
   public function login()
   {  

        $u = $this->GP('u');
        $p = $this->GP('p');
        $login = K::M('staff/staff')->login($u, $p, $l=null, $ismd5=false, $keep=false);
   
        if($login) {
            $this->msgbox->add("师傅，欢迎您!登录成功！");
            $this->msgbox->response();
        }else {
            $this->msgbox->add("登录失败！",201);
            $this->msgbox->response();
        }
 
   }
   
   // 退出登录
   public function loginout(){
       $out = K::M('staff/staff')->loginout();
   }
}

