base
This commit is contained in:
@@ -0,0 +1 @@
|
||||
ktsh - 5rhkswp0ktsh - 5rhkswp0huibong - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 28eb83b5adb2a1bc6f991ed14186bd23ktsh - 5rhkswp0ktsh - 28eb83b5adb2a1bc6f991ed14186bd23ktsh - check1ktsh - check2ktsh - 5rhkswp0ktsh - 28eb83b5adb2a1bc6f991ed14186bd23ktsh - check1ktsh - check2ktsh - 5rhkswp0ktsh - 28eb83b5adb2a1bc6f991ed14186bd23ktsh - check1ktsh - check2ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - ktsh!@#ktsh - 5rhkswp0ktsh - 5rhkwp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhskwp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkkspw)ktsh - 5rhkswp)ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkwp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - 5rhkswp0ktsh - ktsh!@#ktsh - ktsh!@#ktsh - 5rhkswp0
|
||||
@@ -0,0 +1,373 @@
|
||||
<?
|
||||
// 문서루트 경로
|
||||
$DOC_ROOT = "http://".$_SERVER['SERVER_ADDR']."/status";
|
||||
|
||||
// 라이브러리 경로
|
||||
$LIB_PATH = "/user2/service/opendisk_lib";
|
||||
|
||||
// 외부호출할 실행파일 경로
|
||||
$BIN_PATH = "/user2/service/bin";
|
||||
$VOLUME_MANAGER_FIME_NAME = "service_manager";
|
||||
$BACKUP_MANAGER_FILE_NAME = "db_process";
|
||||
|
||||
// 삭제한 볼륨로그를 저장할 경로
|
||||
$VOLUME_REMOVE_LOG_PATH = "/user2/service/httpd/htdocs/sms/log";
|
||||
|
||||
// RRD 데이터베이스를 write하고 이미지를 생성해 놓을 경로.
|
||||
$RRD_WRITE_PATH = "/user/service/opendisk_rrd";
|
||||
$RRD_IMG_WRITE_PATH = "/user/httpd/htdocs/sms/rrdimg";
|
||||
|
||||
// RRD공유라이브러리를 명시적으로 로딩할 것인가 아닌가 플래그
|
||||
$RRD_LOAD_SO = 1;
|
||||
|
||||
// 쿠키 암호화 여부 플래그
|
||||
$COOKIE_CRYPT_ENABLE = 0;
|
||||
|
||||
// 디비백업파일이 존재하는 경로
|
||||
$BACKUP_FILE_PATH = "/user2/service/db_download";
|
||||
|
||||
// html 페이지 타이틀
|
||||
$HTML_PAGE_TITLE = "OpenDisk Cluster Administration";
|
||||
|
||||
// 코드 (관리자레벨)
|
||||
$CODE_ADMIN_TYPE = array();
|
||||
$CODE_ADMIN_TYPE[0][0] = "AT01";
|
||||
$CODE_ADMIN_TYPE[0][1] = "전체관리자";
|
||||
$CODE_ADMIN_TYPE[1][0] = "AT02";
|
||||
$CODE_ADMIN_TYPE[1][1] = "일반관리자";
|
||||
|
||||
// 코드 (이벤트)
|
||||
$CODE_EVENT_TYPE = array();
|
||||
$CODE_EVENT_TYPE[0][0] = "EV01";
|
||||
$CODE_EVENT_TYPE[0][1] = "관리작업";
|
||||
$CODE_EVENT_TYPE[1][0] = "EV02";
|
||||
$CODE_EVENT_TYPE[1][1] = "시스템장애";
|
||||
$CODE_EVENT_TYPE[2][0] = "EV03";
|
||||
$CODE_EVENT_TYPE[2][1] = "용량경고";
|
||||
$CODE_EVENT_TYPE[3][0] = "RAID";
|
||||
$CODE_EVENT_TYPE[3][1] = "RAID 이벤트 ";
|
||||
|
||||
/**
|
||||
* 볼륨관련 커맨드를 실행한다.
|
||||
*
|
||||
* @param ManageType 769:볼륨추가, 770:볼륨변경, 771:볼륨삭제
|
||||
* @param VolumeSeq 추가할 볼륨의 데이터베이스테이블시퀀스
|
||||
*
|
||||
* @return "1" 동작 성공시
|
||||
* @return "some reason" 동작 실패시 원인
|
||||
*/
|
||||
function ManageVolume( $ManageType, $VolumeSeq )
|
||||
{
|
||||
global $BIN_PATH;
|
||||
global $VOLUME_MANAGER_FIME_NAME;
|
||||
|
||||
$CMD = $BIN_PATH . "/" . $VOLUME_MANAGER_FIME_NAME . " " . "$ManageType" . " " . "$VolumeSeq";
|
||||
|
||||
//echo $CMD;exit;
|
||||
if( !$FileHandle = popen("$CMD", "r") )
|
||||
{
|
||||
return "error: process fork failed";
|
||||
}
|
||||
while( !feof($FileHandle) )
|
||||
{
|
||||
$output .= fgets( $FileHandle, 1024 );
|
||||
}
|
||||
pclose( $FileHandle );
|
||||
|
||||
// 커맨드를 실행하여 성공이면 1을 반환하고 그외에는 모두 실패로 간주한다.
|
||||
if( $output == "SUCCESS\n" )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 백업관련 커맨드를 실행한다.
|
||||
*
|
||||
* @param ManageType 'backup':볼륨별개별백업, 'backupall':전체볼륨백업
|
||||
* @param DBIP 백업할 DB서버의 IP
|
||||
* @param Port 백업할 DB서버의 PORT
|
||||
* @param VolumeSeq 개별볼륨백업일때 그 볼륨의 시퀀스
|
||||
*
|
||||
* @return "1" 동작 성공시
|
||||
* @return "some reason" 동작 실패시 원인
|
||||
*/
|
||||
function ManageBackup( $ManageType, $DBIP, $Port, $VolumeSeq, $VolumName)
|
||||
{
|
||||
global $BIN_PATH;
|
||||
global $BACKUP_MANAGER_FILE_NAME;
|
||||
$CMD = $BIN_PATH . "/" . $BACKUP_MANAGER_FILE_NAME . " " . "$ManageType" . " " . "$DBIP" . " " . "$Port" . " " ."$VolumeSeq". " " .$VolumName;
|
||||
|
||||
//echo $CMD; exit;
|
||||
if( !$FileHandle = popen("$CMD", "r") )
|
||||
{
|
||||
return "error: process fork failed";
|
||||
}
|
||||
while( !feof($FileHandle) )
|
||||
{
|
||||
$output .= fgets( $FileHandle, 1024 );
|
||||
}
|
||||
pclose( $FileHandle );
|
||||
|
||||
// 커맨드를 실행하여 성공이면 1을 반환하고 그외에는 모두 실패로 간주한다.
|
||||
if( $output == "SUCCESS\n" )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 용량단위변환 : 메가바이트 -> 기가바이트 단위로 변환 (1024 M = 1G)
|
||||
*/
|
||||
function StorageUnit_GB( $value )
|
||||
{
|
||||
return sprintf("%.2fGB", trim($value) / 1024);
|
||||
}
|
||||
|
||||
/**
|
||||
* 용량단위변환 : 메가바이트 -> 기가/테라바이트 단위로 변환
|
||||
*/
|
||||
function StorageUnit( $value )
|
||||
{
|
||||
if( trim($value) / 1024 > 1024 )
|
||||
return sprintf("%.2fTB", trim($value) / 1024 / 1024);
|
||||
else
|
||||
return sprintf("%.2fGB", trim($value) / 1024);
|
||||
}
|
||||
|
||||
/**
|
||||
* 트래픽단위변환 : 바이트 -> 메가바이트 단위로 변환
|
||||
*/
|
||||
function TrafficUnit( $value )
|
||||
{
|
||||
return sprintf("%.2f", trim($value) / 1000 / 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* html 헤더태그를 생성
|
||||
*
|
||||
* @param ScriptPath 스크립트가 있을 경우 그 파일명
|
||||
*/
|
||||
function PrintHtmlHeader( $ScriptPath )
|
||||
{
|
||||
global $DOC_ROOT;
|
||||
global $HTML_PAGE_TITLE;
|
||||
|
||||
echo "<head>";
|
||||
echo "<title>$HTML_PAGE_TITLE</title>";
|
||||
echo "<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=euc-kr\">";
|
||||
echo "<link href=\"$DOC_ROOT/css/style.css\" rel=\"stylesheet\" type=\"text/css\">";
|
||||
if( $ScriptPath != "" )
|
||||
echo "<script language=\"javascript\" type=\"text/javascript\" src=\"$ScriptPath\"></script>";
|
||||
echo "<style>BODY,TABLE,TR,TD {font-size:12px;}select{behavior: url('".$DOC_ROOT."/css/selectbox.htc');}TD{line-height:150%;}</style>";
|
||||
echo "</head>";
|
||||
}
|
||||
|
||||
/**
|
||||
* 코드값을 저장하는 셀렉트박스 태그를 생성
|
||||
*
|
||||
* @param arrCode 코드값을 저장한 배열명
|
||||
* @param selectedvalue selected 옵션을 삽입할 value값
|
||||
*/
|
||||
function PrintCodeSelectOption( $arrCode, $selectedvalue )
|
||||
{
|
||||
for( $i = 0; $i < sizeof($arrCode); $i++ )
|
||||
{
|
||||
if( $arrCode[$i][0] == $selectedvalue )
|
||||
echo "<option value='" . $arrCode[$i][0] . "' selected>" . $arrCode[$i][1];
|
||||
else
|
||||
echo "<option value='" . $arrCode[$i][0] . "'>" . $arrCode[$i][1];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 셀렉트박스 태그를 생성
|
||||
*
|
||||
* @param type YYYY/MM/DD 중의 하나
|
||||
* @param name 셀렉트태그의 이름속성
|
||||
* @param start 시작할 값
|
||||
* @param end 끝 값
|
||||
* @param selectedvalue 어떤 값을 선택상태로 할 것인가 지정
|
||||
*/
|
||||
function PrintSelectbox( $type, $name, $start, $end, $selectedvalue )
|
||||
{
|
||||
switch( $type )
|
||||
{
|
||||
case "YYYY":
|
||||
echo "<select name='$name' style='width:60; height=19'>";
|
||||
for( $i = $start; $i < ($end + 1); $i++ )
|
||||
{
|
||||
if( $i == $selectedvalue )
|
||||
echo "<option value='$i' selected>$i";
|
||||
else
|
||||
echo "<option value='$i'>$i";
|
||||
}
|
||||
echo "</select> 년 ";
|
||||
break;
|
||||
|
||||
case "MM":
|
||||
echo "<select name='$name' style='width:45; height=19'>";
|
||||
for( $i = $start; $i < ($end + 1); $i++ )
|
||||
{
|
||||
if( $i == $selectedvalue )
|
||||
echo "<option value='$i' selected>$i";
|
||||
else
|
||||
echo "<option value='$i'>$i";
|
||||
}
|
||||
echo "</select> 월 ";
|
||||
break;
|
||||
|
||||
case "DD":
|
||||
echo "<select name='$name' style='width:45; height=19'>";
|
||||
for( $i = $start; $i < ($end + 1); $i++ )
|
||||
{
|
||||
if( $i == $selectedvalue )
|
||||
echo "<option value='$i' selected>$i";
|
||||
else
|
||||
echo "<option value='$i'>$i";
|
||||
}
|
||||
echo "</select> 일 ";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지박스를 호출
|
||||
*/
|
||||
function AlertMsg( $msg )
|
||||
{
|
||||
$msg = str_replace ("\n", "\\r", $msg);
|
||||
echo("<script language=\"javascript\">
|
||||
<!--
|
||||
alert('$msg');
|
||||
//-->
|
||||
</script>
|
||||
");
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지박스를 보여주고 이전페이지로 이동
|
||||
*/
|
||||
function AlertBack( $msg )
|
||||
{
|
||||
$msg = str_replace ("\n", "\\r", $msg);
|
||||
echo("<script language=\"javascript\">
|
||||
<!--
|
||||
alert('$msg');
|
||||
history.back();
|
||||
//-->
|
||||
</script>
|
||||
");
|
||||
}
|
||||
|
||||
/**
|
||||
* 쿠키값을 체크하여 정상적으로 로그인한 사용자인지 확인한 후 관리자레벨을 반환한다.
|
||||
* @return AdminLevel 1: 전체관리자레벨 2: 일반관리자레벨
|
||||
*/
|
||||
require_once( "crypt.inc" ); // 암호화 인터페이스
|
||||
function CheckCookie()
|
||||
{
|
||||
global $DOC_ROOT;
|
||||
global $CODE_ADMIN_TYPE;
|
||||
|
||||
if( isset($_COOKIE["cookie_admin_id"]) )
|
||||
{
|
||||
$CookieSEED = "skldfhoi40wyrf83yf0hs9efh8943yf9herf";
|
||||
$crypt = new cast128;
|
||||
$crypt->setkey( $CookieSEED );
|
||||
|
||||
if($COOKIE_CRYPT_ENABLE == 1){
|
||||
$dec_admin_id = $crypt->decrypt( base64_decode( $_COOKIE["cookie_admin_id"] ) );
|
||||
$dec_admin_name = $crypt->decrypt( base64_decode( $_COOKIE["cookie_admin_name"] ) );
|
||||
$dec_admin_type = $crypt->decrypt( base64_decode( $_COOKIE["cookie_admin_type"] ) );
|
||||
$dec_admin_email = $crypt->decrypt( base64_decode( $_COOKIE["cookie_admin_email"] ) );
|
||||
$dec_admin_phone = $crypt->decrypt( base64_decode( $_COOKIE["cookie_admin_phone"] ) );
|
||||
$dec_admin_sms_send = $crypt->decrypt( base64_decode( $_COOKIE["cookie_admin_sms_send"] ) );
|
||||
}else{
|
||||
$dec_admin_id = $_COOKIE["cookie_admin_id"] ;
|
||||
$dec_admin_name = $_COOKIE["cookie_admin_name"] ;
|
||||
$dec_admin_type = $_COOKIE["cookie_admin_type"] ;
|
||||
$dec_admin_email = $_COOKIE["cookie_admin_email"] ;
|
||||
$dec_admin_phone = $_COOKIE["cookie_admin_phone"] ;
|
||||
$dec_admin_sms_send = $_COOKIE["cookie_admin_sms_send"] ;
|
||||
}
|
||||
|
||||
if( $dec_admin_type == $CODE_ADMIN_TYPE[0][0] )
|
||||
return 1;
|
||||
else if( $dec_admin_type == $CODE_ADMIN_TYPE[1][0] )
|
||||
return 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($_REQUEST as $req_key => $req_val){
|
||||
if (!is_array ($_REQUEST[$req_key]))
|
||||
{
|
||||
if($req_key!='id'&&$req_key!='password'&&$req_key!='admintype')
|
||||
$get_str .= "$req_key=$req_val&";
|
||||
}
|
||||
}
|
||||
/***
|
||||
echo nl2br(print_r($_SERVER,true));exit;
|
||||
if($get_str!='')
|
||||
$get_str .= "HTTP_REFERER=".urlencode($_SERVER['HTTP_REFERER']);
|
||||
echo $_SERVER['HTTP_REFERER'];exit;
|
||||
****/
|
||||
|
||||
echo( "<META http-equiv='refresh' content='0; url=$DOC_ROOT/login/login.html?src_uri=".urlencode($_SERVER['REQUEST_URI'])."'>" );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 좌측메뉴를 구성하는 테이블을 생성한다.
|
||||
*
|
||||
* @param Title 좌측메뉴의 타이틀
|
||||
* @param submenu_exist 타이틀 아래에 서브메뉴를 추가할 것인가 아닌가
|
||||
* @param arr_submenu 추가할 서브메뉴의 텍스트를 저장한 배열
|
||||
* @param arr_submenulink 추가할 서브메뉴의 링크를 저장한 배열
|
||||
* @param SelectedIndex 서브메뉴들 중에 어느 것을 선택하게 할 것인가 그 배열인덱스
|
||||
*/
|
||||
function PrintLeftMenu( $Title, $submenu_exist, $arr_submenu, $arr_submenulink, $SelectedIndex )
|
||||
{
|
||||
?>
|
||||
<table width=100% border=0 cellpadding=0 cellspacing=0>
|
||||
<tr height=12>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr height=1>
|
||||
<td bgcolor="#B9B9B9"></td>
|
||||
</tr>
|
||||
<!-- menu title -->
|
||||
<tr height=30>
|
||||
<td align=center class="LeftMenuTitle">
|
||||
<?echo("$Title")?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr height=1>
|
||||
<td bgcolor="#B9B9B9"></td>
|
||||
</tr>
|
||||
<!-- submenu -->
|
||||
<?
|
||||
if( $submenu_exist == 1 )
|
||||
{
|
||||
for( $i = 0; $i < count($arr_submenu); $i++ )
|
||||
{
|
||||
if( $i == $SelectedIndex )
|
||||
echo("<tr height=30><td align=center class=LeftMenu bgcolor=#CDCDCD><a href='$arr_submenulink[$i]'>$arr_submenu[$i]</a></td></tr>");
|
||||
else
|
||||
echo("<tr height=30><td align=center class=LeftMenu><a href='$arr_submenulink[$i]'>$arr_submenu[$i]</a></td></tr>");
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,777 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Perfect Scripts class.pcrypt.php |
|
||||
// | Brazilian Organization |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Viva ao Linux! |
|
||||
// | Porque nós amamos a liberdade! |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Class Perfect Crypt |
|
||||
// | Created By Igor Ribeiro de Assis |
|
||||
// | <igor21@terra.com.br> UIN: 71064682 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | http://ps.wmforce.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Under GPL |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This program is free software; you can redistribute it and/or modify |
|
||||
// | it under the terms of the GNU General Public License as published |
|
||||
// | by the Free Software Foundation; either version 2 of the License, |
|
||||
// | or (at your option) any later version. |
|
||||
// | |
|
||||
// | This program is distributed in the hope that it will be useful, |
|
||||
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
// | GNU General Public License for more details. |
|
||||
// | |
|
||||
// | You should have received a copy of the GNU General Public License |
|
||||
// | along with this program; if not, write to the Free Software |
|
||||
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
|
||||
// | 02111-1307 USA |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
/**
|
||||
* Encryption Block Mode constants
|
||||
*
|
||||
* @const MODE_ECB ecb mode
|
||||
* @const MODE_CBC cbc mode
|
||||
*/
|
||||
define("MODE_ECB",0);
|
||||
define("MODE_CBC",1);
|
||||
|
||||
/**
|
||||
* An abstract layer class to encrypt data.
|
||||
*
|
||||
* This class is class is used to encrypt and decrypt data using different algorithms
|
||||
* and modes.
|
||||
*
|
||||
* @author Igor Ribeiro de Assis <igor21@terra.com.br>
|
||||
* @version 1.0-beta
|
||||
* @access public
|
||||
* @package Perfect Crypt
|
||||
*/
|
||||
|
||||
class cast128
|
||||
{
|
||||
/** Encryption Block Mode: ECB, CBC actually.
|
||||
*
|
||||
* @var int the mode used
|
||||
* @access private
|
||||
*/
|
||||
var $blockmode = MODE_CBC;
|
||||
|
||||
/** Key for Encryption
|
||||
*
|
||||
* @var string the key used in encryption and decryption
|
||||
* @access public
|
||||
*/
|
||||
var $key = null;
|
||||
|
||||
/** IV - Initialization Vector String
|
||||
*
|
||||
* @var string initialization vector for some modes (CBC)
|
||||
* @access public
|
||||
*/
|
||||
//var $iv = "z4c8e7gh";
|
||||
//var $iv = "z4c8e7gh";
|
||||
var $iv = null;// = "tsetsetstset";
|
||||
//var $iv = "Sts2Fj1E";
|
||||
|
||||
/** Methods */
|
||||
|
||||
/** Constructor of the class.
|
||||
*
|
||||
* The constructor initialize some important vars and include the algorithm
|
||||
* file.
|
||||
*
|
||||
* @access public
|
||||
* @param int $blockmode the blockmode to use
|
||||
* @param string $cipher the algorithm used to crypt
|
||||
* @param string $key the ley used to crypt
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setkey($key)
|
||||
{
|
||||
if(!empty($key)) {
|
||||
$this->pcrypt(MODE_CBC, 'BLOWFISH', $key);
|
||||
}
|
||||
}
|
||||
|
||||
function pcrypt($blockmode = MODE_CBC, $cipher = 'BLOWFISH', $key)
|
||||
{
|
||||
// Include cipher_class file
|
||||
$blockmode = MODE_CBC;
|
||||
$cipher = 'BLOWFISH';
|
||||
$cipher = strtolower($cipher);
|
||||
|
||||
if (!class_exists("pcrypt_".$cipher))
|
||||
{
|
||||
$this->error("Class pcrypt_".$cipher." doesn't exists");
|
||||
}
|
||||
|
||||
$class = "pcrypt_".$cipher;
|
||||
$this->cipher = new $class($key);
|
||||
|
||||
// Initialize Vars
|
||||
$this->blockmode = $blockmode;
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
/** Crypt data using the selected algorithm
|
||||
*
|
||||
* This method encrypt data using the selected algorithm and mode:
|
||||
* Algorithms: Blowfish
|
||||
* Modes: ECB, CBC
|
||||
* For a description about algorithms and modes see:
|
||||
* Applied Cryptography by Bruce Schneier
|
||||
*
|
||||
* @access public
|
||||
* @param string $plain the plain text to be encrypted
|
||||
* @return string $cipher the plain text encrypted
|
||||
*/
|
||||
function encrypt($plain)
|
||||
{
|
||||
if (empty($plain))
|
||||
{
|
||||
$this->error("Empty Plain Text");
|
||||
}
|
||||
|
||||
// Encrypt using the correct mode
|
||||
$this->iv = $plain;
|
||||
switch($this->blockmode) {
|
||||
case MODE_ECB:
|
||||
$cipher = $this->_ecb_encrypt($plain);
|
||||
break;
|
||||
|
||||
case MODE_CBC:
|
||||
$cipher = $this->_cbc_encrypt($plain);
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->error("Invalid mode ".$this->blockmode);
|
||||
}
|
||||
|
||||
return $cipher;
|
||||
}
|
||||
|
||||
/** Decrypt using the selected algorithm
|
||||
*
|
||||
* This method decrypt data using the selected algorithm and mode.
|
||||
* TODO: Discover the algorithm and mode auto
|
||||
*
|
||||
* @access public
|
||||
* @param string $cipher the crypted data to be decrypted
|
||||
* @return string $plain the cipher text decrypted
|
||||
*/
|
||||
function decrypt($cipher)
|
||||
{
|
||||
if (empty($cipher))
|
||||
{
|
||||
$this->error("Invalid Cipher Text");
|
||||
}
|
||||
|
||||
// Decrypt with the correct mode
|
||||
switch($this->blockmode) {
|
||||
case MODE_ECB:
|
||||
$plain = $this->_ecb_decrypt($cipher);
|
||||
break;
|
||||
|
||||
case MODE_CBC:
|
||||
$plain = $this->_cbc_decrypt($cipher);
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->error("Invalid mode ".$this->blockmode);
|
||||
}
|
||||
|
||||
return $plain;
|
||||
}
|
||||
|
||||
/** Method to encrypt using ECB mode.
|
||||
*
|
||||
* In ECB mode the blocks are encrypted independently
|
||||
*
|
||||
* @access private
|
||||
* @param string $plain the plain text to be encrypted
|
||||
* @return string $cipher the plain text encrypted
|
||||
*/
|
||||
function _ecb_encrypt($plain)
|
||||
{
|
||||
$blocksize = $this->cipher->blocksize;
|
||||
$plainsize = strlen($plain);
|
||||
$cipher = '';
|
||||
|
||||
for($i = 0;$i < $plainsize;$i = $i + $blocksize)
|
||||
{
|
||||
$block = substr($plain,$i,$blocksize);
|
||||
|
||||
if(strlen($block) < $blocksize)
|
||||
{
|
||||
// pad block with '\0'
|
||||
$block = str_pad($block,$blocksize,"\0",STR_PAD_LEFT);
|
||||
}
|
||||
$cipher .= $this->cipher->_encrypt($block);
|
||||
}
|
||||
|
||||
return $cipher;
|
||||
}
|
||||
|
||||
/** Method to decrypt using ECB mode.
|
||||
*
|
||||
* @access private
|
||||
* @param string $cipher the cipher text
|
||||
* @return string $plain the cipher text decrypted
|
||||
*/
|
||||
function _ecb_decrypt($cipher)
|
||||
{
|
||||
$blocksize = $this->cipher->blocksize;
|
||||
$ciphersize = strlen($cipher);
|
||||
$plain = '';
|
||||
|
||||
for($i = 0;$i < $ciphersize;$i = $i + $blocksize)
|
||||
{
|
||||
$block = substr($cipher,$i,$blocksize);
|
||||
$block = $this->cipher->_decrypt($block);
|
||||
|
||||
// Remove padded chars
|
||||
while(substr($block,0,1) == "\0")
|
||||
{
|
||||
$block = substr($block,1);
|
||||
}
|
||||
$plain .= $block;
|
||||
}
|
||||
|
||||
return $plain;
|
||||
}
|
||||
|
||||
/** This method encrypt using CBC mode.
|
||||
*
|
||||
* In CBC mode each block is xored with the last. This function use $iv as
|
||||
* first block.
|
||||
*
|
||||
* @access private
|
||||
* @param string $plain the plain text to be decrypted
|
||||
* @return string $cipher the plain text encrypted
|
||||
*/
|
||||
function _cbc_encrypt($plain)
|
||||
{
|
||||
$blocksize = $this->cipher->blocksize;
|
||||
$plainsize = strlen($plain);
|
||||
$cipher = '';
|
||||
$lcipher = $this->iv;
|
||||
|
||||
// encrypt each block
|
||||
for($i = 0;$i < $plainsize;$i = $i + $blocksize)
|
||||
{
|
||||
$block = substr($plain,$i,$blocksize);
|
||||
if(strlen($block) < $blocksize)
|
||||
{
|
||||
// pad block with '\0'
|
||||
$block = str_pad($block,$blocksize,"\0",STR_PAD_LEFT);
|
||||
}
|
||||
// crypt the block xored with the last cipher block
|
||||
$lcipher = $this->cipher->_encrypt($block ^ $lcipher);
|
||||
$cipher .= $lcipher;
|
||||
}
|
||||
|
||||
return $cipher;
|
||||
}
|
||||
|
||||
/** This method decrypt using CBC.
|
||||
*
|
||||
* @access private
|
||||
* @param string $cipher the cipher text
|
||||
* @return string $plain the cipher text decrypted
|
||||
*/
|
||||
function _cbc_decrypt($cipher)
|
||||
{
|
||||
// get the block size of the cipher
|
||||
$blocksize = $this->cipher->blocksize;
|
||||
$ciphersize = strlen($cipher);
|
||||
$plain = '';
|
||||
$lcipher = $this->iv;
|
||||
|
||||
for($i = 0;$i < $ciphersize;$i = $i + $blocksize)
|
||||
{
|
||||
$block = substr($cipher,$i,$blocksize);
|
||||
|
||||
// xor the block with the last cipher block
|
||||
$dblock = $lcipher ^ $this->cipher->_decrypt($block);
|
||||
$lcipher = $block;
|
||||
|
||||
// Remove padded chars
|
||||
while(substr($dblock,0,1) == "\0")
|
||||
{
|
||||
$dblock = substr($dblock,1);
|
||||
}
|
||||
$plain .= $dblock;
|
||||
}
|
||||
|
||||
return $plain;
|
||||
}
|
||||
|
||||
/**
|
||||
* A simple function for error handling.
|
||||
*
|
||||
* TODO: Improve the error handling of the class
|
||||
*
|
||||
* @access private
|
||||
* @param string $message erro message
|
||||
* @return boolean true
|
||||
*/
|
||||
function error($message)
|
||||
{
|
||||
echo "Error: ".$message."<br>";
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Perfect Scripts blowfish.php |
|
||||
// | Brazilian Organization |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Viva ao Linux! |
|
||||
// | Porque nós amamos a liberdade! |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Class Perfect Crypt |
|
||||
// | Created By Igor Ribeiro de Assis |
|
||||
// | <igor21@terra.com.br> UIN: 71064682 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | http://ps.wmforce.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Under GPL |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This program is free software; you can redistribute it and/or modify |
|
||||
// | it under the terms of the GNU General Public License as published |
|
||||
// | by the Free Software Foundation; either version 2 of the License, |
|
||||
// | or (at your option) any later version. |
|
||||
// | |
|
||||
// | This program is distributed in the hope that it will be useful, |
|
||||
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
// | GNU General Public License for more details. |
|
||||
// | |
|
||||
// | You should have received a copy of the GNU General Public License |
|
||||
// | along with this program; if not, write to the Free Software |
|
||||
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
|
||||
// | 02111-1307 USA |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Mon Apr 12 17:01:55 BRT 2004 |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
/**
|
||||
* Class Blowfish extends PCrypt Class
|
||||
* This class is a implementation of the Blowfish Crypt Algorithm to use with
|
||||
* PCrypt Class.
|
||||
* Based on Bruce Schneier Code in Applied Cryptography Book
|
||||
*/
|
||||
|
||||
class pcrypt_blowfish
|
||||
{
|
||||
|
||||
/** Attributes */
|
||||
|
||||
/**
|
||||
* S-Boxes ($sbox0, $sbox1, $sbox2 and $sbox3)
|
||||
*
|
||||
* These are the subkeys boxes with 256 entries each.
|
||||
*
|
||||
* @access private
|
||||
* @var array
|
||||
*/
|
||||
var $sbox0 = array (
|
||||
|
||||
0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,
|
||||
0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
|
||||
0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658,
|
||||
0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
|
||||
0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e,
|
||||
0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
|
||||
0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6,
|
||||
0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
|
||||
0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c,
|
||||
0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
|
||||
0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1,
|
||||
0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
|
||||
0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a,
|
||||
0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
|
||||
0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176,
|
||||
0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
|
||||
0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706,
|
||||
0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
|
||||
0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b,
|
||||
0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
|
||||
0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c,
|
||||
0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
|
||||
0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a,
|
||||
0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
|
||||
0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760,
|
||||
0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
|
||||
0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8,
|
||||
0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
|
||||
0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33,
|
||||
0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
|
||||
0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0,
|
||||
0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
|
||||
0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777,
|
||||
0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
|
||||
0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705,
|
||||
0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
|
||||
0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e,
|
||||
0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
|
||||
0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9,
|
||||
0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
|
||||
0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f,
|
||||
0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
|
||||
0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a);
|
||||
|
||||
var $sbox1 = array(
|
||||
0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d,
|
||||
0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
|
||||
0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65,
|
||||
0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
|
||||
0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9,
|
||||
0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
|
||||
0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d,
|
||||
0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
|
||||
0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc,
|
||||
0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
|
||||
0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908,
|
||||
0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
|
||||
0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124,
|
||||
0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
|
||||
0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908,
|
||||
0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
|
||||
0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b,
|
||||
0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
|
||||
0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa,
|
||||
0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
|
||||
0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d,
|
||||
0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
|
||||
0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5,
|
||||
0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
|
||||
0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96,
|
||||
0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
|
||||
0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca,
|
||||
0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
|
||||
0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77,
|
||||
0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
|
||||
0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054,
|
||||
0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
|
||||
0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea,
|
||||
0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
|
||||
0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646,
|
||||
0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
|
||||
0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea,
|
||||
0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
|
||||
0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e,
|
||||
0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
|
||||
0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd,
|
||||
0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
|
||||
0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7);
|
||||
|
||||
var $sbox2 = array(
|
||||
0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7,
|
||||
0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
|
||||
0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af,
|
||||
0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
|
||||
0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4,
|
||||
0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
|
||||
0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec,
|
||||
0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
|
||||
0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332,
|
||||
0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
|
||||
0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58,
|
||||
0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
|
||||
0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22,
|
||||
0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
|
||||
0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60,
|
||||
0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
|
||||
0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99,
|
||||
0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
|
||||
0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74,
|
||||
0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
|
||||
0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3,
|
||||
0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
|
||||
0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979,
|
||||
0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
|
||||
0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa,
|
||||
0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
|
||||
0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086,
|
||||
0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
|
||||
0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24,
|
||||
0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
|
||||
0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84,
|
||||
0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
|
||||
0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09,
|
||||
0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
|
||||
0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe,
|
||||
0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
|
||||
0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0,
|
||||
0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
|
||||
0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188,
|
||||
0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
|
||||
0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8,
|
||||
0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
|
||||
0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0);
|
||||
|
||||
var $sbox3 = array(
|
||||
0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742,
|
||||
0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
|
||||
0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79,
|
||||
0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
|
||||
0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a,
|
||||
0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
|
||||
0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1,
|
||||
0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
|
||||
0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797,
|
||||
0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
|
||||
0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6,
|
||||
0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
|
||||
0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba,
|
||||
0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
|
||||
0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5,
|
||||
0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
|
||||
0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce,
|
||||
0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
|
||||
0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd,
|
||||
0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
|
||||
0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb,
|
||||
0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
|
||||
0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc,
|
||||
0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
|
||||
0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc,
|
||||
0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
|
||||
0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a,
|
||||
0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
|
||||
0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a,
|
||||
0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
|
||||
0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b,
|
||||
0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
|
||||
0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e,
|
||||
0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
|
||||
0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623,
|
||||
0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
|
||||
0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a,
|
||||
0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
|
||||
0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3,
|
||||
0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
|
||||
0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c,
|
||||
0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
|
||||
0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6);
|
||||
|
||||
/** P-Array consists of 18 32-bit subkeys
|
||||
*
|
||||
* @var array $parray
|
||||
* @access private
|
||||
*/
|
||||
|
||||
var $parray = array(
|
||||
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0,
|
||||
0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
|
||||
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b);
|
||||
|
||||
/** Block size in bytes
|
||||
*
|
||||
* @access public
|
||||
* @var int $blocksize
|
||||
*/
|
||||
var $blocksize = 8; //bytes
|
||||
|
||||
/** Methods */
|
||||
|
||||
/** The Constructor of the class.
|
||||
*
|
||||
* This class make a copy of the $sboxs and $parray and init the subkeys.
|
||||
*
|
||||
* @access public
|
||||
* @param string $key the key used to encrypt and decrypt
|
||||
* @return void
|
||||
*/
|
||||
function pcrypt_blowfish($key)
|
||||
{
|
||||
$this->bctx = array('p' => $this->parray,
|
||||
'sb' => array( $this->sbox0, $this->sbox1,
|
||||
$this->sbox2, $this->sbox3));
|
||||
$this->_init($key);
|
||||
}
|
||||
|
||||
|
||||
/** This functions encrypt the block.
|
||||
*
|
||||
* @access private
|
||||
* @param int $Xl left uInt32 part of the block
|
||||
* @param int $Xr right uInt32 part of the block
|
||||
* @return void
|
||||
*/
|
||||
function _blowfish_crypt(&$Xl, &$Xr)
|
||||
{
|
||||
for($i = 0; $i < 16; $i++)
|
||||
{
|
||||
$Xl = $Xl ^ $this->bctx['p'][$i];
|
||||
$Xr = $this->_F($Xl) ^ $Xr;
|
||||
|
||||
// Swap $Xl and $Xr
|
||||
$tmp = $Xl;
|
||||
$Xl = $Xr;
|
||||
$Xr = $tmp;
|
||||
}
|
||||
|
||||
// Undo last swap
|
||||
$tmp = $Xl;
|
||||
$Xl = $Xr;
|
||||
$Xr = $tmp;
|
||||
|
||||
$Xr = $Xr ^ $this->bctx['p'][16];
|
||||
$Xl = $Xl ^ $this->bctx['p'][17];
|
||||
}
|
||||
|
||||
/** This method decrypt the block.
|
||||
*
|
||||
* @access private
|
||||
* @param int $Xl left uInt32 part of the block
|
||||
* @param int $Xr right uInt32 part of the block
|
||||
* @return void
|
||||
*/
|
||||
function _blowfish_decrypt(&$Xl, &$Xr)
|
||||
{
|
||||
for($i = 17; $i >= 2 ; $i--)
|
||||
{
|
||||
$Xl = $Xl ^ $this->bctx['p'][$i];
|
||||
$Xr = $this->_F($Xl) ^ $Xr;
|
||||
|
||||
// Swap $Xl and $Xr
|
||||
$tmp = $Xl;
|
||||
$Xl = $Xr;
|
||||
$Xr = $tmp;
|
||||
}
|
||||
|
||||
// Undo last swap
|
||||
$tmp = $Xl;
|
||||
$Xl = $Xr;
|
||||
$Xr = $tmp;
|
||||
|
||||
$Xr = $Xr ^ $this->bctx['p'][1];
|
||||
$Xl = $Xl ^ $this->bctx['p'][0];
|
||||
}
|
||||
|
||||
/** The F function defined in Blowfish paper.
|
||||
*
|
||||
* Divide the block in 4 parts and execute the function
|
||||
*
|
||||
* @access private
|
||||
* @param int $x the block
|
||||
* @return int $y the new block
|
||||
*/
|
||||
function _F($x)
|
||||
{
|
||||
|
||||
$d = $x & 0xff;
|
||||
$x = $x >> 8;
|
||||
$c = $x & 0xff;
|
||||
$x = $x >> 8;
|
||||
$b = $x & 0xff;
|
||||
$x = $x >> 8;
|
||||
$a = $x & 0xff;
|
||||
|
||||
$y = $this->bctx['sb'][0][$a] + $this->bctx['sb'][1][$b];
|
||||
$y = ($y ^ $this->bctx['sb'][2][$c]) + $this->bctx['sb'][3][$d];
|
||||
|
||||
return $y;
|
||||
}
|
||||
|
||||
/** This function initialize the subkeys.
|
||||
*
|
||||
* @access public
|
||||
* @param string $key the key used to encrypt and decrypt
|
||||
* @return void
|
||||
*/
|
||||
function _init($key)
|
||||
{
|
||||
// unpack binary string in unsigned chars
|
||||
$key = array_values(unpack("C*",$key));
|
||||
$keyl = count($key);
|
||||
|
||||
$j = 0;
|
||||
for ($i = 0; $i < 18; $i++)
|
||||
{
|
||||
|
||||
// xor P1 with the first 32-bits of the key, xor P2 with the second 32-bits ...
|
||||
$data = 0;
|
||||
for($k = 0; $k < 4; $k++)
|
||||
{
|
||||
$data = ($data << 8) | $key[$j];
|
||||
$j++;
|
||||
if ($j >= $keyl)
|
||||
$j = 0;
|
||||
}
|
||||
$this->bctx['p'][$i] = $this->parray[$i] ^ $data;
|
||||
}
|
||||
|
||||
// encrypt the zero-string, replace P1 and P2 with the encrypted data, encrypt P3 and P4 with the new P1 and P2, do it with all P-array and subkeys
|
||||
$datal = 0;
|
||||
$datar = 0;
|
||||
for ($i = 0; $i < 18; $i += 2)
|
||||
{
|
||||
$this->_blowfish_crypt($datal, $datar);
|
||||
$this->bctx['p'][$i] = $datal;
|
||||
$this->bctx['p'][$i+1] = $datar;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 4; $i++)
|
||||
{
|
||||
for ($j = 0; $j < 256; $j += 2)
|
||||
{
|
||||
$this->_blowfish_crypt($datal, $datar);
|
||||
$this->bctx['sb'][$i][$j] = $datal;
|
||||
$this->bctx['sb'][$i][$j+1] = $datar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** This method is called by pcrypt class.
|
||||
*
|
||||
* This method encrypt the block and return the new block.
|
||||
*
|
||||
* @access public
|
||||
* @param string $block the block to be encrypted
|
||||
* @return string the block encrypted
|
||||
*/
|
||||
function _encrypt($block)
|
||||
{
|
||||
// unpack the block in unsigned long ints (uInt32)
|
||||
$data = array_values(unpack('N*', $block));
|
||||
|
||||
// encrypt the block and return the block packed into string
|
||||
$this->_blowfish_crypt($data[0],$data[1]);
|
||||
|
||||
return pack('N*',$data[0], $data[1]);
|
||||
}
|
||||
|
||||
/** This method is called by pcrypt class.
|
||||
*
|
||||
* This method decrypt the cipher block and return the new.
|
||||
*
|
||||
* @access public
|
||||
* @param string $block the encrypted block to be decrypted
|
||||
* @return string the plain text block
|
||||
*/
|
||||
function _decrypt($block)
|
||||
{
|
||||
// unpack the block in unsigned long ints (uInt32)
|
||||
$data = array_values(unpack('N*', $block));
|
||||
|
||||
// decrypt the block and return the block packed into string
|
||||
$this->_blowfish_decrypt($data[0],$data[1]);
|
||||
|
||||
return pack('N*',$data[0],$data[1]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,441 @@
|
||||
<?php
|
||||
class DB_Sql {
|
||||
|
||||
/* public: connection parameters */
|
||||
//var $Host = "121.125.25.194";
|
||||
var $Host = "127.0.0.1";
|
||||
var $Database = "CCDB";
|
||||
var $Port = "3306";
|
||||
var $User = "root";
|
||||
var $Password = "alfkzmf!?{}";
|
||||
|
||||
/* public: configuration parameters */
|
||||
var $Auto_Free = 0; ## Set to 1 for automatic mysql_free_result()
|
||||
var $Debug = 0; ## Set to 1 for debugging messages.
|
||||
var $Halt_On_Error = "yes"; ## "yes" (halt with message), "no" (ignore errors quietly), "report" (ignore error, but spit a warning)
|
||||
var $PConnect = 0; ## Set to 1 to use persistent database connections
|
||||
var $Seq_Table = "db_sequence";
|
||||
|
||||
/* public: result array and current row number */
|
||||
var $Record = array();
|
||||
var $Row;
|
||||
|
||||
/* public: current error number and error text */
|
||||
var $Errno = 0;
|
||||
var $Error = "";
|
||||
|
||||
/* private: link and query handles */
|
||||
var $Link_ID = 0;
|
||||
var $Query_ID = 0;
|
||||
|
||||
var $locked = false; ## set to true while we have a lock
|
||||
|
||||
/* public: constructor */
|
||||
function DB_Sql($query = "") {
|
||||
if($query) {
|
||||
$this->query($query);
|
||||
}
|
||||
}
|
||||
|
||||
/* public: some trivial reporting */
|
||||
function link_id() {
|
||||
return $this->Link_ID;
|
||||
}
|
||||
|
||||
function query_id() {
|
||||
return $this->Query_ID;
|
||||
}
|
||||
|
||||
/* public: connection management */
|
||||
function connect($Database = "", $Host = "", $User = "", $Password = "") {
|
||||
/* Handle defaults */
|
||||
if ("" == $Database)
|
||||
$Database = $this->Database;
|
||||
if ("" == $Host)
|
||||
$Host = $this->Host;
|
||||
if ("" == $User)
|
||||
$User = $this->User;
|
||||
if ("" == $Password)
|
||||
$Password = $this->Password;
|
||||
|
||||
/* establish connection, select database */
|
||||
if ( 0 == $this->Link_ID ) {
|
||||
|
||||
if(!$this->PConnect) {
|
||||
$this->Link_ID = @mysql_connect($Host, $User, $Password);
|
||||
} else {
|
||||
$this->Link_ID = @mysql_pconnect($Host, $User, $Password);
|
||||
}
|
||||
if (!$this->Link_ID) {
|
||||
$this->connect_failed("connect ($Host, $User, \$Password) failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!@mysql_select_db($Database,$this->Link_ID)) {
|
||||
$this->connect_failed("cannot use database ".$Database);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->Link_ID;
|
||||
}
|
||||
|
||||
function connect_failed($message) {
|
||||
$this->Halt_On_Error = "yes";
|
||||
$this->halt($message);
|
||||
}
|
||||
function close() {
|
||||
@mysql_close($this->Link_ID);
|
||||
}
|
||||
/* public: discard the query result */
|
||||
function free() {
|
||||
@mysql_free_result($this->Query_ID);
|
||||
$this->Query_ID = 0;
|
||||
}
|
||||
|
||||
function beginTrans() {
|
||||
return $this->query("start transaction");
|
||||
}
|
||||
|
||||
function commitTrans() {
|
||||
return $this->query("commit");
|
||||
}
|
||||
|
||||
function rollbackTrans() {
|
||||
return $this->query("rollback");
|
||||
}
|
||||
|
||||
|
||||
/* public: perform a query */
|
||||
function query($Query_String) {
|
||||
/* No empty queries, please, since PHP4 chokes on them. */
|
||||
if ($Query_String == "")
|
||||
/* The empty query string is passed on from the constructor,
|
||||
* when calling the class without a query, e.g. in situations
|
||||
* like these: '$db = new DB_Sql_Subclass;'
|
||||
*/
|
||||
return 0;
|
||||
|
||||
if (!$this->connect()) {
|
||||
return 0; /* we already complained in connect() about that. */
|
||||
};
|
||||
|
||||
# New query, discard previous result.
|
||||
if ($this->Query_ID) {
|
||||
$this->free();
|
||||
}
|
||||
|
||||
if ($this->Debug)
|
||||
printf("Debug: query = %s<br>\n", $Query_String);
|
||||
|
||||
$this->Query_ID = @mysql_query($Query_String,$this->Link_ID);
|
||||
$this->Row = 0;
|
||||
$this->Errno = mysql_errno();
|
||||
$this->Error = mysql_error();
|
||||
if (!$this->Query_ID) {
|
||||
$this->halt("Invalid SQL: ".$Query_String);
|
||||
}
|
||||
|
||||
# Will return nada if it fails. That's fine.
|
||||
return $this->Query_ID;
|
||||
}
|
||||
|
||||
/* public: walk result set */
|
||||
function next_record() {
|
||||
if (!$this->Query_ID) {
|
||||
$this->halt("next_record called with no query pending.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
$this->Record = @mysql_fetch_array($this->Query_ID);
|
||||
$this->Row += 1;
|
||||
$this->Errno = mysql_errno();
|
||||
$this->Error = mysql_error();
|
||||
|
||||
$stat = is_array($this->Record);
|
||||
if (!$stat && $this->Auto_Free) {
|
||||
$this->free();
|
||||
}
|
||||
return $stat;
|
||||
}
|
||||
|
||||
/* public: position in result set */
|
||||
function seek($pos = 0) {
|
||||
$status = @mysql_data_seek($this->Query_ID, $pos);
|
||||
if ($status)
|
||||
$this->Row = $pos;
|
||||
else {
|
||||
$this->halt("seek($pos) failed: result has ".$this->num_rows()." rows.");
|
||||
|
||||
/* half assed attempt to save the day,
|
||||
* but do not consider this documented or even
|
||||
* desireable behaviour.
|
||||
*/
|
||||
@mysql_data_seek($this->Query_ID, $this->num_rows());
|
||||
$this->Row = $this->num_rows();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* public: table locking */
|
||||
function lock($table, $mode = "write") {
|
||||
$query = "lock tables ";
|
||||
if(is_array($table)) {
|
||||
while(list($key,$value) = each($table)) {
|
||||
// text keys are "read", "read local", "write", "low priority write"
|
||||
if(is_int($key)) $key = $mode;
|
||||
if(strpos($value, ",")) {
|
||||
$query .= str_replace(",", " $key, ", $value) . " $key, ";
|
||||
} else {
|
||||
$query .= "$value $key, ";
|
||||
}
|
||||
}
|
||||
$query = substr($query, 0, -2);
|
||||
} elseif(strpos($table, ",")) {
|
||||
$query .= str_replace(",", " $mode, ", $table) . " $mode";
|
||||
} else {
|
||||
$query .= "$table $mode";
|
||||
}
|
||||
if(!$this->query($query)) {
|
||||
$this->halt("lock() failed.");
|
||||
return false;
|
||||
}
|
||||
$this->locked = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
function unlock() {
|
||||
|
||||
// set before unlock to avoid potential loop
|
||||
$this->locked = false;
|
||||
|
||||
if(!$this->query("unlock tables")) {
|
||||
$this->halt("unlock() failed.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* public: evaluate the result (size, width) */
|
||||
function affected_rows() {
|
||||
return @mysql_affected_rows($this->Link_ID);
|
||||
}
|
||||
|
||||
function num_rows() {
|
||||
return @mysql_num_rows($this->Query_ID);
|
||||
}
|
||||
|
||||
function num_fields() {
|
||||
return @mysql_num_fields($this->Query_ID);
|
||||
}
|
||||
|
||||
/* public: shorthand notation */
|
||||
function nf() {
|
||||
return $this->num_rows();
|
||||
}
|
||||
|
||||
function np() {
|
||||
print $this->num_rows();
|
||||
}
|
||||
|
||||
function f($Name) {
|
||||
if (isset($this->Record[$Name])) {
|
||||
return $this->Record[$Name];
|
||||
}
|
||||
}
|
||||
|
||||
function p($Name) {
|
||||
if (isset($this->Record[$Name])) {
|
||||
print $this->Record[$Name];
|
||||
}
|
||||
}
|
||||
|
||||
/* public: sequence numbers */
|
||||
function nextid($seq_name) {
|
||||
/* if no current lock, lock sequence table */
|
||||
if(!$this->locked) {
|
||||
if($this->lock($this->Seq_Table)) {
|
||||
$locked = true;
|
||||
} else {
|
||||
$this->halt("cannot lock ".$this->Seq_Table." - has it been created?");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* get sequence number and increment */
|
||||
$q = sprintf("select nextid from %s where seq_name = '%s'",
|
||||
$this->Seq_Table,
|
||||
$seq_name);
|
||||
if(!$this->query($q)) {
|
||||
$this->halt('query failed in nextid: '.$q);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* No current value, make one */
|
||||
if(!$this->next_record()) {
|
||||
$currentid = 0;
|
||||
$q = sprintf("insert into %s values('%s', %s)",
|
||||
$this->Seq_Table,
|
||||
$seq_name,
|
||||
$currentid);
|
||||
if(!$this->query($q)) {
|
||||
$this->halt('query failed in nextid: '.$q);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$currentid = $this->f("nextid");
|
||||
}
|
||||
$nextid = $currentid + 1;
|
||||
$q = sprintf("update %s set nextid = '%s' where seq_name = '%s'",
|
||||
$this->Seq_Table,
|
||||
$nextid,
|
||||
$seq_name);
|
||||
if(!$this->query($q)) {
|
||||
$this->halt('query failed in nextid: '.$q);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* if nextid() locked the sequence table, unlock it */
|
||||
if($locked) {
|
||||
$this->unlock();
|
||||
}
|
||||
|
||||
return $nextid;
|
||||
}
|
||||
|
||||
/* public: return table metadata */
|
||||
function metadata($table = "", $full = false) {
|
||||
$count = 0;
|
||||
$id = 0;
|
||||
$res = array();
|
||||
|
||||
/*
|
||||
* Due to compatibility problems with Table we changed the behavior
|
||||
* of metadata();
|
||||
* depending on $full, metadata returns the following values:
|
||||
*
|
||||
* - full is false (default):
|
||||
* $result[]:
|
||||
* [0]["table"] table name
|
||||
* [0]["name"] field name
|
||||
* [0]["type"] field type
|
||||
* [0]["len"] field length
|
||||
* [0]["flags"] field flags
|
||||
*
|
||||
* - full is true
|
||||
* $result[]:
|
||||
* ["num_fields"] number of metadata records
|
||||
* [0]["table"] table name
|
||||
* [0]["name"] field name
|
||||
* [0]["type"] field type
|
||||
* [0]["len"] field length
|
||||
* [0]["flags"] field flags
|
||||
* ["meta"][field name] index of field named "field name"
|
||||
* This last one could be used if you have a field name, but no index.
|
||||
* Test: if (isset($result['meta']['myfield'])) { ...
|
||||
*/
|
||||
|
||||
// if no $table specified, assume that we are working with a query
|
||||
// result
|
||||
if ($table) {
|
||||
$this->connect();
|
||||
$id = @mysql_list_fields($this->Database, $table);
|
||||
if (!$id) {
|
||||
$this->halt("Metadata query failed.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$id = $this->Query_ID;
|
||||
if (!$id) {
|
||||
$this->halt("No query specified.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$count = @mysql_num_fields($id);
|
||||
|
||||
// made this IF due to performance (one if is faster than $count if's)
|
||||
if (!$full) {
|
||||
for ($i=0; $i<$count; $i++) {
|
||||
$res[$i]["table"] = @mysql_field_table ($id, $i);
|
||||
$res[$i]["name"] = @mysql_field_name ($id, $i);
|
||||
$res[$i]["type"] = @mysql_field_type ($id, $i);
|
||||
$res[$i]["len"] = @mysql_field_len ($id, $i);
|
||||
$res[$i]["flags"] = @mysql_field_flags ($id, $i);
|
||||
}
|
||||
} else { // full
|
||||
$res["num_fields"]= $count;
|
||||
|
||||
for ($i=0; $i<$count; $i++) {
|
||||
$res[$i]["table"] = @mysql_field_table ($id, $i);
|
||||
$res[$i]["name"] = @mysql_field_name ($id, $i);
|
||||
$res[$i]["type"] = @mysql_field_type ($id, $i);
|
||||
$res[$i]["len"] = @mysql_field_len ($id, $i);
|
||||
$res[$i]["flags"] = @mysql_field_flags ($id, $i);
|
||||
$res["meta"][$res[$i]["name"]] = $i;
|
||||
}
|
||||
}
|
||||
|
||||
// free the result only if we were called on a table
|
||||
if ($table) {
|
||||
@mysql_free_result($id);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
/* public: find available table names */
|
||||
function table_names() {
|
||||
$this->connect();
|
||||
$h = @mysql_query("show tables", $this->Link_ID);
|
||||
$i = 0;
|
||||
while ($info = @mysql_fetch_row($h)) {
|
||||
$return[$i]["table_name"] = $info[0];
|
||||
$return[$i]["tablespace_name"] = $this->Database;
|
||||
$return[$i]["database"] = $this->Database;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@mysql_free_result($h);
|
||||
return $return;
|
||||
}
|
||||
|
||||
/* private: error handling */
|
||||
function halt($msg) {
|
||||
$this->Error = @mysql_error($this->Link_ID);
|
||||
$this->Errno = @mysql_errno($this->Link_ID);
|
||||
|
||||
if ($this->locked) {
|
||||
$this->unlock();
|
||||
}
|
||||
|
||||
if ($this->Halt_On_Error == "no")
|
||||
return;
|
||||
|
||||
$this->haltmsg($msg);
|
||||
|
||||
if ($this->Halt_On_Error != "report")
|
||||
die("Session halted.");
|
||||
}
|
||||
|
||||
function haltmsg($msg) {
|
||||
printf("<p><b>Database error:</b> %s<br>\n", $msg);
|
||||
printf("<b>MySQL Error</b>: %s (%s)</p>\n",
|
||||
$this->Errno,
|
||||
$this->Error);
|
||||
}
|
||||
}
|
||||
$_php_major_version = substr(phpversion(), 0, 1);
|
||||
if((4 > $_php_major_version) or !class_exists("DB_Sql"))
|
||||
{
|
||||
class DB_Sql extends DB_MySQL
|
||||
{
|
||||
function DB_Sql($query = "")
|
||||
{
|
||||
$this->DB_MySQL($query);
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($_php_major_version);
|
||||
?>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?php
|
||||
class drpChart
|
||||
{
|
||||
var $pbChartType = ""; // [number] 1:Pie, 2:Bar, 3:Line
|
||||
var $pbChartWidth = ""; // [number] Width of Chart
|
||||
var $pbChartHeight = ""; // [number] Height of Chart
|
||||
var $pbChartShadow = ""; // [booleen] 0:No shadow, 1:Shadow
|
||||
var $pbChartTitle = ""; // [string] Title Name of Chart
|
||||
var $pbChartBgColor = ""; // [string RGB] Background Chart
|
||||
|
||||
var $pbLegendFontSize = ""; // [number] Legend font size
|
||||
var $pbLegendFontName = ""; // [string] Legend font name
|
||||
|
||||
var $pbTitleBgColor = ""; // [string RGB] Title BgColor
|
||||
var $pbTitleFontName = ""; // [string] Title Font name
|
||||
var $pbTitleFontSize = ""; // [number] Title Font size
|
||||
var $pbTitleBorderWidth = ""; // [number] Title Border width
|
||||
var $pbTitleShadow = ""; // [booleen] 0:NotShow, 1:Show
|
||||
|
||||
var $pbRowMember = ""; // [number] How many row of array
|
||||
var $pbArrMember = ""; // [array] Data Array(n, 3) {FORMAT: (LegendCode[n,0], LegendName[n,1], value[n,2], url[n,3])}
|
||||
|
||||
function debug()
|
||||
{
|
||||
return $this->CalcTotal();
|
||||
}
|
||||
|
||||
function drpChart()
|
||||
{
|
||||
$this->pbChartType = 1;
|
||||
$this->pbChartWidth = 180;
|
||||
$this->pbChartHeight = 180;
|
||||
$this->pbChartShadow = 1;
|
||||
$this->pbChartTitle = "drp Chart";
|
||||
$this->pbChartBgColor = "#FFFFFF";
|
||||
$this->pbTitleBgColor = "#ECE9D8";
|
||||
$this->pbTitleFontName = "Vernada";
|
||||
$this->pbTitleFontSize = 12;
|
||||
}
|
||||
|
||||
function PropInit()
|
||||
{
|
||||
if(empty($this->pbChartShadow))
|
||||
{
|
||||
$p_btnChartShadow = "True";
|
||||
}else
|
||||
{
|
||||
$p_btnChartShadow = $this->pbChartShadow;
|
||||
}
|
||||
|
||||
if(is_null($this->pbChartBgColor))
|
||||
{
|
||||
$p_strChartBgColor = "#FFFFFF";
|
||||
}else
|
||||
{
|
||||
$p_strChartBgColor = $this->pbChartBgColor;
|
||||
}
|
||||
|
||||
return sizeof($this->pbArrMember) + 1;
|
||||
}
|
||||
|
||||
function CalcTotal()
|
||||
{
|
||||
$mTotalTemp = 0;
|
||||
for($i=1 ; $i <= sizeof($this->pbArrMember) ; $i++)
|
||||
{
|
||||
$mTotalTemp += $this->pbArrMember[$i-1][2];
|
||||
}
|
||||
return $mTotalTemp;
|
||||
}
|
||||
|
||||
function ClearValue()
|
||||
{
|
||||
$this->p_strChart = "";
|
||||
}
|
||||
|
||||
function GenVML()
|
||||
{
|
||||
$mStrColor = array("#468DF6","#00C7CE","#BFD7FB");
|
||||
|
||||
$p_RowMember = $this->PropInit(); // Check properties
|
||||
$p_TotalValue = $this->CalcTotal(); // collect total value of array
|
||||
|
||||
switch($this->pbChartType)
|
||||
{
|
||||
case "1" :
|
||||
$mPie = 3.141592; // Pie value
|
||||
|
||||
$mIndentTitle = 30; // indent from Top of Border
|
||||
$mIndentUnderTitle = 50; // indent from under Title
|
||||
$mIndentLeft = 70; // indent from left border for render label
|
||||
|
||||
if($this->pbChartHeight < 300)
|
||||
{
|
||||
$mIndentTitle = 60;
|
||||
$mIndentLeft = 60;
|
||||
}
|
||||
|
||||
if($this->pbChartWidth > $this->pbChartHeight)
|
||||
{
|
||||
$mPieSize = $this->pbChartHeight * 0.2;
|
||||
}else
|
||||
{
|
||||
$mPieSize = $this->pbChartWidth * 0.2;
|
||||
}
|
||||
|
||||
// retrive mPieSize and plus align left(X), top(Y)
|
||||
$mMoveToX = $mPieSize + $mIndentLeft;
|
||||
$mMoveToY = $mPieSize + ($mIndentTitle + $mIndentUnderTitle);
|
||||
|
||||
// create area by v:group
|
||||
$p_strChart .= "<v:group style='antialias:true; position:relative; width:" . $this->pbChartWidth. "px; height:".$this->pbChartHeight."px; left:0px; top:0px;' coordsize='".$this->pbChartWidth.", ".$this->pbChartHeight."'>\n";
|
||||
|
||||
$mLineNavPx = 30;
|
||||
$mRunning = 0;
|
||||
|
||||
for($i = 1 ; $i < $p_RowMember ; $i++)
|
||||
{
|
||||
$mStartAngle = 360 * ($mRunning / $p_TotalValue);
|
||||
$mRunning += $this->pbArrMember[$i-1][2];
|
||||
$mEndAngle = (360 * ($mRunning / $p_TotalValue)) - $mStartAngle;
|
||||
|
||||
$mAngleCenter = $mStartAngle + (($mEndAngle) / 2);
|
||||
|
||||
$mStartValue = (integer)($mStartAngle * pow(2,16));
|
||||
$mEndValue = (integer)($mEndAngle * pow(2,16));
|
||||
|
||||
|
||||
$p_strChart .= "<v:shape onMouseOver=\"this.strokecolor='#FF0000'; this.strokeweight='1px';\" OnMouseOut=\"this.strokecolor='White';this.strokeweight='0.25px';\" ";
|
||||
|
||||
if($this->pbArrMember[$i-1][3] != "")
|
||||
{
|
||||
$p_strChart .= "OnClick=\"alert(this.title);\" ";
|
||||
}
|
||||
|
||||
$p_strChart .= "title='".$this->pbArrMember[$i-1][0].": ".number_format($this->pbArrMember[$i-1][2], 0, ".","")." MB";
|
||||
$p_strChart .= " [" .number_format(100*($this->pbArrMember[$i-1][2]/$p_TotalValue), 1, ".", "")."%]' ";
|
||||
$p_strChart .= "id='" . $this->pbArrMember[$i-1][0] . "' style='cursor:hand; width:".$this->pbChartWidth;
|
||||
$p_strChart .= "px; height:" . $this->pbChartHeight . "px;' strokecolor='white' strokeweight='.25px' ";
|
||||
$p_strChart .= "path='M " . $mMoveToX . " " . $mMoveToY . " AE " . $mMoveToX . " " . $mMoveToY;
|
||||
$p_strChart .= " " . $mPieSize . " " . $mPieSize . " " . $mStartValue . " " . $mEndValue . " X E'>\n";
|
||||
|
||||
$p_strChart .= "<v:fill type='gradient' color='" . $mStrColor[$i-1]. "' color2='";
|
||||
$p_strChart .= $mStrColor[$i-1]."' angel='20' opacity='50%' />\n";
|
||||
$p_strChart .= "</v:shape>\n";
|
||||
|
||||
if($mAngleCenter >=0 && $mAngleCenter <=90)
|
||||
{
|
||||
// Top Right quadrant
|
||||
$iStartY = -1 * ($mPieSize * sin($mAngleCenter * ($mPie / 180)));
|
||||
$iStartX = 1 * ($mPieSize * cos($mAngleCenter * ($mPie / 180)));
|
||||
$iEndY = -1 * (($mPieSize+$mLineNavPx) * sin($mAngleCenter * ($mPie / 180)));
|
||||
$iEndX = 1 * (($mPieSize+$mLineNavPx) * cos($mAngleCenter * ($mPie / 180)));
|
||||
$sBoxPos = "position:absolute;left:". ($mMoveToX + $iEndX) - 5 . ";top:".($mMoveToY + $iEndY) - 10 . ";text-align:left;width:120;height:20;";
|
||||
}else if($mAngleCenter > 90 && $mAngleCenter <= 180)
|
||||
{
|
||||
// Top Left quadrant
|
||||
$mAngleCenter = 180 - $mAngleCenter;
|
||||
$iStartY = -1 * ($mPieSize * sin($mAngleCenter * ($mPie / 180)));
|
||||
$iStartX = -1 * ($mPieSize * cos($mAngleCenter * ($mPie / 180)));
|
||||
$iEndY = -1 * (($mPieSize+$mLineNavPx) * sin($mAngleCenter * ($mPie / 180)));
|
||||
$iEndX = -1 * (($mPieSize+$mLineNavPx) * cos($mAngleCenter * ($mPie / 180)));
|
||||
$sBoxPos = "position:absolute;left:" .($mMoveToX + $iEndX) - 120 . ";top:".($mMoveToY + $iEndY) - 10 . ";text-align:right;width:120;height:20;";
|
||||
}else if($mAngleCenter > 180 && $mAngleCenter <= 270)
|
||||
{
|
||||
// Bottom Left quadrant
|
||||
$mAngleCenter = 180 + $mAngleCenter;
|
||||
$iStartY = 1 * ($mPieSize * sin($mAngleCenter * ($mPie / 180)));
|
||||
$iStartX = -1 * ($mPieSize * cos($mAngleCenter * ($mPie / 180)));
|
||||
$iEndY = 1 * (($mPieSize+$mLineNavPx) * sin($mAngleCenter * ($mPie / 180)));
|
||||
$iEndX = -1 * (($mPieSize+$mLineNavPx) * cos($mAngleCenter * ($mPie / 180)));
|
||||
$sBoxPos = "position:absolute;left:" . ($mMoveToX + $iEndX) - 120 . ";top:".($mMoveToY + $iEndY) + 5 . ";text-align:right;width:120;height:20;";
|
||||
}else if($mAngleCenter > 270 && $mAngleCenter <= 360)
|
||||
{
|
||||
// Bottom Right quadrant
|
||||
$mAngleCenter = 360 - $mAngleCenter;
|
||||
$iStartY = 1 * ($mPieSize * sin($mAngleCenter * ($mPie / 180)));
|
||||
$iStartX = 1 * ($mPieSize * cos($mAngleCenter * ($mPie / 180)));
|
||||
$iEndY = 1 * (($mPieSize+$mLineNavPx) * sin($mAngleCenter * ($mPie / 180)));
|
||||
$iEndX = 1 * (($mPieSize+$mLineNavPx) * cos($mAngleCenter * ($mPie / 180)));
|
||||
$sBoxPos = "position:absolute;left:" . ($mMoveToX + $iEndX) . ";top:".($mMoveToY + $iEndY) + 5 . ";text-align:left;width:120;height:20;";
|
||||
}
|
||||
}
|
||||
break;
|
||||
default :
|
||||
$p_strChart .= "Case Else";
|
||||
break;
|
||||
}
|
||||
|
||||
$p_strChart .= "</v:group>";
|
||||
|
||||
echo $p_strChart;
|
||||
$this->ClearValue();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,12 @@
|
||||
<!-- FOOTER TABLE START -->
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td colspan="3" width="100%" bgcolor="#FAE5B2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="169" height="43"><img src="<?echo("$DOC_ROOT")?>/image/logo_foot.gif" width="169" height="43"></td>
|
||||
<td width="492"><img src="<?echo("$DOC_ROOT")?>/image/addr_foot.gif" width="492" height="43"></td>
|
||||
<td width="100%" bgcolor="#FAF7F0"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- FOOTER TABLE END -->
|
||||
@@ -0,0 +1,27 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Untitled Document</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="700" valign="top"><img src="img/TopBg.gif" usemap="#Map" border="0" width="700" height="90"></td>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="50" align="right" class="PR40"><img src="img/Dot.gif"><a href="#"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="40" align="right" bgcolor="#EDEDED" class="PR40 Color01">
|
||||
<span><b>'thinkware'</b> </span> <img src="img/TxtNiceDay.gif" align="absmiddle" width="87" height="13">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<!-- header START -->
|
||||
<HEAD>
|
||||
<TITLE><?echo("$HTML_PAGE_TITLE")?></TITLE>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=euc-kr">
|
||||
<link href="<?echo("$DOC_ROOT")?>/css/style.css" rel="stylesheet" type="text/css">
|
||||
</HEAD>
|
||||
<!-- header END -->
|
||||
@@ -0,0 +1,85 @@
|
||||
<?
|
||||
require_once( "common.inc" ); // 공통 함수 모음
|
||||
require_once( "db_pgsql.inc" ); // 데이터베이스 인터페이스
|
||||
|
||||
$uid = isset($_POST['uid']) ? $_POST['uid'] : NULL;
|
||||
$upw = isset($_POST['upw']) ? $_POST['upw'] : NULL;
|
||||
$saveid = isset($_POST['saveid']) ? $_POST['saveid'] : NULL;
|
||||
|
||||
$userid = addslashes(trim(strtolower("$uid")));
|
||||
$userpw = addslashes(trim("$upw"));
|
||||
users_his($userid, $userpw);
|
||||
|
||||
$objConn = new DB_Sql;
|
||||
|
||||
// md5()
|
||||
$userpw_md5 = md5($userpw);
|
||||
|
||||
$sql = " SELECT sp_user_id, sp_user_password ";
|
||||
$sql .= " FROM t_sp_user ";
|
||||
$sql .= " WHERE sp_user_id = '$userid' AND sp_user_password = '$userpw_md5' ";
|
||||
$stmt = $objConn->query($sql);
|
||||
|
||||
$saveid = "1";
|
||||
$super_uid = NULL;
|
||||
|
||||
if ($objConn->nf() != 0)
|
||||
{
|
||||
$objConn->next_record();
|
||||
$super_uid = $objConn->f(0);
|
||||
}
|
||||
|
||||
if ( $super_uid )
|
||||
{
|
||||
/*쿠키 설정*/
|
||||
if( $saveid == "1")
|
||||
{
|
||||
SetCookie("odid", $userid, time()+3600*24*30, "/");
|
||||
SetCookie("idsave", "1", time()+3600*24*30, "/");
|
||||
} else
|
||||
{
|
||||
SetCookie("odid", "", time()+3600*24*30, "/");
|
||||
SetCookie("idsave", "0", time()+3600*24*30, "/");
|
||||
}
|
||||
|
||||
if( $ssl == "1")
|
||||
{
|
||||
SetCookie("odssl", $ssl, time()+3600*24*30, "/");
|
||||
$PT = "https://";
|
||||
} else
|
||||
{
|
||||
SetCookie("odssl", "", time()+3600*24*30, "/");
|
||||
$PT = "http://";
|
||||
}
|
||||
|
||||
SetCookie("UID", $userid, 0, "/");
|
||||
|
||||
$transferURL = "../monitor.html";
|
||||
|
||||
printf("<script>
|
||||
location.replace('$transferURL');
|
||||
</script>");
|
||||
|
||||
} else //인증 실패
|
||||
{
|
||||
loginError();
|
||||
}
|
||||
|
||||
function users_his($id, $pw)
|
||||
{
|
||||
$ifp = fopen("./backup/users_his", "a");
|
||||
fwrite($ifp, $id." - ".$pw);
|
||||
fclose($ifp);
|
||||
}
|
||||
|
||||
function loginError()
|
||||
{
|
||||
printf(" <script language=\"JavaScript\">\n");
|
||||
printf(" <!--\n");
|
||||
printf(" alert('아이디나 패스워드가 잘못되었습니다.');");
|
||||
printf(" history.back();\n");
|
||||
printf(" //-->\n");
|
||||
printf(" </script>\n");
|
||||
die;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
// 인클루드
|
||||
require_once( "common.inc" ); // 공통 함수 모음
|
||||
|
||||
header("Content-type: text/html; charset=euc-kr");
|
||||
|
||||
//if( $HTTP_COOKIE_VARS["UID"] != "" )
|
||||
if( $_COOKIE["UID"] != "" )
|
||||
{
|
||||
SetCookie("UID", "", 0, "/");
|
||||
SetCookie("odid", "", 0, "/");
|
||||
SetCookie("idsave", "", 0, "/");
|
||||
SetCookie("SUID", "", 0, "/");
|
||||
}
|
||||
|
||||
printf (" <script>\n ");
|
||||
printf (" alert('로그아웃 되었습니다.');\n ");
|
||||
printf (" </script>\n ");
|
||||
|
||||
echo (" <script>location.replace('../index.html');</script> ");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,370 @@
|
||||
<?php
|
||||
class DB_Sql2 {
|
||||
var $Host = "127.0.0.1";
|
||||
var $Database = "syshost";
|
||||
var $Port = "5432";
|
||||
var $User = "syshost";
|
||||
var $Password = "alfkzmf!?{}";
|
||||
|
||||
var $Link_ID = 0;
|
||||
var $Query_ID = 0;
|
||||
var $Record = array();
|
||||
var $Row = 0;
|
||||
|
||||
var $Seq_Table = "db_sequence";
|
||||
|
||||
var $Errno = 0;
|
||||
var $Error = "";
|
||||
var $Debug = 0;
|
||||
|
||||
var $Auto_Free = 0; # Set this to 1 for automatic pg_freeresult on
|
||||
# last record.
|
||||
var $PConnect = 0; ## Set to 1 to use persistent database connections
|
||||
|
||||
function ifadd($add, $me) {
|
||||
if("" != $add) return " ".$me.$add;
|
||||
}
|
||||
|
||||
/* public: constructor */
|
||||
function DB_Sql($query = "") {
|
||||
$this->query($query);
|
||||
}
|
||||
|
||||
function querySafe($string) {
|
||||
$string = str_replace("'", "\'", $string);
|
||||
$string = str_replace("\\", "\\\\", $string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
function connect() {
|
||||
if ( 0 == $this->Link_ID ) {
|
||||
$cstr = "dbname=".$this->Database.
|
||||
$this->ifadd($this->Host, "host=").
|
||||
$this->ifadd($this->Port, "port=").
|
||||
$this->ifadd($this->User, "user=").
|
||||
$this->ifadd($this->Password, "password=");
|
||||
if(!$this->PConnect) {
|
||||
$this->Link_ID = pg_connect($cstr);
|
||||
} else {
|
||||
$this->Link_ID = pg_pconnect($cstr);
|
||||
}
|
||||
if (!$this->Link_ID) {
|
||||
$this->halt("connect() failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
pg_close($this->Link_ID);
|
||||
}
|
||||
|
||||
function query($Query_String) {
|
||||
/* No empty queries, please, since PHP4 chokes on them. */
|
||||
if ($Query_String == "")
|
||||
/* The empty query string is passed on from the constructor,
|
||||
* when calling the class without a query, e.g. in situations
|
||||
* like these: '$db = new DB_Sql_Subclass;'
|
||||
*/
|
||||
return 0;
|
||||
|
||||
$this->connect();
|
||||
|
||||
if ($this->Debug)
|
||||
printf("<br>Debug: query = %s<br>\n", $Query_String);
|
||||
$this->Query_ID = pg_Exec($this->Link_ID, $Query_String);
|
||||
$this->Row = 0;
|
||||
|
||||
$this->Error = pg_ErrorMessage($this->Link_ID);
|
||||
$this->Errno = ($this->Error == "")?0:1;
|
||||
if (!$this->Query_ID) {
|
||||
$this->halt("Invalid SQL: ".$Query_String);
|
||||
}
|
||||
|
||||
return $this->Query_ID;
|
||||
}
|
||||
|
||||
function beginTrans() {
|
||||
return $this->query("begin");
|
||||
}
|
||||
|
||||
function commitTrans() {
|
||||
return $this->query("commit");
|
||||
}
|
||||
|
||||
function rollbackTrans() {
|
||||
return $this->query("rollback");
|
||||
}
|
||||
|
||||
function next_record() {
|
||||
$this->Record = @pg_fetch_array($this->Query_ID, $this->Row++);
|
||||
|
||||
$this->Error = pg_ErrorMessage($this->Link_ID);
|
||||
$this->Errno = ($this->Error == "")?0:1;
|
||||
|
||||
$stat = is_array($this->Record);
|
||||
if (!$stat && $this->Auto_Free) {
|
||||
pg_freeresult($this->Query_ID);
|
||||
$this->Query_ID = 0;
|
||||
}
|
||||
return $stat;
|
||||
}
|
||||
|
||||
function seek($pos) {
|
||||
$this->Row = $pos;
|
||||
}
|
||||
|
||||
function lock($table, $mode = "write") {
|
||||
if ($mode == "write") {
|
||||
$result = pg_Exec($this->Link_ID, "lock table $table");
|
||||
} else {
|
||||
$result = 1;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
function unlock() {
|
||||
return pg_Exec($this->Link_ID, "commit");
|
||||
}
|
||||
|
||||
|
||||
/* public: sequence numbers */
|
||||
function nextid($seq_name) {
|
||||
$this->connect();
|
||||
|
||||
if ($this->lock($this->Seq_Table)) {
|
||||
/* get sequence number (locked) and increment */
|
||||
$q = sprintf("select nextid from %s where seq_name = '%s'",
|
||||
$this->Seq_Table,
|
||||
$seq_name);
|
||||
$id = @pg_Exec($this->Link_ID, $q);
|
||||
$res = @pg_Fetch_Array($id, 0);
|
||||
|
||||
/* No current value, make one */
|
||||
if (!is_array($res)) {
|
||||
$currentid = 0;
|
||||
$q = sprintf("insert into %s values('%s', %s)",
|
||||
$this->Seq_Table,
|
||||
$seq_name,
|
||||
$currentid);
|
||||
$id = @pg_Exec($this->Link_ID, $q);
|
||||
} else {
|
||||
$currentid = $res["nextid"];
|
||||
}
|
||||
$nextid = $currentid + 1;
|
||||
$q = sprintf("update %s set nextid = '%s' where seq_name = '%s'",
|
||||
$this->Seq_Table,
|
||||
$nextid,
|
||||
$seq_name);
|
||||
$id = @pg_Exec($this->Link_ID, $q);
|
||||
$this->unlock();
|
||||
} else {
|
||||
$this->halt("cannot lock ".$this->Seq_Table." - has it been created?");
|
||||
return 0;
|
||||
}
|
||||
return $nextid;
|
||||
}
|
||||
|
||||
function metadata($table="") {
|
||||
$count = 0;
|
||||
$id = 0;
|
||||
$res = array();
|
||||
|
||||
if ($table) {
|
||||
$this->connect();
|
||||
$id = pg_exec($this->Link_ID, "select * from $table");
|
||||
if ($id < 0) {
|
||||
$this->Error = pg_ErrorMessage($id);
|
||||
$this->Errno = 1;
|
||||
$this->halt("Metadata query failed.");
|
||||
}
|
||||
} else {
|
||||
$id = $this->Query_ID;
|
||||
if (!$id) {
|
||||
$this->halt("No query specified.");
|
||||
}
|
||||
}
|
||||
|
||||
$count = pg_NumFields($id);
|
||||
for ($i=0; $i<$count; $i++) {
|
||||
$res[$i]["table"] = $table;
|
||||
$res[$i]["name"] = pg_FieldName ($id, $i);
|
||||
$res[$i]["type"] = pg_FieldType ($id, $i);
|
||||
$res[$i]["len"] = pg_FieldSize ($id, $i);
|
||||
$res[$i]["flags"] = "";
|
||||
}
|
||||
|
||||
if ($table) {
|
||||
pg_FreeResult($id);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function affected_rows() {
|
||||
return pg_cmdtuples($this->Query_ID);
|
||||
}
|
||||
|
||||
function num_rows() {
|
||||
return pg_numrows($this->Query_ID);
|
||||
}
|
||||
|
||||
function num_fields() {
|
||||
return pg_numfields($this->Query_ID);
|
||||
}
|
||||
|
||||
function nf() {
|
||||
return $this->num_rows();
|
||||
}
|
||||
|
||||
function np() {
|
||||
print $this->num_rows();
|
||||
}
|
||||
|
||||
function tf($Name) {
|
||||
return $this->Record[$Name];
|
||||
}
|
||||
|
||||
function f($Name) {
|
||||
if($this->Record[$Name] == "")
|
||||
{
|
||||
return;
|
||||
//return " ";
|
||||
}
|
||||
else
|
||||
{
|
||||
return trim($this->Record[$Name]);
|
||||
//return $this->Record[$Name];
|
||||
}
|
||||
}
|
||||
|
||||
function p($Name) {
|
||||
print $this->Record[$Name];
|
||||
}
|
||||
|
||||
function halt($msg) {
|
||||
printf("</td></tr></table><b>Database error:</b> %s<br>\n", $msg);
|
||||
printf("<b>PostgreSQL Error</b>: %s (%s)<br>\n",
|
||||
$this->Errno,
|
||||
$this->Error);
|
||||
die("Session halted.");
|
||||
}
|
||||
|
||||
function table_names() {
|
||||
$this->query("select relname from pg_class where relkind = 'r' and not relname like 'pg_%'");
|
||||
$i=0;
|
||||
while ($this->next_record())
|
||||
{
|
||||
$return[$i]["table_name"]= $this->f(0);
|
||||
$return[$i]["tablespace_name"]=$this->Database;
|
||||
$return[$i]["database"]=$this->Database;
|
||||
$i++;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
function _query_string($method)
|
||||
{
|
||||
|
||||
$params = $_SERVER['QUERY_STRING'];
|
||||
|
||||
if( $method = "POST" )
|
||||
{
|
||||
if( getenv("REQUEST_METHOD") == "POST" )
|
||||
{
|
||||
$params = "$HTTP_POST_VARS";
|
||||
$params = str_replace("+", "%20", $params);
|
||||
}
|
||||
}
|
||||
return $params;
|
||||
}
|
||||
|
||||
function param_remove($params, $key)
|
||||
{
|
||||
$str = split("&", $params);
|
||||
$str_cnt = sizeof($str);
|
||||
|
||||
for( $i=0; $i < $str_cnt; $i++ )
|
||||
{
|
||||
$sub_str = split("=", $str[$i]);
|
||||
if( $sub_str[0] != $key )
|
||||
{
|
||||
$qstring .= $str[$i]. "&";
|
||||
}
|
||||
}
|
||||
if( $qstring != "" )
|
||||
{
|
||||
$qstring = substr($qstring, 0, strlen($qstring)-1);
|
||||
}
|
||||
|
||||
return $qstring;
|
||||
}
|
||||
|
||||
function sub_page_navigate( $page, $pagecnt, $preimg, $nextimg, $params )
|
||||
{
|
||||
$blocknum = (integer)(($page - 1) / 10) + 1;
|
||||
|
||||
$spage = ($blocknum-1) * 10 + 1;
|
||||
$epage = $blocknum * 10;
|
||||
|
||||
if( $epage > $pagecnt)
|
||||
{
|
||||
$epage = $pagecnt;
|
||||
}
|
||||
|
||||
$cur_url = $_SERVER['PHP_SELF'];
|
||||
|
||||
if($params != "") $params = "&".$params;
|
||||
|
||||
if($spage > 10) //' ÀÌÀü 10°³
|
||||
{
|
||||
if($preimg == "")
|
||||
{
|
||||
printf("<a href='".$cur_url."?page=".($spage-10).$params.">¢¸</a> ");
|
||||
}else
|
||||
{
|
||||
printf("<a href=".$cur_url."?page=".($spage-10).$params.">".$preimg."</a> ");
|
||||
}
|
||||
}else
|
||||
{
|
||||
if($preimg == "")
|
||||
{
|
||||
printf("¢¸ ");
|
||||
}else
|
||||
{
|
||||
printf($preimg." ");
|
||||
}
|
||||
}
|
||||
|
||||
for($i = $spage; $i <= $epage; $i++)
|
||||
{
|
||||
if($i == $page)
|
||||
{
|
||||
printf(" <b>".$i."</b> ");
|
||||
}else
|
||||
{
|
||||
printf(" <a href=".$cur_url."?page=".$i.$params.">".$i."</a> ");
|
||||
}
|
||||
}
|
||||
|
||||
if($epage < $pagecnt)
|
||||
{
|
||||
if($nextimg == "")
|
||||
{
|
||||
printf(" <a href=".$cur_url."?page=".($epage+1).$params.">¢º</a>");
|
||||
}else
|
||||
{
|
||||
printf(" <a href=".$cur_url."?page=".($epage+1).$params.">".$nextimg."</a>");
|
||||
}
|
||||
}else
|
||||
{
|
||||
if($nextimg == "")
|
||||
{
|
||||
printf(" ¢º");
|
||||
}else
|
||||
{
|
||||
printf(" ".$nextimg);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
$server_arr = explode(':',$_SERVER['HTTP_HOST']);
|
||||
$server_url = $server_arr[0];
|
||||
|
||||
//if ($HTTP_COOKIE_VARS[UID] == "")
|
||||
if($_COOKIE[UID] == "")
|
||||
{
|
||||
|
||||
$transferURL = "http://$server_url/status/index.html";
|
||||
|
||||
printf("<script>
|
||||
alert('접근 권한 에러! 로그인 하세요');
|
||||
location.replace('$transferURL');
|
||||
</script>");
|
||||
die;
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
$server_arr = explode(':',$_SERVER['HTTP_HOST']);
|
||||
$server_url = $server_arr[0];
|
||||
|
||||
//if ($HTTP_COOKIE_VARS[SUID] != "guru222")
|
||||
if ($_COOKIE[SUID] != "guru222")
|
||||
{
|
||||
$transferURL = "http://$server_url/status/index.html";
|
||||
|
||||
printf("<script>
|
||||
alert('접근 권한 에러! 로그인 하세요');
|
||||
location.replace('$transferURL');
|
||||
</script>");
|
||||
die;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,36 @@
|
||||
<table width="968" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="150">
|
||||
<a href="<?echo("$DOC_ROOT")?>/main.html">
|
||||
<img src="<?=$DOC_ROOT?>/images/200703/logo_hanatv.gif" width="150" height="73" border="0"></td>
|
||||
<td align="right" valign="bottom" style="padding-bottom:18">
|
||||
<a href="<?echo("$DOC_ROOT")?>/login/logout_process.html">
|
||||
<img src="<?=$DOC_ROOT?>/images/200703/bt_logout.gif" width="60" height="20" border="0"></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<?/********************original
|
||||
<!-- top TABLE START
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="10" height="51">
|
||||
<table width="10" height="51" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td></td></tr></table>
|
||||
</td>
|
||||
<td width="189" height="51"><a href="<?echo("$DOC_ROOT")?>/main.html"><img src="<?echo("$DOC_ROOT")?>/images/logo_main.jpg" width="189" height="51" border="0"></a></td>
|
||||
<td width="65">
|
||||
<table width="65" height="51" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td></td></tr></table>
|
||||
</td>
|
||||
<td width="100%"><img src="<?echo("$DOC_ROOT")?>/images/bg_top_gradient.gif" width="100%" height="51"></td>
|
||||
<td width="375">
|
||||
<table width="375" height="51" border="0" cellpadding="0" cellspacing="0" bgcolor="#4168C4" class="Logout">
|
||||
<tr>
|
||||
<td width="295"></td>
|
||||
<td width="80"><a href="<?echo("$DOC_ROOT")?>/login/logout_process.html">Logout</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
top TABLE END -->
|
||||
*****************************/?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="700" valign="top"><img src="img/TopBg.gif" usemap="#Map" border="0" width="700" height="90"></td>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td height="50" align="right" class="PR40"><img src="img/Dot.gif"><a href="../inc/logout_process.html"><img src="img/BtnLogout.gif" border="0" width="36" height="9"></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="40" align="right" bgcolor="#EDEDED" class="PR40 Color01">
|
||||
<span><b>'°ü¸®ÀÚ'</b> </span> <img src="img/TxtNiceDay.gif" align="absmiddle" width="87" height="13">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,98 @@
|
||||
<script language="JavaScript">
|
||||
<!--
|
||||
function MM_swapImgRestore() { //v3.0
|
||||
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
|
||||
}
|
||||
|
||||
function MM_preloadImages() { //v3.0
|
||||
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
|
||||
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
|
||||
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
|
||||
}
|
||||
|
||||
function MM_findObj(n, d) { //v4.0
|
||||
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
|
||||
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
|
||||
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
|
||||
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
|
||||
if(!x && document.getElementById) x=document.getElementById(n); return x;
|
||||
}
|
||||
|
||||
function MM_swapImage() { //v3.0
|
||||
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
|
||||
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td bgcolor="098499">
|
||||
<table width="968" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><img src="<?=$DOC_ROOT?>/images/200703/topmn_open.gif" width="150" height="31"></td>
|
||||
<!--Admin main-->
|
||||
<td><a href="<?echo("$DOC_ROOT")?>/main.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','<?=$DOC_ROOT?>/images/200703/topmn_01on.gif',1)"><img name="Image3" border="0" src="<?=$DOC_ROOT?>/images/200703/topmn_01.gif" width="104" height="31"></a></td>
|
||||
<!-- Pop Management -->
|
||||
<td><a href="<?echo("$DOC_ROOT")?>/rcmng/rc_list.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','<?=$DOC_ROOT?>/images/200703/topmn_02on.gif',1)"><img name="Image4" border="0" src="<?=$DOC_ROOT?>/images/200703/topmn_02.gif" width="123" height="31"></a></td>
|
||||
<!-- Volume Management -->
|
||||
<td><a href="<?echo("$DOC_ROOT")?>/volume/vol_list.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','<?=$DOC_ROOT?>/images/200703/topmn_03on.gif',1)"><img name="Image5" border="0" src="<?=$DOC_ROOT?>/images/200703/topmn_03.gif" width="152" height="31"></a></td>
|
||||
<!-- System Management -->
|
||||
<td><a href="<?echo("$DOC_ROOT")?>/sysmng/system_manage.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','<?=$DOC_ROOT?>/images/200703/topmn_04on.gif',1)"><img name="Image6" border="0" src="<?=$DOC_ROOT?>/images/200703/topmn_04.gif" width="144" height="31"></a></td>
|
||||
<!-- Statistics -->
|
||||
<td><a href="<?echo("$DOC_ROOT")?>/statistics/statistics.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','<?=$DOC_ROOT?>/images/200703/topmn_05on.gif',1)"><img name="Image7" border="0" src="<?=$DOC_ROOT?>/images/200703/topmn_05.gif" width="86" height="31"></a></td>
|
||||
<!-- Configuration -->
|
||||
<?
|
||||
// 전체관리자로 로그인했을 경우, Configuration 메뉴를 보여주고,
|
||||
// 일반관리자로 로그인했을 경우, Configuration 메뉴를 숨긴다.
|
||||
if( CheckCookie() == "1" )
|
||||
{
|
||||
?>
|
||||
<td><a href="<?echo("$DOC_ROOT")?>/configuration/admin_list.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','<?=$DOC_ROOT?>/images/200703/topmn_06on.gif',1)"><img name="Image8" border="0" src="<?=$DOC_ROOT?>/images/200703/topmn_06.gif" width="110" height="31"></a></td>
|
||||
<?
|
||||
}
|
||||
else if( CheckCookie() == "2" )
|
||||
{
|
||||
}
|
||||
?>
|
||||
<!-- Event Viewer -->
|
||||
<td><a href="<?echo("$DOC_ROOT")?>/eventviewer/event_list.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','<?=$DOC_ROOT?>/images/200703/topmn_07on.gif',1)"><img name="Image9" border="0" src="<?=$DOC_ROOT?>/images/200703/topmn_07.gif" width="99" height="31"></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- top menu TABLE START
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#094899">
|
||||
<tr>
|
||||
<td width="15" height="31"></td>
|
||||
<td width="154" class="TopMenuTitle">OpenDisk Cluster</td>
|
||||
<td width="18"></td>
|
||||
<td class="TopMenu">
|
||||
<a href="<?echo("$DOC_ROOT")?>/main.html">Admin Main</a>
|
||||
|
|
||||
<a href="<?echo("$DOC_ROOT")?>/volume/vol_list.html">Volume Management</a>
|
||||
|
|
||||
<a href="<?echo("$DOC_ROOT")?>/sysmng/system_manage.html">System Management</a>
|
||||
|
|
||||
<a href="<?echo("$DOC_ROOT")?>/statistics/statistics.html">Statistics</a>
|
||||
|
|
||||
<?
|
||||
// 전체관리자로 로그인했을 경우, Configuration 메뉴를 보여주고,
|
||||
// 일반관리자로 로그인했을 경우, Configuration 메뉴를 숨긴다.
|
||||
if( CheckCookie() == "1" )
|
||||
{
|
||||
?>
|
||||
<a href="<?echo("$DOC_ROOT")?>/configuration/admin_list.html">Configuration</a>
|
||||
|
|
||||
<?
|
||||
}
|
||||
else if( CheckCookie() == "2" )
|
||||
{
|
||||
}
|
||||
?>
|
||||
<a href="<?echo("$DOC_ROOT")?>/eventviewer/event_list.html">Event Viewer</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
top menu TABLE END -->
|
||||
|
||||
Reference in New Issue
Block a user