| Server IP : 180.180.241.3 / Your IP : 216.73.216.25 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/umedia3/install/ |
Upload File : |
<?
set_time_limit(600);
// Emulate register_globals on
if (!ini_get('register_globals')) {
$superglobals = array($_SERVER, $_ENV,
$_FILES, $_COOKIE, $_POST, $_GET);
if (isset($_SESSION)) {
array_unshift($superglobals, $_SESSION);
}
foreach ($superglobals as $superglobal) {
extract($superglobal, EXTR_SKIP);
}
ini_set('register_globals', true);
}
$f[]="inc/config.inc.php";
$f[]="inc/c.inc.php";
#$f[]="timetable/inc/config.inc.php";
?><IMG SRC="../_tmp/logo/_weblogo.png" WIDTH="261" HEIGHT="66" BORDER="0" ALT=""><BR><B><FONT SIZE="6" COLOR="#4D4D4D">Welcome to Install Utility</FONT></B>
<HR noshade><?
if ($action=="yes") {
sleep(1);
@reset($f);
while (list($k,$v)=each($f)) {
$source="$vspath$v.tp";
$dest="$vspath$v";
@chmod($dest, 0777);
echo "<B><FONT COLOR=darkgreen>Managing</FONT></B>:$v";
if (!file_exists($source)) {
echo "<BR> error: config template(*.tp) not exists.";
} else {
$handle = @fopen($source, "r");
if ($handle) {
$buffer="";
while (!feof($handle)) {
$buffer .= fgets($handle, 4096);
}
fclose($handle);
$buffer=str_replace('%DBPWD%',$vdbpwd,$buffer);
$buffer=str_replace('%DBUSER%',$vdbuser,$buffer);
$buffer=str_replace('%DBHOST%',$vdbhost,$buffer);
$buffer=str_replace('%SPATH%',$vspath,$buffer);
$buffer=str_replace('%SURL%',$vurl,$buffer);
$buffer=str_replace('%VERSIONURL%',$versionurl,$buffer);
$buffer=str_replace('%DBNAME%',$vdbname,$buffer);
if (is_writable($dest)) {
if (!$handle = fopen($dest, 'w')) {
echo "<BR><B>writeerror: </B>Cannot open file ($dest)";
exit;
}
if (fwrite($handle, $buffer) === FALSE) {
echo "<BR><B>writeerror: </B>Cannot write to file ($dest)";
exit;
}
fclose($handle);
} else {
echo "<BR><B>writeerror: </B>The file $dest is not writable";
exit;
}
echo "<BR> <B>Success</B>.";
} else {
echo "<BR> <B>error</B>: config template cannot be opened ($source).";
}
}
echo "<BR>";
}
echo "<BR>
<HR><A HREF=index.php>Back to Install's main</A> <A HREF='$vurl'>Go to installed uMedia</A><BR><HR>";
if ($istdb=="yes") {
include("./tmq.php");
$conn=mysql_connect($vdbhost, $vdbuser, $vdbpwd);
if (!$conn) {
die(("ติดต่อกับ MYSQL Server ไม่ได้/Cannot connect to MYSQL Server"));
}
if ($dropold=="yes") {
mysql_query("Drop DATABASE `$vdbname` ");
echo mysql_error();
}
if ($encodeasthai=="yes") {
mysql_query("SET NAMES 'TIS620';");
echo mysql_error();
}
if ($dbversion=="0") {
} elseif ($dbversion=="3") {
mysql_query("CREATE DATABASE `$vdbname` ");
echo mysql_error();
} else {
mysql_query("CREATE DATABASE `$vdbname` DEFAULT CHARACTER SET tis620 COLLATE tis620_thai_ci; ");
echo mysql_error();
}
if (!mysql_select_db($vdbname, $conn)) {
die(("ไม่สามารถเลือกใช้งานฐานข้อมูลได้/Cannot use specified database [$vdbname]"));
}
$i=0;
$buff="";
$handle = fopen("./backup-full.sql", "rb");
$expact="#%%";
while (!feof($handle)) {
$buff .= fread($handle, 1);
$decus=substr($buff,-3);
if ($decus==$expact) {
$buff=trim($buff,$expact);
tmq($buff);
$i++;
$buff="";
}
}
mysql_query("delete from barcode_val where classid like 'activateulib-%' ");
echo mysql_error();
mysql_query("update library set `Password` = MD5( 'ulibm123' ) ");
echo mysql_error();
mysql_query("update useradmin set `Password` = MD5( 'ulibm123' ) ");
echo mysql_error();
echo "<FONT COLOR=gray><BR>Database installed with $i queries.</FONT>";
}
} else {
$pp = pathinfo($SCRIPT_FILENAME);
//print_r($_SERVER);
$tmpisinstall=str_replace('index.php','',$SCRIPT_NAME);
$tmpisinstall=trim($tmpisinstall,'/');
$tmpisinstall=explode('/',$tmpisinstall);
$tmpisinstall=$tmpisinstall[count($tmpisinstall)-1];
//echo "[$tmpisinstall]";
if ($tmpisinstall!="" && $tmpisinstall!="install") {
die("ติดตั้งได้ก็ต่อเมื่อโฟลเดอร์นี้ชื่อ install, can install only when this folder named install.");
}
//print_r($tmpisinstall);
?>
This will help you configure the program. please enter information required by the system.<BR>
More information and help available on <A HREF="http://www.ulibm.net" target=_blank>www.ulibm.net</A>
<HR noshade>
<SCRIPT LANGUAGE="JavaScript">
<!--
function confrm(wh) {
if (confirm("Please Confirm/กรุณายืนยัน")){
wh.sbmt.disabled=true
return true;
}
return false;
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
pic1= new Image(100,25);
pic1.src="uploading.gif";
function getobj(the_id) {
if (typeof the_id != 'string') {
return the_id;
}
if (typeof document.getElementById != 'undefined') {
return document.getElementById(the_id);
} else if (typeof document.all != 'undefined') {
return document.all[the_id];
} else if (typeof document.layers != 'undefined') {
return document.layers[the_id];
} else {
return null;
}
}
function submitchk(wh) {
if (confirm("Please Confirm/กรุณายืนยัน")){
tmp=getobj("uploadbtn");
tmp.style.display="none";
tmp=getobj("uploading");
tmp.style.display="inline";
return true;
} else {
return false;
}
}
//-->
</SCRIPT>
<FORM METHOD=POST ACTION="index.php?action=yes" onsubmit="return submitchk(this.form);">
Serverpath <INPUT TYPE="text" NAME="vspath" value="<?
$vspath=trim($pp[dirname],'install');
echo $vspath; ?>"><BR>
Program's URL <INPUT TYPE="text" NAME="vurl" value="http://<?
echo trim($_SERVER[SERVER_NAME]."");
echo ":".$_SERVER[SERVER_PORT];
$tmp=str_replace('index.php','',$SCRIPT_NAME);
$tmp=trim($tmp,'/');
$tmp=str_replace('install','',$tmp);
$tmp=trim($tmp,'/');
echo "/";
echo $tmp;
?>"><BR>
Directory <INPUT TYPE="text" NAME="versionurl" value="<?
$tmp=explode('/',trim($tmp,'/'));
$directory= $tmp[count($tmp)-1];
echo $directory;
?>"><BR>
Database Server <INPUT TYPE="text" NAME="vdbhost" value="localhost"><BR>
Database User <INPUT TYPE="text" NAME="vdbuser" value="root"><BR>
Database Name <INPUT TYPE="text" NAME="vdbname" value="<? echo strtolower($directory);?>"><BR>
Database Password <INPUT TYPE="password" NAME="vdbpwd" value=""><BR>
<INPUT TYPE="checkbox" NAME="istdb" value="yes"> Install Database<BR>
<INPUT TYPE="checkbox" NAME="dropold" value="yes"> Drop Old Database<BR>
<INPUT TYPE="checkbox" NAME="encodeasthai" value="yes" checked> Encode as Thai<BR>
<HR noshade>
<?
///////////////
$local_modchk_help= Array();
function local_modchk($wh,$cate="") {
global $local_modchk_help;
global $vspath;
$vspath2=rtrim($vspath,'/');
$b=@chmod($wh,0777);
if (!$b) {
echo "<B>"."มีปัญหาเกี่ยวกับการเปลี่ยนโหมดไฟล์/File permission problem"." </B>- ไม่อนุญาตให้ติดตั้ง [$wh]<BR>";
$tmpd=trim($wh,'.');
$tmpd=trim($tmpd,'/');
$tmpd=$dcrs.$tmpd;
$local_modchk_help[].="chown apache:apache '$vspath2/$tmpd' ;";
//$local_modchk_help[].="chgrp apache '$vspath2/$tmpd' ;";
}
}
@reset($f);
while (list($k,$v)=each($f)) {
local_modchk("../$v",$v);
}
if (count($local_modchk_help)!=0) {
$local_modchk_help=array_unique($local_modchk_help);
$local_modchk_help=join($local_modchk_help,"<BR>");
?><BR><BR><TABLE bgcolor=#858585 width=100% align=center>
<TR>
<TD bgcolor=#E0E0E0><? echo ("หากคุณเป็นผู้ดูแลระบบเซิร์ฟเวอร์บนระบบปฏิบัติการ Linux/If you are server administrator (Linux) ");?><BR>
Execute in command line</TD>
</TR>
<TR>
<TD bgcolor=#E0E0E0><? echo $local_modchk_help;?><BR><BR><small><B>* apache:apache</B> คือชื่อ User และ Group ของโปรแกรม Apache หากเซิร์ฟเวอร์ของคุณมีการปรับแต่งเป็นอย่างอื่น ก็ต้องแก้ apache:apache ตามด้วย</small></TD>
</TR>
</TABLE><?
die;
}
if (!function_exists("mysql_connect")) {
echo "<B>ไม่พบฟังก์ชันของ MySQL กรุณาตรวจสอบ/MySQL function not found</B> - ไม่อนุญาตให้ติดตั้ง";
die;
}
///////////////
?>
<input type=hidden NAME="dbversion" value="4">
<span ID="uploading" style="display:none">Processing: <IMG SRC="uploading.gif" WIDTH="128" HEIGHT="15" BORDER="0" ALT="" align=absmiddle></span>
<span ID="uploadbtn"><INPUT TYPE="submit" value=" Install " name=sbmt ID=sbmt></span>
<SCRIPT LANGUAGE="JavaScript">
<!--
tmp=getobj("uploadbtn");
tmp.style.display="inline";
tmp=getobj("uploading");
tmp.style.display="none";
//-->
</SCRIPT>
</FORM>
<?
}
?>