Bugfix: corrections de notices php au niveau du panel

This commit is contained in:
Steven Mondji-Lerider 2012-05-16 15:33:04 +00:00
parent a465a09e49
commit 8910c3e604
12 changed files with 34 additions and 19 deletions

View File

@ -39,6 +39,13 @@ if (!$admin->enabled) {
$fields = array (
"canpass" => array ("request", "integer", 1),
"login" => array ("request", "string", null),
"pass" => array ("request", "string", null),
"passconf" => array ("request", "string", null),
"notes" => array ("request", "string", null),
"nom" => array ("request", "string", null),
"prenom" => array ("request", "string", null),
"nmail" => array ("request", "string", null),
);
getFields($fields);
@ -47,7 +54,7 @@ getFields($fields);
<hr id="topbar"/>
<br />
<?php
if ($error) {
if (isset($error) && $error) {
echo "<p class=\"error\">$error</p>";
}
?>
@ -73,7 +80,7 @@ if ($error) {
</tr>
<tr>
<th><label for="notes"><?php __("Notes"); ?></label></th>
<td><textarea name="notes" id="notes" class="int" cols="32" rows="5"><?php echo $notes; ?></textarea></td>
<td><textarea name="notes" id="notes" class="int" cols="32" rows="5"><?php ehe($notes); ?></textarea></td>
</tr>
<tr>
<th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th>

View File

@ -59,7 +59,7 @@ if (!($u=$admin->add_mem($login, $pass, $nom, $prenom, $nmail, $canpass, $type,
*
* 1 = force = ne tient pas compte du whois ou des droits de tld
*/
if (($create_dom == 1) && !is_null($create_dom_list)) {
if (isset($create_dom) && ($create_dom == 1) && !is_null($create_dom_list)) {
// make sure we don't have multiple dots there
$dom->lock();
$dom->add_domain($login.".".preg_replace("/^\.\.*/", "", $create_dom_list),1,1,1);

View File

@ -50,7 +50,7 @@ if (!$quota->cancreate("dom")) { ?>
<?php
exit();
}
if ($error) echo "<p class=\"error\">$error</p>";
if (isset($error) && $error) echo "<p class=\"error\">$error</p>";
?>
<form method="post" action="dom_doadd.php" id="main">
<p>

View File

@ -40,7 +40,7 @@ if (!$quota->cancreate("ftp")) {
<hr id="topbar"/>
<br />
<?php
if ($error) {
if (isset($error) && $error) {
echo "<p class=\"error\">$error</p>";
if ($fatal) {
include_once("foot.php");

View File

@ -43,7 +43,6 @@ if (!$id) {
$error=$err->errstr();
}
}
?>
<h3><?php __("Editing an FTP account"); ?></h3>
<?php
@ -57,9 +56,9 @@ if (isset($error) && $error) {
<table border="1" cellspacing="0" cellpadding="4">
<tr><th><input type="hidden" name="id" value="<?php echo $id ?>" />
<label for="login"><?php __("Username"); ?></label></th><td>
<select class="inl" name="prefixe"><?php $ftp->select_prefix_list($r["prefixe"]); ?></select>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="login" id="login" value="<?php ehe($r["login"]); ?>" size="20" maxlength="64" />
<select class="inl" name="prefixe"><?php $ftp->select_prefix_list($r["prefixe"]); ?></select>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="login" id="login" value="<?php ehe($r[0]["login"]); ?>" size="20" maxlength="64" />
</td></tr>
<tr><th><label for="dir"><?php __("Folder"); ?></label></th><td><input type="text" class="int" name="dir" id="dir" value="<?php ehe($r["dir"]); ?>" size="20" maxlength="64" />
<tr><th><label for="dir"><?php __("Folder"); ?></label></th><td><input type="text" class="int" name="dir" id="dir" value="<?php ehe($r[0]["dir"]); ?>" size="20" maxlength="64" />
<script type="text/javascript">
<!--

View File

@ -30,7 +30,10 @@
require_once("../class/config.php");
include_once ("head.php");
if ($confirm=="y") {
if(!isset($error)){
$error="";
}
if (isset($confirm) && $confirm=="y" ) {
reset($_POST);
while (list($key,$val)=each($_POST)) {
if (substr($key,0,4)=="del_") {

View File

@ -93,7 +93,7 @@ for($i=0;$i<count($r);$i++) {
<table class="tedit">
<tr><th><?php __("Username"); ?></th><td><code><?php echo $mem->user["login"]; ?></code></td></tr>
<tr><th><label for="pass"><?php __("Password"); ?></label></th><td><code><input class="int" type="password" name="pass" id="pass" value="" /></code></td></tr>
<tr><th><?php __("SQL Server"); ?></th><td><code><?php echo $mysql->server; ?></code></td></tr>
<tr><th><?php __("SQL Server"); ?></th><td><code><?php echo $L_MYSQL_HOST; ?></code></td></tr>
<tr><th><?php __("Database"); ?></th><td><code><?php echo $mem->user["login"]; ?></code></td></tr>
<tr class="trbtn"><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create my main database"); ?>" /></td></tr>
</table>

View File

@ -47,7 +47,7 @@ if (!$quota->cancreate("mysql_users")) {
<hr id="topbar"/>
<br />
<?php
if ($error) {
if (isset($error) && $error) {
echo "<p class=\"error\">$error</p>";
if ($fatal) {
?>

View File

@ -28,8 +28,10 @@
----------------------------------------------------------------------
*/
require_once("../class/config.php");
if ($confirm=="y") {
if(!isset($error)){
$error="";
}
if (isset($confirm) && ($confirm=="y")) {
reset($_POST);
while (list($key,$val)=each($_POST)) {
if (substr($key,0,4)=="del_") {

View File

@ -1224,8 +1224,6 @@ EOF;
if (!$pol["allowlogin"]) {
// We do misc check on password versus login :
$l2=str_replace("_","@",$l2);
$l2=str_replace(".","@",$l2);
$logins=explode("@",$login);
$logins[]=$login;
foreach($logins as $l) {

View File

@ -119,18 +119,19 @@ class m_ftp {
$db->query("SELECT id, name, homedir FROM ftpusers WHERE uid='$cuid' AND id='$id';");
if ($db->num_rows()) {
$db->next_record();
$tr=preg_match("/^\/var\/alternc\/html\/.\/[^\/]*\/(.*)$/", $db->f("homedir"),$match); /*"*/
$tr=preg_match("/^\/var\/alternc\/html\/.\/[^\/]*\/(.*)$/", $db->f("homedir"),$match);
$lg=explode("_",$db->f("name"));
if (!is_array($lg)) {
if ((!is_array($lg)) || (count($lg)!=2)) {
$lg[0]=$db->f("name");
$lg[1]="";
}
return array(
$r[]=array(
"id"=>$db->f("id"),
"prefixe"=> $lg[0],
"login"=>$lg[1],
"dir"=>$match[1]
);
return $r;
} else {
$err->raise("ftp",2);
return false;

View File

@ -97,9 +97,15 @@ class m_mail {
global $db,$err,$cuid;
$err->log("mail","enum_domains_mail");
$db->query("select * from address where domain_id=$dom_id order by address asc;");
if (!$db->num_rows()) {
//TODO verifier numero erreur
$err->raise("mysql",19);
return false;
}
while($db->next_record()){
$this->enum_domain_mails[]=$db->Record;
}
return $this->enum_domain_mails;
}
@ -379,7 +385,6 @@ class m_mail {
} /* Class m_mail */