Current time: 11-29-2024, 08:34 PM Hello There, Guest! (LoginRegister)


Post Reply 
Roundcube quota error
Author Message
FISA4 Offline
Member
***

Posts: 668
Joined: Feb 2008
Reputation: 15
Post: #20
RE: Roundcube quota error
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. Wink

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:
Code:
GLOBAL $username;

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">&nbsp;</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">&nbsp;</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. Wink
(This post was last modified: 03-13-2009 08:55 AM by FISA4.)
03-13-2009 08:31 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Roundcube quota error - saracibar - 02-28-2009, 05:35 PM
RE: Roundcube quota error - saracibar - 03-07-2009, 03:34 AM
RE: Roundcube quota error - rbtux - 03-07-2009, 03:41 AM
RE: Roundcube quota error - BeNe - 03-07-2009, 07:36 AM
RE: Roundcube quota error - rbtux - 03-07-2009, 08:08 AM
RE: Roundcube quota error - BeNe - 03-07-2009, 08:55 AM
RE: Roundcube quota error - rbtux - 03-07-2009, 09:15 AM
RE: Roundcube quota error - BeNe - 03-07-2009, 09:22 AM
RE: Roundcube quota error - BeNe - 03-07-2009, 10:22 AM
RE: Roundcube quota error - rbtux - 03-07-2009, 10:52 AM
RE: Roundcube quota error - BeNe - 03-07-2009, 11:10 AM
RE: Roundcube quota error - rbtux - 03-07-2009, 11:19 AM
RE: Roundcube quota error - BeNe - 03-07-2009, 10:11 PM
RE: Roundcube quota error - rbtux - 03-07-2009, 10:29 PM
RE: Roundcube quota error - BeNe - 03-07-2009, 11:06 PM
RE: Roundcube quota error - TheCry - 03-12-2009, 03:19 AM
RE: Roundcube quota error - BeNe - 03-12-2009, 03:54 AM
RE: Roundcube quota error - TheCry - 03-12-2009, 04:12 AM
RE: Roundcube quota error - BeNe - 03-12-2009, 05:06 PM
RE: Roundcube quota error - FISA4 - 03-13-2009 08:31 AM
RE: Roundcube quota error - rbtux - 03-13-2009, 09:24 AM
RE: Roundcube quota error - FISA4 - 03-13-2009, 09:32 AM
RE: Roundcube quota error - BeNe - 03-13-2009, 04:45 PM
RE: Roundcube quota error - FISA4 - 03-13-2009, 11:13 PM
RE: Roundcube quota error - alecksievici - 03-14-2009, 04:43 PM
RE: Roundcube quota error - fhawk - 03-14-2009, 07:42 PM
RE: Roundcube quota error - BeNe - 03-15-2009, 01:37 AM

Forum Jump:


User(s) browsing this thread: 11 Guest(s)