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"> <form action="dom_subdoedit.php" method="post" name="main" id="main">
<table border="0"> <table border="0">
<tr> <tr>
<td> <td>
<input type="hidden" name="domain" value="<?php ehe($domain) ?>" /> <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="sub_domain_id" value="<?php echo $sub_domain_id ?>" />
<input type="hidden" name="action" value="add" /> <input type="hidden" name="action" value="add" />
<?php <?php
if ($isedit) { if ($isedit) {
__("Edit a subdomain:"); __("Edit a subdomain:");
@ -43,7 +43,7 @@ $dom->unlock();
} }
?></td><td> ?></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> <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 <?php
$first_advanced=true; $first_advanced=true;
$lst_advanced=array(); $lst_advanced=array();
@ -60,10 +60,10 @@ $dom->unlock();
$lst_advanced[]=$dt['name']; $lst_advanced[]=$dt['name'];
if ($first_advanced) { if ($first_advanced) {
$first_advanced=false; $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_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 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 <?php
switch ($dt['target']) { switch ($dt['target']) {
case "NONE":
default:
break;
case "DIRECTORY": ?> 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;" /> <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 display_browser( $targval , "main.t_".$dt['name'] );
<?php
break; break;
case "URL": ?> 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 <small><?php __("(enter an URL here)"); ?></small><?php
break;; break;;
case 'IP':?> 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 <small><?php __("(enter an IPv4 address, for example 192.168.1.2)"); ?></small><?php
break; break;
case 'IPV6':?> case 'IPV6':?>
@ -97,28 +93,31 @@ $dom->unlock();
<small><?php __("(enter an IPv6 address, for example 2001:0910::0)"); ?></small><?php <small><?php __("(enter an IPv6 address, for example 2001:0910::0)"); ?></small><?php
break; break;
case 'TXT':?> 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 <small><?php __("(enter a TXT content for this domain)"); ?></small><?php
break; break;
case 'DOMAIN':?> 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 <small><?php __("(enter a domain name or subdomain)"); ?></small><?php
break; break;
case "NONE":
default:
break;
} // switch ?> } // switch ?>
</td> </td>
</tr> </tr>
<?php } // foreach ?> <?php } // foreach ?>
<tr class="trbtn"> <tr class="trbtn">
<td colspan="2"><input type="submit" class="inb ok" name="add" onclick='return check_type_selected();' value="<?php <td colspan="2"><input type="submit" class="inb ok" name="add" onclick='return check_type_selected();' value="<?php
if ($isedit) { if ($isedit) {
__("Edit this subdomain"); __("Edit this subdomain");
} else { } else {
__("Add this subdomain"); __("Add this subdomain");
} }
?>" /></td> ?>" /></td>
</tr> </tr>
</table> </table>
</form> </form>
<script type="text/javascript"> <script type="text/javascript">

View File

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

View File

@ -176,7 +176,7 @@ class m_action {
* @global m_mysql $db * @global m_mysql $db
* @global m_err $err * @global m_err $err
* @param string $type * @param string $type
* @param m_user $user * @param string|integer $user wich user do we impersonate?
* @param mixed $parameters * @param mixed $parameters
* @return boolean * @return boolean
*/ */
@ -226,7 +226,7 @@ class m_action {
* @param type $all * @param type $all
* @return boolean * @return boolean
*/ */
function get_old($all = null) { function get_old() {
global $err, $db; global $err, $db;
$purge = "select * from actions where TO_DAYS(curdate()) - TO_DAYS(creation) > 2;"; $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")); $err->raise("dom",_("The domain name is syntaxically incorrect"));
return false; return false;
} }
$r=array();
$r["name"]=$dom; $r["name"]=$dom;
$db->query("SELECT * FROM domaines WHERE compte='$cuid' AND domaine='$dom'"); $db->query("SELECT * FROM domaines WHERE compte='$cuid' AND domaine='$dom'");
if ($db->num_rows()==0) { if ($db->num_rows()==0) {
@ -1509,6 +1510,7 @@ class m_dom {
if (!$db->next_record()) { if (!$db->next_record()) {
return false; return false;
} }
$res=array();
do { do {
$res[]=$db->Record; $res[]=$db->Record;
} while ($db->next_record()); } while ($db->next_record());

View File

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

View File

@ -145,7 +145,7 @@ $queryList = array(
foreach ($queryList as $exec_command) { foreach ($queryList as $exec_command) {
exec($exec_command,$output,$return_var); exec($exec_command,$output,$return_var);
if( $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); $db = new \DB_system($user,$database,$password);