Малко помощ

winbooz3

Registered
Някой може ли да ми вгради този код
Код:
<?php 
$down_one = "yes"; 
require_once('../database/db.php'); 

$title = "New User"; 

 $colname_Packages = "1"; 
 mysql_select_db($database_Customer_Database, $Customer_Database); 
 $query_Packages = sprintf("SELECT * FROM packages", $colname_Packages); 
 $Packages = mysql_query($query_Packages, $Customer_Database) or die(mysql_error()); 
 $row_Packages = mysql_fetch_assoc($Packages); 
 $totalRows_Packages = mysql_num_rows($Packages); 

 $database_MySQLUsers = "mysql"; 
 $MySQLUsers = mysql_pconnect($db_host, $db_user, $db_pass) or die(mysql_error()); 


function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{ 
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; 

  switch ($theType) { 
    case "text": 
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; 
      break;    
    case "long": 
    case "int": 
      $theValue = ($theValue != "") ? intval($theValue) : "NULL"; 
      break; 
    case "double": 
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; 
      break; 
    case "date": 
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; 
      break; 
    case "defined": 
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; 
      break; 
  } 
  return $theValue; 
} 

$editFormAction = $HTTP_SERVER_VARS['PHP_SELF']; 
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { 
  $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING']; 
} 

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { 
//-------------------------------------------------------------------------------------------------------------------------------------------------------------- 
//Auto User Creater 
//this mod allows you to add users easily. It automtic builds a ftp-account on SlimFTPD and creates a folder. 
//You don't have to fill in the pathnames anymore while adding a user. This mod will finish everything! 
//Copyright Vincent Bitter Webdesign 
// I would like to thank the copyright owner of the ftp script for the great help in creating this script. 
//your free to use this mod, but please don't remove the copyright-note 

//settings 
 $basedir = "C:/Program Files/EasyPHP1-8/www/host/hosted"; 
 $ftpd = "../../../slimftpd/slimftpd.conf"; 
 $url = "http://manara.nl/host/hosted"; 


//general 
 $dir = $basedir . "\\" . $HTTP_POST_VARS['servicename']; 
 $urld = $url . "\\" . $HTTP_POST_VARS['servicename']; 
//create directory 
 if(!file_exists($dir))   { 
   mkdir($dir); 
 } 
//create ftp-account 
 $new_file = implode ('', file ($ftpd)); 
 $new_file .= " 
<User \"". $HTTP_POST_VARS['servicename'] ."\"> 
Password \"". $HTTP_POST_VARS['ftppass'] ."\" 
Mount / ". $dir ." 
Allow / All 
</User>"; 
 $editfile = fopen($ftpd, "w"); 
 fwrite($editfile, $new_file); 
 fclose($editfile); 
 exec("net stop slimftpd"); 
 exec("net start slimftpd"); 
 $dir = str_replace("\\","/",$dir); 
//-------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  
 $colname_Packages2 = "1"; 
 mysql_select_db($database_Customer_Database, $Customer_Database); 
 $query_Packages2 = sprintf("SELECT * FROM packages WHERE package_name = '".$_POST['webservice']."'", $colname_Packages2); 
 $Packages2 = mysql_query($query_Packages2, $Customer_Database) or die(mysql_error()); 
 $row_Packages2 = mysql_fetch_assoc($Packages2); 
 $totalRows_Packages2 = mysql_num_rows($Packages2); 
  
  $updateSQL = sprintf("INSERT custumerbase (servicename, name, Rank, email, adminemail, ftppass, address, city, zip, state, phone, webservice, status, homedir, mysqluser, mysqlpass, mysqldatabases, notes, PaidTill, url) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", 
                       GetSQLValueString($_POST['servicename'], "text"), 
                       GetSQLValueString($_POST['name'], "text"), 
                       GetSQLValueString($_POST['Rank'], "text"), 
                       GetSQLValueString($_POST['email'], "text"), 
                       GetSQLValueString($_POST['adminemail'], "text"), 
                       GetSQLValueString(md5($_POST['ftppass']), "text"), 
                       GetSQLValueString($_POST['address'], "text"), 
                       GetSQLValueString($_POST['city'], "text"), 
                       GetSQLValueString($_POST['zip'], "text"), 
                       GetSQLValueString($_POST['state'], "text"), 
                       GetSQLValueString($_POST['phone'], "text"), 
                       GetSQLValueString($_POST['webservice'], "text"), 
                       GetSQLValueString($_POST['status'], "text"), 
                       GetSQLValueString($dir, "text"), 
                       GetSQLValueString($_POST['servicename'], "text"), 
                       GetSQLValueString(md5($_POST['ftppass']), "text"), 
                       GetSQLValueString($_POST['servicename']."1", "text"), 
                       GetSQLValueString($_POST['notes'], "text"), 
                       GetSQLValueString($_POST['PaidTill'], "text"), 
                  GetSQLValueString($urld, "text")); 

  mysql_select_db($database_Customer_Database, $Customer_Database); 
  $Result1 = mysql_query($updateSQL, $Customer_Database) or die(mysql_error()); 

  mysql_select_db($database_MySQLUsers, $MySQLUsers); 
  $updateSQL = mysql_query("CREATE DATABASE ".$_POST['servicename']."_db", $MySQLUsers); 
  $updateSQL = mysql_query("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON ".$_POST['servicename']."_1.* TO ".$_POST['servicename']."@localhost IDENTIFIED BY '".$_POST['ftppass']."';", $MySQLUsers);  
  $updateSQL = mysql_query("FLUSH PRIVILEGES;", $MySQLUsers); 

  if (isset($_POST['sendmail'])) { 
     $template = fopen($row_Config['installdir']."/mailtemplate.txt",'r'); 
   $email = fread($template, filesize($row_Config['installdir']."/mailtemplate.txt")); 
      $filter = str_replace('[name]', $_POST['name'], $email); 
      $filter = str_replace('[company]', $row_Config['company'], $filter); 
      $filter = str_replace('[url]', $_POST['url'], $filter); 
      $filter = str_replace('[package]', $_POST['webservice'], $filter); 
      $filter = str_replace('[username]', $_POST['servicename'], $filter); 
      $filter = str_replace('[password]', $_POST['ftppass'], $filter); 
      $filter = str_replace('[ftp]', $row_Config['ftpserver'], $filter); 
      $filter = str_replace('[address]', $_POST['address'], $filter); 
      $filter = str_replace('[city]', $_POST['city'], $filter); 
      $filter = str_replace('[state]', $_POST['state'], $filter); 
      $filter = str_replace('[zip]', $_POST['zip'], $filter); 
      $filtered = str_replace('[phone]', $_POST['phone'], $filter); 
   mail($_POST['email'],"Your ".$row_Config['company']." Hosting Account",$filtered); 
  } 
////////////////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////////////////////////////////////////////////////////////// 
/////// Create folder on add user 
////////////////////////////////////////////////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////////////////////////////////////////////////////////////// 
function dir_copy ($to_path,$from_path){ 
    $this_path = getcwd(); 
    if(!is_dir($to_path)) 
    {    mkdir($to_path, 0775); 
    } 
    
    if (is_dir($from_path)) 
    { 
        chdir($from_path); 
        $handle=opendir('.'); 
        while (($file = readdir($handle))!==false) 
        { 
            if (($file != ".") && ($file != "..")) 
            { 
                if (is_dir($file)) 
                { 
                    chdir($this_path); 
                    rec_copy ($from_path.$file."/", $to_path.$file."/"); 
                    chdir($this_path); 
                    chdir($from_path); 
                } 
                if (is_file($file)) 
                { 
                    chdir($this_path); 
                    copy($from_path.$file, $to_path.$file); 
                    chdir($from_path); 
                } 
            } 
        } 
        closedir($handle); 
    } 
    chdir($this_path); 
} 
    
   dir_copy($_POST['homedir'], $row_Config['installdir']."/construction"); 
//////////////// 
// Done with folder creation 
//////////////// 
  echo ("<script language=javascript>document.location.href = '?page=usermanagement'</script>"); 
} 


?><html> 
<head> 
<title><?php echo $lang_btnnewuser; ?></title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 

<body> 
<table width="565" height="168" border="0" align="center" cellpadding="0" cellspacing="0"> 
  <tr> 
    <td height="168" align="left" valign="top"> 
      <form name="form1" method="post" action="<?php echo $editFormAction; ?>"> 
        <table width="100%"  border="0" cellspacing="0" cellpadding="0"> 
          <tr> 
            <td width="38%" height="50"><strong><?php echo $lang_btnnewuser; ?></strong> <br> 
            (* = <?php echo $lang_required; ?>)</td> 
            <td width="62%"><div align="right"><font color="#FF0000"><img src="images/header-usermanagement.gif" width="500" height="50"></font></div></td> 
          </tr> 
        </table> 
        <p> </p> 
        <table width="570" border="0" align="center" cellpadding="0" cellspacing="0"> 
          <tr align="left" valign="top"> 
            <td width="277" height="50"><font size="2"><strong>*<?php echo $lang_servicename; ?>:</strong> 
              <input name="servicename" type="text" id="servicename" size="20"> 
              <br> 
              <font size="1">- should match their username on your FTP server. 
            (ex. demo)</font></font></td> 
            <td width="313"><font size="2"><strong>*<?php echo $lang_password; ?>:</strong> 
              <input name="ftppass" type="text" id="ftppass" size="20"> 
              <br> 
              <font size="1">- should match their password on your FTP server. 
              (ex. demo)</font></font></td> 
          </tr> 
          <tr align="left" valign="top"> 
            <td height="50"><font size="2"><strong><?php echo $lang_name; ?>: </strong> 
              <input name="name" type="text" id="name3" size="20"> 
              <br> 
            <font size="1">(ex. Demo User) </font></font></td> 
            <td><font size="2"><strong><?php echo $lang_youremail; ?>:</strong> 
              <input name="email" type="text" id="email" size="20"> 
              <br> 
              <font size="1">-the client's main e-mail address (ex. demo@demo.com)</font></font></td> 
          </tr> 
          </tr> 
          <tr align="left" valign="top"> 
            <td height="62"><font size="2"><strong>*<?php echo $lang_rank; ?>:</strong> 
              <select name="Rank" id="select"> 
<?php if ($_SESSION['Rank'] == 'Admin') { ?> 
<?php } ?> 
            <option selected>User</option> 
              </select> 
            </font></td> 
            <td><font size="2"><strong><?php echo $lang_adminemails; ?>:</strong> 
              <input name="adminemail" type="text" id="adminemail" size="20"> 
              <br> 
              <font size="1">- e-mail addresses allowed to make changes to this 
              account with your tech support. Seperate by commas. (ex. demo@demo.com)</font></font></td> 
          </tr> 
          <tr align="left" valign="top"> 
            <td height="51"><font size="2"><strong>*<?php echo $lang_webpackage; ?>:</strong> 
              <select name="webservice" id="webservice"> 
                <?php do { ?> 
                <option><?php echo $row_Packages['package_name']; ?></option> 
                <?php } while ($row_Packages = mysql_fetch_assoc($Packages)); ?> 
              </select> 
            </font></td> 
          </tr> 
          <tr align="left" valign="top"> 
            <td><font size="2"><strong><?php echo $lang_status; ?>:</strong> 
              <select name="status" id="status"> 
                <option>Active</option> 
              </select> 
              </font></td> 
            <td><font size="2"><strong><?php echo $lang_paidtill; ?>:</strong> 
              <input name="PaidTill" type="text" id="PaidTill" size="20"> 
              <br> 
              <font size="1">-format: YYYY-MM-DD (ex.2004-01-12)</font> </font></td> 
          </tr> 
        </table> 
        <hr> 
        <table width="570" border="0" align="center" cellpadding="0" cellspacing="0"> 
          <tr align="left" valign="top"> 
            <td width="273" height="31"><font size="2"><strong>Address:</strong> 
              <input name="address" type="text" id="servicename3" size="20"> 
            </font></td> 
            <td width="317"><font size="2"><strong>State:</strong> 
              <input name="state" type="text" id="state" size="3"> 
              <strong>Zip Code:</strong> 
              <input name="zip" type="text" id="address3" size="10"> 
              </font></td> 
          </tr> 
          <tr align="left" valign="top"> 
            <td><font size="2"><strong>City:</strong> 
              <input name="city" type="text" id="address" size="20"> 
              </font></td> 
            <td><font size="2"><strong>Phone:</strong> 
              <input name="phone" type="text" id="address4" size="20"> 
              </font></td> 
          </tr> 
        </table> 
        <hr> 
        <table width="570" border="0" align="center" cellpadding="0" cellspacing="0"> 
          <tr> 
            <td width="117"><strong><?php echo $lang_accountnotes; ?>:</strong></td> 
            <td width="473"> 
            <textarea name="notes" cols="45" wrap="VIRTUAL" id="notes" rows="1"></textarea> 
            </td> 
          </tr> 
        </table> 
        <p align="right"><font size="2"> 
          <input name="sendmail" type="checkbox" id="sendmail" value="1" checked> 
          Send a welcome email - 
          <input name="id" type="hidden" id="id" value="<?php echo $row_Users['id']; ?>"> 
          <input name="MM_update" type="hidden" value="form1"> 
          <input type="submit" name="Submit" value="<?php echo $lang_btnaddnew; ?>"> 
          </font></p> 
      </form></td> 
  </tr> 
</table> 
</body> 
</html>
във този
Код:
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=200,left = 540,top = 412');");
}
</script>

<?php if ($row_User['unansweredpm'] == '1') {
	echo "<script>popUp('newpm.php');</script>";
	$updateSQL = "UPDATE custumerbase SET unansweredpm='0' WHERE servicename='".$_SESSION['username']."'";

	mysql_select_db($database_Customer_Database, $Customer_Database);
	$Update = mysql_query($updateSQL, $Customer_Database) or die(mysql_error());
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>GTX Hosting</title>
<meta name="description" content="Joomla - the dynamic portal engine and content management system" />
<meta name="keywords" content="Joomla, joomla" />
<meta name="Generator" content="Joomla! - Copyright (C) 2005 - 2006 Open Source Matters. All rights reserved." />
<meta name="robots" content="index, follow" />
	<link rel="shortcut icon" href="http://gtxtorrents.com/images/favicon.ico" />
	<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<link href="http://gtxtorrents.com/templates/rt_bentobox_dark/css/splitmenu.css" rel="stylesheet" type="text/css" />
<link href="http://gtxtorrents.com/templates/rt_bentobox_dark/litebox/lightbox.css" rel="stylesheet" type="text/css" media="screen" />
<link href="http://gtxtorrents.com/templates/rt_bentobox_dark/css/template_css.css" rel="stylesheet" type="text/css" />
<link href="http://gtxtorrents.com/templates/rt_bentobox_dark/css/style1.css" rel="stylesheet" type="text/css" />



<link rel="shortcut icon" href="http://gtxtorrents.com/images/favicon.ico" />
<script type="text/javascript" src="http://gtxtorrents.com/templates/rt_bentobox_dark/js/prototype.lite.js"></script>
<script type="text/javascript" src="http://gtxtorrents.com/templates/rt_bentobox_dark/js/moo.fx.js"></script>
<script type="text/javascript" src="http://gtxtorrents.com/templates/rt_bentobox_dark/js/litebox-1.0.js"></script>
<style type="text/css">

</style>
</head>
<body id="page-bg" class="f-default style1 splitmenu">
	<center><div id="wrapper">
		<div id="mainbody">
			<div class="shad-1">
				<div class="shad-2">
					<div class="shad-3">
						<div id="header">
							<div id="search">
								<span class="searchtitle">Търсене</span>
								<form action="index.php?option=com_search&Itemid=5" method="get">
								<div class="search">
								  <input name="searchword" id="mod_search_searchword" maxlength="20" alt="search" class="inputbox" size="20" value="keywords..." onBlur="if(this.value=='') this.value='keywords...';" onFocus="if(this.value=='keywords...') this.value='';" type="text" />
								</div>
								  <input name="option" value="com_search" type="hidden" />
								  <input name="Itemid" value="5" type="hidden" />
								</form>
							</div>
							<div id="tabmenu">
								<ul class="mainlevel"><li class="index-1 "><a href="http://gtxtorrents.com/">Начало</a></li>
<li class="index-2 "><a href="http://gtxtorrents.com/index.php?option=com_contact&Itemid=3">Контакти</a></li>
<li class="index-3 "><a href="http://gtxtorrents.com/index.php?option=com_content&task=section&id=1&Itemid=2">Новини</a></li>
<li class="index-4 "><a href="http://gtxtorrents.com/index.php?option=com_weblinks&Itemid=23">Линкове</a></li>
</ul>							</div>
							<a href="http://gtxtorrents.com/cp/zpanel.php" class="nounder"><img src="http://www.gtxtorrents.com/images/blank.png" border="0" alt="" id="logo" /></a>
														<div id="nav-main" class="splitmenu2">
								<ul class="mainlevel"><li class="index-1 "><a href="http://gtxtorrents.com/">Начало</a></li>
<li class="index-2 "><a href="http://gtxtorrents.com/cp/index.php/">GTX Panel</a></li>
<li class="index-3 "><a href="http://gtxtorrents.com/admin/free.php/">Регистрация</a></li>
<li class="index-4 "><a href="http://gtxtorrents.com/http://www.gtxtorrents.com/index.php?option=com_content&task=blogsection&id=0&Itemid=9">Блог</a></li>
<li class="index-4 "><a href="http://gtxtorrents.com/forums">Форум</a></li>
<li class="index-4 "><a href="http://gtxtorrents.com/index.php?option=com_contact&Itemid=3">Контакти</a></li>
</ul>							</div>
														<div id="nav-sub">
						  </div>
						</div>

					</div>
					<div id="content-bg">
						<div class="border-pad border-bottom">
								<div id="showcase">
									<div class="clr">
									  <table width="600" border="0" class="moduletable">
                                        <tr>
                                          <td><div class="style4"><?
																											?></div></td>
                                          <td> </td>
                                        </tr>
                                      </table>
									</div>
																																																						<div class="usermodule" style="width:99%">
												
								  </div>
																											<div class="clr"></div>
								</div>
						</div>
						<div id="middlecolumn" class="border-pad">
														<div id="fakecolumn1" class="sc_1">
								<div id="fakecolumn2">
																		<div id="leftcolumn">
										<div id="vert-menu">
																		  </div>
												<div class="moduletable">
							<h3>Статистика</h3>
					        <form action="http://gtxtorrents.com/index.php?option=com_smslogin&task=login" method="post" name="login" >
		
	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td>
			<label for="mod_login_username"></label></td>
	</tr>
	<tr>
		<td>
			<a href="http://gtxtorrents.com/index.php?option=com_registration&task=lostPassword"></a>		</td>
	</tr>
			<tr>
			<td>
				<span class="f-smaller style4"> Здравей, <?php echo $row_User['servicename']; ?>.<br>
<br>
          (<a href="zpanel.php">Home</a>)<br>
			    <?php if ($row_User['Rank'] == 'Admin') { ?>
			              (<a href="admin/index.php">Administration</a>)<br>
				<?php } ?>
				          (<a href="logout.php">Logout</a>)
                </p>
				</span>
				<p class="f-smaller style4"><u>Информация</u><br>
                  ID: <?php echo $row_User['id']; ?><br>
                  Име: <?php echo $row_User['servicename']; ?><br>
                  Позиция: <?php echo $row_User['Rank']; ?><br>
                  Статус: Активен <br>
                  Сайт: http://gtxtorrents.com/hosted/<?php echo $row_User['servicename']; ?><br />
                  Суб домейни:<br /> 
                <?php echo $row_User['servicename']; ?>.gtxtorrents.com<br />
                  Директория:<br />
                Е:/Serv/www/cp/hosted/<?php echo $row_User['servicename']; ?> 
                <br />
				    <u>Хостинг пакет</u><br>
				    <?php
	mysql_select_db($database_Customer_Database, $Customer_Database);
	$query_Service = sprintf("SELECT * FROM packages WHERE package_name = '".$row_User['webservice']."'");
	$Service = mysql_query($query_Service, $Customer_Database) or die(mysql_error());
	$row_Service = mysql_fetch_assoc($Service);
?>
				    Тип: <?php echo $row_User['webservice']; ?> <br>
				    Квота: <?php echo $row_Service['package_quota']; ?> MB<br>
				    Цена: <?php echo $lang_currency.$row_Service['package_mo_price']; ?>/месец<br>
				    База данни: <?php echo $row_Service['maxsql']; ?> <br>
				    FTP акаунти: <?php echo $row_Service['maxftp']; ?><br /> 
				  <u>Сървъри</u><br>
				    FTP: gtxtorrents.com<br>
				    POP3 Server: В процес!<br>
				    SMTP Server: В процес!<br />
				    SMTP User: В процес!<br />
				    SMTP Pass: В процес!<br />
				  <br />
		</tr>
			</table>
	
	
	<input type="hidden" name="op2" value="login" />
	<input type="hidden" name="lang" value="bulgarian" />
	<input type="hidden" name="return" value="http://gtxtorrents.com/" />
	<input type="hidden" name="message" value="0" />
	<input type="hidden" name="j55a246ab7a538c71d83694a0219d8a2d" value="1" />
	</form>
			</div>
											</div>
									
										<div id="align-padding">
																																												<div id="componentcolumn" class="sc_0">
												<div class="padding"><table width="600" border="0">
                                    <tr>
                                      <td><?php
if (!isset($_GET['page'])){
	include("main.php");
}else{
	if (isset($_GET['ext'])) {
		$Pass = GetContents($_GET['page'], $zpaneldirectory, $_GET['ext']);
		if ($Pass){
			include ($Pass);
		}else{
			echo ($Pass);
		}
	}else{
		$Pass = GetContents($_GET['page'], $zpaneldirectory);
		if ($Pass){
			include ($Pass);
		}else{
			echo ($Pass);
		}
	}
}
?></td>
                                    </tr>
                                  </table>
																																												  </div>
										  </div>
										</div>
										<div class="clr"></div>
									</div>
									<div class="clr"></div>
								</div>
								<div class="clr"></div>
															</div>
							<div class="clr"></div>
						</div>
					</div>
				</div>
			</div>
			<div id="bottom">
				<div class="shad-1">
					<div class="shad-2">
											</div>
				</div>
			</div>
		</div></center>

	
	
	


</body>
</html>
 

Back
Горе