⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.php

📁 flashget43的源代码 一个比较常用的下载程序
💻 PHP
字号:
<?php

include_once('init.php');

$error = '';

function doLogin($userid) {
	global $smarty;
	$_SESSION['userid'] = $userid;
	include('index.php');
	exit;
}

if(($userid = ChatServer::isLoggedIn()) && ChatServer::userInRole($userid, ROLE_ADMIN)) 
{
	doLogin($userid);
} else {
	$_SESSION['userid'] = null;
}	

if(isset($_REQUEST['do'])) {
	if(($userid = ChatServer::login($_REQUEST['login'], $_REQUEST['password'])) && ChatServer::userInRole($userid, ROLE_ADMIN)) {
		doLogin($userid);
	} else {
		$_SESSION['userid'] = null;
		$error = 'Could not grant admin role for this login and password.';
	}
} else {
	$_SESSION['userid'] = null;
	$_REQUEST['login'] = '';
	$_REQUEST['password'] = '';
}

$installed = isInstalled();
if( !$installed ) 
{
	$_SESSION['userid'] = null;
	$error = 'FlashChat is not installed.';
}
 
//Assign Smarty variables and load the admin template
$smarty->assign('error',$error);
$smarty->assign('installed',$installed);
$smarty->display('login.tpl');

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -