diff --git a/.gitattributes b/.gitattributes index ddf88b47..9514b22c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -253,6 +253,7 @@ bureau/admin/mail_del.php -text bureau/admin/mail_doadd.php -text bureau/admin/mail_doedit.php -text bureau/admin/mail_edit.inc.php -text +bureau/admin/mail_edit.php -text bureau/admin/mail_list.php -text bureau/admin/mail_localbox_doedit.php -text bureau/admin/mail_localbox_edit.inc.php -text diff --git a/bureau/admin/mail_del.php b/bureau/admin/mail_del.php index 6f9ceb35..d67caffe 100644 --- a/bureau/admin/mail_del.php +++ b/bureau/admin/mail_del.php @@ -45,20 +45,12 @@ if ($confirm=="y") { while (list($key,$val)=each($d)) { $mail->delete($val); $error.=$err->errstr()."
"; - /* - $error.=$err->errstr()."
"; //sprintf(_("The email address %s does not exist!")."
",$val); - } else { - $error.=sprintf(_("The email address %s has been deleted!")."
",$val); - } - */ } include("mail_list.php"); exit(); } ?> - -

:



@@ -88,5 +80,3 @@ while (list($key,$val)=each($d)) { - - diff --git a/bureau/admin/mail_doadd.php b/bureau/admin/mail_doadd.php index d1c6103a..3c9e918a 100644 --- a/bureau/admin/mail_doadd.php +++ b/bureau/admin/mail_doadd.php @@ -26,20 +26,14 @@ require_once("../class/config.php"); $fields = array ( "mail_arg" => array ("request", "string", ""), "domain_id" => array ("request", "integer", ""), - "domain" => array ("request", "string", ""), ); getFields($fields); - -$res= array(); -//FIXME seems good but maybe can be done in a more fashion way. -$res=$mail->create($domain_id,$mail_arg,$domain); - -//once the mail created redirection to mail_properties.php, with the mail_id as parameters ( + domain_id ) -if($res["mail_id"]== null){ - header ("Location: /mail_list.php?domain=$domain&domain_id=$domain_id"); -}else{ - $test= 'mail_properties.php?mail_id='.$res["mail_id"]."&domain_id=$domain_id"; - header("Location: /$test"); +if (!($res=$mail->create($domain_id,$mail_arg))) { + $error=$err->errstr(); + include("mail_list.php"); +} else { + $_REQUEST["mail_id"]=$res; + include("mail_edit.php"); } ?> diff --git a/bureau/admin/mail_edit.php b/bureau/admin/mail_edit.php new file mode 100644 index 00000000..732a8f2f --- /dev/null +++ b/bureau/admin/mail_edit.php @@ -0,0 +1,115 @@ + array ("request", "integer", ""), +); +getFields($fields); + +if (!$res=$mail->get_details($mail_id)) { + $error=$err->errstr(); + include("main.php"); + exit(); +} else { +foreach($res as $key=>$val) $$key=$val; + +?> +

+
+
+ +
+ + + + + + + + + + + +invoke("mail_edit_html",array($mail_id,$type)); +foreach($html as $h) echo $h; + +?> + +

+

 

+ +

+ +
+

+ onclick="popoff()" /> + onclick="popon();" /> +

+
+ + + + +
+
+
()
+ " /> + " onclick="window.history.go(-1);"/> +
+
+ + + + diff --git a/bureau/admin/mail_list.php b/bureau/admin/mail_list.php index e37bfb73..6fea56e2 100644 --- a/bureau/admin/mail_list.php +++ b/bureau/admin/mail_list.php @@ -131,7 +131,7 @@ while (list($key,$val)=each($mails_list)){ - + 60chars, use "..." + js close/open */ ?> next_record(); $this->total=$db->f("total"); - $db->query("SELECT a.id, a.address, a.password, a.`enabled`, a.mail_action, d.domaine AS domain, m.quota*1024*1024 AS quota, m.bytes AS used, NOT ISNULL(m.id) AS islocal, a.type, r.recipients, m.lastlogin + $db->query("SELECT a.id, a.address, a.password, a.`enabled`, a.mail_action, d.domaine AS domain, m.quota, m.quota*1024*1024 AS quotabytes, m.bytes AS used, NOT ISNULL(m.id) AS islocal, a.type, r.recipients, m.lastlogin FROM (address a LEFT JOIN mailbox m ON m.address_id=a.id) LEFT JOIN recipient r ON r.address_id=a.id, domaines d WHERE $where AND d.id=a.domain_id LIMIT $offset,$count;"); @@ -209,8 +213,8 @@ class m_mail { $mail_id=intval($mail_id); // We fetch all the informations for that email: these will fill the hastable : - $db->query("SELECT a.address, a.password, a.`enabled`, d.domaine AS domain, m.quota, m.bytes/1024/1024 AS used, NOT ISNULL(m.id) AS islocal, a.type - FROM address a LEFT JOIN mailbox m ON m.address_id=a.id, domaines d WHERE a.id=$mail_id AND d.id=a.domain_id;"); + $db->query("SELECT a.address, a.password, a.`enabled`, d.domaine AS domain, m.quota, m.quota*1024*1024 AS quotabytes, m.bytes AS used, NOT ISNULL(m.id) AS islocal, a.type, r.recipients, m.lastlogin + FROM (address a LEFT JOIN mailbox m ON m.address_id=a.id) LEFT JOIN recipient r ON r.address_id=a.id, domaines d WHERE a.id=$mail_id AND d.id=a.domain_id;"); if (! $db->next_record()) return false; $details=$db->Record; // if necessary, fill the typedata with data from hooks ...