Here is a hack that displays quota on a server not supporting quota, like dovecot or any mail server without using the built in quota feature(If you find this simpler).
Edit your /etc/sudoer, add the following lines. Replace apache with whatever your httpd/apache user is. RHEL/Fedora user is apache.
apache ALL = NOPASSWD: /usr/bin/du
apache ALL = NOPASSWD: /bin/ls
create a folder 'quota' on your server '/' partition
mkdir /quota
to assign quota to any user
echo "10000" > /quota/username
This would give 10MB quota to a user. Give whatever you wish to assign.
Create the following file
/var/www/html/horde/quota.php
1) {
echo '';
echo 'Login: ' . $user . ' ';
echo '';
echo "Quota Used $usedmb MB of $quotamb MB ($percent %)";
echo '
';
}
if ($percent >= 100 && $quota > 2) {
echo '<script language="JavaScript" type="text/javascript">
</script>';}
if ($percent >= 80 && $quota > 2) {
echo '<script language="JavaScript" type="text/javascript">
</script>';}
}
Change the above reflecting your mailserver's folder locations. Above is for dovecot on RHEL 3, with mails in /home/username/mail and /var/spool/mail/username.
Add this in horde/imp/templates/common-headers.inc (line 27, 28,29)
$page_title = $GLOBALS['registry']->get('name');
if (!empty($title)) $page_title .= ' :: ' . $title;
if (!empty($refresh_time) && !empty($refresh_url)) {
echo "n";
}
Horde::includeScriptFiles();
?>
<title></title>
//--->Add the following here <----
//---end---
Do let me know if this was useful or send in any improvements/suggestions.
jigish dot gohil at gmail dot com