Cosmetic, as usual

This commit is contained in:
Alan Garcia 2014-03-26 15:40:43 +00:00
parent b305d5a506
commit 4b7890ea64
6 changed files with 30 additions and 27 deletions

View File

@ -29,12 +29,12 @@ $dom->unlock();
?>
<form action="dom_subdoedit.php" method="post" name="main" id="main">
<table border="0">
<tr>
<td>
<input type="hidden" name="domain" value="<?php ehe($domain) ?>" />
<input type="hidden" name="sub_domain_id" value="<?php echo $sub_domain_id ?>" />
<input type="hidden" name="action" value="add" />
<table border="0">
<tr>
<td>
<input type="hidden" name="domain" value="<?php ehe($domain) ?>" />
<input type="hidden" name="sub_domain_id" value="<?php echo $sub_domain_id ?>" />
<input type="hidden" name="action" value="add" />
<?php
if ($isedit) {
__("Edit a subdomain:");
@ -43,7 +43,7 @@ $dom->unlock();
}
?></td><td>
<input type="text" class="int" name="sub" style="text-align:right" value="<?php ehe($sub); ?>" size="22" id="sub" /><span class="int" id="newsubname">.<?php echo $domain; ?></span></td>
</tr>
</tr>
<?php
$first_advanced=true;
$lst_advanced=array();
@ -60,10 +60,10 @@ $dom->unlock();
$lst_advanced[]=$dt['name'];
if ($first_advanced) {
$first_advanced=false;
echo "<tr><td colspan=\"2\" class=\"advdom\"></td></tr>";
echo "<tr><td colspan=\"2\" class=\"advdom\"></td></tr>";
echo "<tr id='domtype_show' onClick=\"domtype_advanced_show();\"><td colspan='2'><a href=\"javascript:domtype_advanced_show();\"><b>+ "; __("Show advanced options"); echo "</b></a></td></tr>";
echo "<tr id='domtype_hide' onClick=\"domtype_advanced_hide();\" style='display:none'><td colspan='2'><a href=\"javascript:domtype_advanced_hide();\"><b>- "; __("Hide advanced options"); echo "</b></a></td></tr>";
echo "<tr><td colspan=\"2\" class=\"advdom\"></td></tr>";
echo "<tr><td colspan=\"2\" class=\"advdom\"></td></tr>";
}
}
?>
@ -76,20 +76,16 @@ $dom->unlock();
<?php
switch ($dt['target']) {
case "NONE":
default:
break;
case "DIRECTORY": ?>
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe($targval); ?>" size="28" onKeyPress="getElementById('r_<?php echo $dt['name']?>').checked=true;" />
<?php display_browser( $targval , "main.t_".$dt['name'] ); ?>
<?php
<?php display_browser( $targval , "main.t_".$dt['name'] );
break;
case "URL": ?>
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe( (empty($targval)?'http://':$targval) ); ?>" size="50" onKeyPress="getElementById('r_<?php echo $dt['name']?>').checked=true;" />
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe( (empty($targval)?'http://':$targval) ); ?>" size="50" onKeyPress="getElementById('r_<?php echo $dt['name']?>').checked=true;" />
<small><?php __("(enter an URL here)"); ?></small><?php
break;;
case 'IP':?>
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe($targval); ?>" size="16" onKeyPress="getElementById('r_<?php echo $dt['name']?>').checked=true;" />
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe($targval); ?>" size="16" onKeyPress="getElementById('r_<?php echo $dt['name']?>').checked=true;" />
<small><?php __("(enter an IPv4 address, for example 192.168.1.2)"); ?></small><?php
break;
case 'IPV6':?>
@ -97,28 +93,31 @@ $dom->unlock();
<small><?php __("(enter an IPv6 address, for example 2001:0910::0)"); ?></small><?php
break;
case 'TXT':?>
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe($targval);?>" size="32" onKeyPress="getElementById('r_<?php echo $dt['name']?>').checked=true;" />
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe($targval);?>" size="32" onKeyPress="getElementById('r_<?php echo $dt['name']?>').checked=true;" />
<small><?php __("(enter a TXT content for this domain)"); ?></small><?php
break;
case 'DOMAIN':?>
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe($targval);?>" size="32" onKeyPress="getElementById('r_<?php echo $dt['name']?>').checked=true;" />
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe($targval);?>" size="32" onKeyPress="getElementById('r_<?php echo $dt['name']?>').checked=true;" />
<small><?php __("(enter a domain name or subdomain)"); ?></small><?php
break;
case "NONE":
default:
break;
} // switch ?>
</td>
</tr>
<?php } // foreach ?>
<tr class="trbtn">
<td colspan="2"><input type="submit" class="inb ok" name="add" onclick='return check_type_selected();' value="<?php
<tr class="trbtn">
<td colspan="2"><input type="submit" class="inb ok" name="add" onclick='return check_type_selected();' value="<?php
if ($isedit) {
__("Edit this subdomain");
} else {
__("Add this subdomain");
}
?>" /></td>
</tr>
</table>
</tr>
</table>
</form>
<script type="text/javascript">

View File

@ -27,6 +27,7 @@ class DB_Sql {
/* public: result array and current row number */
var $Record = array();
var $Row;
var $num_rows;
/* public: current error number and error text */
var $Errno = 0;

View File

@ -176,7 +176,7 @@ class m_action {
* @global m_mysql $db
* @global m_err $err
* @param string $type
* @param m_user $user
* @param string|integer $user wich user do we impersonate?
* @param mixed $parameters
* @return boolean
*/
@ -226,7 +226,7 @@ class m_action {
* @param type $all
* @return boolean
*/
function get_old($all = null) {
function get_old() {
global $err, $db;
$purge = "select * from actions where TO_DAYS(curdate()) - TO_DAYS(creation) > 2;";

View File

@ -1091,6 +1091,7 @@ class m_dom {
$err->raise("dom",_("The domain name is syntaxically incorrect"));
return false;
}
$r=array();
$r["name"]=$dom;
$db->query("SELECT * FROM domaines WHERE compte='$cuid' AND domaine='$dom'");
if ($db->num_rows()==0) {
@ -1509,6 +1510,7 @@ class m_dom {
if (!$db->next_record()) {
return false;
}
$res=array();
do {
$res[]=$db->Record;
} while ($db->next_record());

View File

@ -1072,12 +1072,13 @@ class m_mysql {
global $db,$err,$cuid;
$err->log("mysql","export");
$db->query("SELECT login, pass, db, bck_mode, bck_dir, bck_history, bck_gzip FROM db WHERE uid='$cuid';");
$str="";
if ($db->next_record()) {
$str =" <sql>\n";
$str.=" <sql>\n";
$str.=" <login>".$db->Record["login"]."</login>\n";
$str.=" <pass>".$db->Record["pass"]."</pass>\n";
do {
$filename=$tmpdir."/mysql.".$db->Record["db"].".sql.gz";
$filename=$tmpdir."/mysql.".$db->Record["db"].".sql.gz"; // FIXME not used
$str.=" <database>".($db->Record["db"])."</database>\n";
$str.=" <password>".($db->Record["pass"])."</password>\n";
if ($s["bck_mode"]!=0) { // FIXME what is $s ?

View File

@ -145,7 +145,7 @@ $queryList = array(
foreach ($queryList as $exec_command) {
exec($exec_command,$output,$return_var);
if( $return_var){
throw new \Exception("[!] Mysql exec error : $exec_command \n Error : \n ".print_r($output,1));
throw new \Exception("[!] Mysql exec error : $exec_command \n Error : \n ".print_r($output,true));
}
}
$db = new \DB_system($user,$database,$password);