I hammered this out today, just as a test. Need to refine and rewrite....
** Fixed error caused by quota output containing varying number of spaces as quota changes
** added comments for clarity
This is version 0.3.2
Basically, I am highjacking what is already there, pulling the username from roundcube, doing a quota query using the shell and returning the results back to roundcube.
1. Open 'program/steps/mail/func.inc
2. replace rcmail_quota_content function with the following:
#get user name from roundcube
$temp = $RCMAIL->user->get_username();
$tempboom = explode ('@', $temp);
#run quota on user name
$output= shell_exec("/usr/bin/quota " . $qusern);
# remove consecutive spaces
$output = ereg_replace("[ \t\n\r]+", " ", $output);
$parts = explode(" ",$output);
$out = 35 - round(($parts * 1024)/1048576);
$quota_result = $out . "MB";
Note: I set all my user quotas to 35M, change this to reflect your needs or remove to show usage.
3. Open /skins/default/templates/main.html
4. look for <div id="listcontrols"> (should be around line 74)
change the last span to:
<span style="margin-left: 20px; margin-right: 5px">Storage Space Remaining:</span>
<roundcube:object name="quotaDisplay" id="quotadisplay" />
5. This needs to be cleaned up to be an actual option, maybe add a database query to get the actual user quota from either the database or from the results of the quota query.
6. Double check for typos, etc. if you need any help, send me a message.
NOTE: this is mainly a proof of concept, a starting point. I am using this on a production machine, but it has very low volume of users.
Anyone that can help continue, please please do.