<?php session_start(); ?>
<?php
$_SESSION['pass'] = FALSE; //定义认证通过环境session环境变量
$time = date('Hi');
?>
<?php //证书上传,这里规定任何开发的网站它的证书必须上传到安全服务平台所在目录下的upload子目录里
$uploaddir = '/var/www/websecurity/upload/';
$fName = $_FILES['userfile']['name'];
$fSize = $_FILES['userfile']['size'];
$fType = $_FILES['userfile']['type'];
$error = $_FILES['userfile']['error'];
$password = $_POST['pswd'];
$_SESSION['password'] = $_POST['pswd'];
$date = date('YmdHis'); //获取当前时间,秒为单位
$action_authorizer = ""; //保存主体公钥
$sigver = FALSE;
$assertypt = "";
list($usec, $sec) = explode(" ",microtime());
$date = $date.(int)($usec*1000);//构造毫妙为单位的时间
$action_tmp_dir = "temp/act$date.tmp";
$upload = FALSE;
if($fName != "")
{
if($fSize > 0 && $fSize <= 30000)
{
if($fType == "chemical/x-cerius" || $fType == "application/x-x509-ca-cert")
{
$newName="cre".$date."."."cer";
$uploadfile = $uploaddir.$newName; //以时间格式重新命名证书名
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)){
//证书名称放到session中
$_SESSION['certname'] = $newName;
$upload = TRUE;
}
else
$upload = FALSE;
}
else
{
$upload = FALSE;
echo "错误: 证书类型错误";
}
}
else
{
$upload = FALSE;
echo "错误:文件大小必须在0到30000字节之间";
}
}
else
{
$upload = FALSE;
echo "请上传正确的证书!";
}
if($upload){//如果上传成功,则利用我们提供的验证服务接口
//echo $newName;
$verifycom = "../websecurity/rbackeynote bank ".$newName." ".$password." Login";
exec($verifycom,$outva,$retval);
if($outva[0]=="true"){//验证成功
//根据角色进入不同的界面
$verifycom = "../websecurity/certkeynote ".$newName." ".$password." role";
//echo $verifycom;
exec($verifycom,$outva1,$retval1);
$role = $outva1[0];
//echo $role;
if($role=="manager")
echo '<meta http-equiv="refresh" content="0; url=roles/manager.php">';
else if($role=="staff")
echo '<meta http-equiv="refresh" content="0; url=roles/staff.php">';
else if($role=="customer")
echo '<meta http-equiv="refresh" content="0; url=roles/customer.php">';
}else{
$_SESSION['msg'] = "无法登录银行系统,请确认你的证书和密码!.";
echo '<meta http-equiv="refresh" content="0; url=message/err.php">';
}
}
?>
bank.rar_信任_银行管理c++_银行系统
版权申诉
190 浏览量
2022-09-22
19:03:53
上传
评论
收藏 18KB RAR 举报
weixin_42651887
- 粉丝: 80
- 资源: 1万+
评论0