[horde] Quota e

Jan Schneider jan at horde.org
Fri Jul 1 01:26:35 PDT 2005


Let's continue the discussion on the imp list.

Zitat von Luiz Alfredo Baggiotto <luiz at pucrs.br>:

> I was edited the file imp/lib/Quota/command.php and changed the line 
> 70 of the file:
>
> 70:   $cmdline = $this->_params['quota_path'] . " -u $imap_user | " .
> 71:              $this->_params['grep_path'] . " $homedir[1]";
> 72:   $junk = exec($cmdline, $quota_data, $return_code);
> 73:   if (($return_code == 0) && (count($quota_data) == 1)) {
> 74:        $quota = split("[[:blank:]]+", trim($quota_data[0]));
> 75:        return array('usage' => $quota[1] * 1024, 'limit' => 
> $quota[2] * 1024);
> 76:   }
> 77:   return PEAR::raiseError(_("Unable to retrieve quota"), 'horde.error');
>
> to
>
> 70:   $cmdline = $this->_params['quota_path'] . " -v $imap_user | " .
>
> It´s because in Solaris the quota command has a different syntax:
>
> # /usr/sbin/quota -v user1 | /usr/bin/grep /home
> /home            22 102400 102400                  0      0      0
>
> When I logged in horde via browser, using the "user1" account, I 
> receive "Unable to retrieve quota". :-(
> I was tested some options, but the result are ever "Unable to 
> retrieve quota". Then I change the following line, to test the 
> behavior of script:
>
> 73: if (($return_code == 0) && (count($quota_data) == 1)) {
>
> to
>
> 73: if ($return_code == 1) {
>
> and then I received the following error in browser:
>
> Notice: Undefined offset: 0 in .../Quota/command.php on line 74
> Notice: Undefined offset: 1 in .../Quota/command.php on line 75
> Notice: Undefined offset: 2 in .../Quota/command.php on line 75

Maybe quota doesn't echo the output to stdout on your system? Because 
that's what goes into $quota_data. Maybe try
$cmdline = $this->_params['quota_path'] . " -u $imap_user | " .
           $this->_params['grep_path'] . " $homedir[1] 2>&1";

$junk should also contain the last line of the output.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the horde mailing list