[imp] RES: [horde] Quota e

Luiz Alfredo Baggiotto luiz at pucrs.br
Fri Jul 1 05:33:29 PDT 2005


Hello Jan

Thank´s a lot for your help. :-)
I made the change in the line "74" of imp/lib/Quota/command.php file, following your suggestion below, but the problem persists. I think the output of quota command is Ok (at least, when I run it in the console, the results are showed in the monitor), but by any reason PHP can´t get it.
To test the $junk variable, I was changed the following line too:

73:    if (($return_code == 0) && (count($quota_data) == 1)) {

to

73:    if ($junk == 0) {

Then, I logged in the browser and the code subsequent has been executed (is it that because the variable is empty, true?), showing the error

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

Can you see any other alternative?

Thanks again for your patience.

Regards

> -----Mensagem original-----
> De: horde-bounces at lists.horde.org 
> [mailto:horde-bounces at lists.horde.org] Em nome de Jan Schneider
> Enviada em: sexta-feira, 1 de julho de 2005 05:27
> Para: horde at lists.horde.org
> Cc: imp at lists.horde.org
> Assunto: Re: [horde] Quota e
> 
> 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/
> 
> --
> Horde mailing list - Join the hunt: 
> http://horde.org/bounties/#horde Frequently Asked Questions: 
> http://horde.org/faq/ To unsubscribe, mail: 
> horde-unsubscribe at lists.horde.org
> 


More information about the imp mailing list