i tried to make a enhancement for this "little" problem but as a result of my non existing knowledge of "writing SQL-Statements in ispCP style" i had to write the SQL as i know it.
at the moment the "enhancement" can only read the quota but i will change it that it will write the new quota.
It works only with dovecot >= 1.1.0 not with the 1.0.RC5
At the moment i write the HowTo. I will add it as soon as possible.
[EDIT PART 1 - Show Mailbox Quota in GUI]
open /var/www/ispcp/gui/reseller/domain_edit.php:
after:
Code:
require '../include/ispcp-lib.php';
add:
Code:
include '../include/ispcp-mailquota.php
around line 69 after:
Code:
'TR_DISK' => tr('Disk limit [MB] <br /><i>(0 unlimited)</i>'),
add:
Code:
'TR_MAIL_QUOTA' => tr('Mailbox Quota [MB]'),
Change Line 229 form:
to
Code:
GLOBAL $username, $mailquota;
around Line 282 after:
Code:
'VL_DOM_DISK' => $disk,
add:
Code:
'VL_MAIL_QUOTA' => $mailquota,
now we have to edit /var/www/ispcp/gui/themes/omega_original/reseller/domain_edit.tpl
after:
Code:
<tr>
<td width="25"> </td>
<td class="content2" width="193">{TR_MAIL_ACCOUNT}</td>
<td class="content"><input type="text" name="dom_mail_acCount" value="{VL_DOM_MAIL_ACCOUNT}" style="width:100px" class="textinput">
</td>
</tr>
add:
Code:
<tr>
<td width="25"> </td>
<td class="content2" width="193">{TR_MAIL_QUOTA}</td>
<td class="content"><input type="text" name="mailboxquota" value="{VL_MAIL_QUOTA}" style="width:100px" class="textinput"></td>
</td>
</tr>
last create a new file: /var/www/ispcp/gui/includes/ispcp-mailquota.php
insert :
Code:
<?php
/**
* ispCP ω (OMEGA) a Virtual Hosting Control System
*
* @copyright 2001-2006 by moleSoftware GmbH
* @copyright 2006-2008 by ispCP | http://isp-control.net
* @version SVN: $ID$
* @link http://isp-control.net
* @author ispCP Team
*
* @license
* This program is free software; you can redistribute it and/or modify it under
* the terms of the MPL General Public License as published by the Free Software
* Foundation; either version 1.1 of the License, or (at your option) any later
* version.
* You should have received a copy of the MPL Mozilla Public License along with
* this program; if not, write to the Open Source Initiative (OSI)
* http://opensource.org | osi@opensource.org
*/
/** Connect to Database */
$dbUser="root"; // Database Username
$dbPass=""; // Database Password
$dbHost="localhost"; // Database Server
$dbName="ispcp"; // Database
$connect = @mysql_connect($dbHost, $dbUser, $dbPass) or die("Could not connect to Database-Server!");
$selectDB = @mysql_select_db($dbName, $connect) or die("Could not select <b>$dbName</b>!");
/** Read Mailbox Quota */
if(isset($_GET['edit_id']))
{
$id=$_GET['edit_id'];
$sql="SELECT `quota` FROM `mail_users` WHERE `domain_id` = '".$id."' LIMIT 1;";
$handle = mysql_query($sql);
$result=mysql_fetch_object($handle);
$mailquota = $result->quota/1024/1024;
mysql_close();
}
?>
Maybe someone could change it that we can remove the "connect to database" part.
[/EDIT]
Sorry for my poor english, i am a native german.