Changeset c55337c in github


Ignore:
Timestamp:
Nov 30, 2009 7:06:12 AM (4 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
e2927b0
Parents:
6c95809d
Message:
  • write error to log if connection to managesieve server cannot be established
File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/managesieve/managesieve.php

    rac67db1 rc55337c  
    6262    require_once($this->home . '/lib/rcube_sieve.php'); 
    6363 
     64    $host = str_replace('%h', $_SESSION['imap_host'], $this->rc->config->get('managesieve_host', 'localhost')); 
     65    $port = $this->rc->config->get('managesieve_port', 2000); 
     66 
    6467    // try to connect to managesieve server and to fetch the script 
    6568    $this->sieve = new rcube_sieve($_SESSION['username'], 
    6669        $this->rc->decrypt($_SESSION['password']),  
    67         str_replace('%h', $_SESSION['imap_host'], $this->rc->config->get('managesieve_host', 'localhost')), 
    68         $this->rc->config->get('managesieve_port', 2000), 
     70        $host, $port, 
    6971        $this->rc->config->get('managesieve_usetls', false), 
    7072        $this->rc->config->get('managesieve_disabled_extensions'), 
     
    121123        break; 
    122124      } 
     125 
     126      raise_error(array('code' => 403, 'type' => 'php', 'message' => "Unable to connect to managesieve on $host:$port"), true, false); 
     127 
    123128      // to disable 'Add filter' button set env variable 
    124129      $this->rc->output->set_env('filterconnerror', true); 
     
    548553    $select = new html_select(array('name' => '_set', 'id' => $attrib['id'], 'onchange' => 'rcmail.managesieve_set()')); 
    549554 
    550     asort($list, SORT_LOCALE_STRING); 
    551  
    552     foreach($list as $set) 
    553       $select->add($set . ($set == $active ? ' ('.$this->gettext('active').')' : ''), $set); 
     555    if ($list) { 
     556      asort($list, SORT_LOCALE_STRING); 
     557 
     558      foreach($list as $set) 
     559        $select->add($set . ($set == $active ? ' ('.$this->gettext('active').')' : ''), $set); 
     560    } 
    554561     
    555562    $out = $select->show($this->sieve->current); 
Note: See TracChangeset for help on using the changeset viewer.