<?php
/**
 * 登录模块
 * @copyright reginx.com
 * $Id: login.mod.php 7 2013-01-24 00:30:29Z reginx $
 */
class login_mod extends mod {

    /**
     * 登录
     *
     */
    public function indexAct(){
        $this->settpldir('default');
        $this->conf['mod_msg']  = 'cpmsg.html';
        if(isset($_POST['verify'])){
            if(!$this->vcode()){
                $this->showmsg('验证码错误' , null , true , 2);
            }
            $obj = core::getobj('admin_tab');
            if($obj->load('adm')){
                $obj->data['passwd'] = str_replace('&amp;' , '&' , $obj->data['passwd']);
                if(($row = $obj->chklogin()) != false){
                    $this->sobj->set('admin' , $row);
                    $this->redirect('index');
                }else{
                    $this->showmsg('帐号或密码错误' , null , 1 , 2);
                }
            }else{
                $this->showmsg($obj->geterr() , null , true , 2);
            }
        }
        $this->display('login.html');
    }
}
?>