www.gusucode.com > 同城苏州黄页系统php源码程序 > login.php
<? include('start.php') ; include($root_path.'lib/login.class.php'); ########################################### # 系统禁止登陆 /*if( @$_REQUEST['submit'] ) { $user_type = str_replace( 'usr_', '', $_REQUEST['user_type'] ); if( in_array( $user_type, array('webmaster','adcustomer') ) and !(bool)getSystem( $user_type.'_login' ) ) { # 载入并初始化相关的网页类 if( !class_exists('err_report') ) include_once("{$root_path}lib/err_report.class.php"); $noPower = & new err_report( 'main-frame.html' ) ; $noPower->set_err( '系统目前禁止用户登录。', getSystem( "{$user_type}_login_close_reason" ), '登陆已被禁止' ); $noPower->display_err(); } }*/ $me =& new login(); $me->check_verifycode = false ; $me->title = '用户登陆' ; //$me->max_failed_turn = 5 ; $me->set_user_type( 'yp_admin', 'user', 'password', '管理员', '/admin/list.php', 'is_open', 'last_login_ip', 'last_login_time' ); $me->act() ; $me->save_log() ; $me->display_me('main-frame.html','login.html'); ?> <? ## 事件 ############################ function OnLoginSuccessed( $me ) { // pp($_SESSION); switch ($me->fields['user_type']->value) { case 'admin': break ; case 'user': break ; } $_SESSION['login_time'] = time() ; $_SESSION['last_action'] = time() ; } function OnLoginFailed( $me ) { // $me->bad(); } ?>