Changeset 163

Show
Ignore:
Timestamp:
07/01/07 12:00:48 (2 years ago)
Author:
shupp
Message:

add space between control structure keyword and opening parentheses for PEAR CS compliance

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Framework/Auth/Vpopmail.php

    r154 r163  
    3333        $timeLimit = (int)Framework::$site->config->inactiveTimeout; 
    3434        $this->user->recordio("timeout info: time: $time, lastActionTime: $lastActionTime, timeLimit: $timeLimit"); 
    35         if(($time - $lastActionTime) > $timeLimit) { 
     35        if (($time - $lastActionTime) > $timeLimit) { 
    3636            header('Location: ./?module=Login&event=logoutInactive'); 
    3737            return false; 
     
    4141        $encryptedPass = $this->session->__get('password'); 
    4242        $plainPass =  Framework_User_passEncryption::decryptPass($encryptedPass, (string)Framework::$site->config->mcryptKey); 
    43         if(!PEAR::isError($this->user->authenticate($this->session->__get('email'), $plainPass))) { 
     43        if (!PEAR::isError($this->user->authenticate($this->session->__get('email'), $plainPass))) { 
    4444            $this->session->__set('lastActionTime', $time); 
    4545            $this->setData('logged_in_as', $this->session->__get('email')); 
  • trunk/Framework/Module/Accounts.php

    r159 r163  
    4141        parent::__construct(); 
    4242        // Make sure doamin was supplied 
    43         if(!isset($_REQUEST['domain'])) 
     43        if (!isset($_REQUEST['domain'])) 
    4444            throw new Framework_Exception(_("Error: no domain supplied")); 
    4545        $this->domain = $_REQUEST['domain']; 
     
    5656    protected function checkPrivileges() { 
    5757        // Verify that they have access to this domain 
    58         if(!$this->user->isDomainAdmin($this->domain)) { 
     58        if (!$this->user->isDomainAdmin($this->domain)) { 
    5959            return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $this->domain); 
    6060        } 
     
    7575 
    7676        $privs = $this->checkPrivileges(); 
    77         if(PEAR::isError($privs)) return privs; 
     77        if (PEAR::isError($privs)) return privs; 
    7878 
    7979        // Pagintation setup 
    8080        $total = $this->user->userCount($this->domain); 
    81         if(PEAR::isError($total)) return $total; 
     81        if (PEAR::isError($total)) return $total; 
    8282        $this->paginate($total); 
    8383 
     
    8686        $accounts = array(); 
    8787        $count = 0; 
    88         while(list($key,$val) = each($account_array)) { 
     88        while (list($key,$val) = each($account_array)) { 
    8989            $accounts[$count]['account'] = $key; 
    9090            $accounts[$count]['comment'] = $val['comment']; 
     
    124124 
    125125        $privs = $this->checkPrivileges(); 
    126         if(PEAR::isError($privs)) return privs; 
     126        if (PEAR::isError($privs)) return privs; 
    127127 
    128128        $form = $this->addAccountForm(); 
     
    137137    static function sameDomain ($name, $value) { 
    138138        $emailArray = explode('@', $value); 
    139         if($emailArray[1] == $this->domain) { 
     139        if ($emailArray[1] == $this->domain) { 
    140140            return true; 
    141141        } else { 
     
    147147 
    148148        $privs = $this->checkPrivileges(); 
    149         if(PEAR::isError($privs)) return privs; 
     149        if (PEAR::isError($privs)) return privs; 
    150150 
    151151        $form = $this->addAccountForm(); 
    152         if(!$form->validate()) { 
     152        if (!$form->validate()) { 
    153153            $renderer =& new HTML_QuickForm_Renderer_Array(); 
    154154            $form->accept($renderer); 
     
    161161        $emailArray = explode('@', $_REQUEST['account']); 
    162162        $result = $this->user->addUser($this->domain, $emailArray[0], $_REQUEST['password'], $_REQUEST['comment']); 
    163         if(PEAR::isError($result)) { 
     163        if (PEAR::isError($result)) { 
    164164            $this->setData('message', _("Error: ") . $result->getMessage()); 
    165165            $renderer =& new HTML_QuickForm_Renderer_Array(); 
     
    202202 
    203203        $privs = $this->checkPrivileges(); 
    204         if(PEAR::isError($privs)) return privs; 
    205  
    206         if(!isset($_REQUEST['account'])) { 
     204        if (PEAR::isError($privs)) return privs; 
     205 
     206        if (!isset($_REQUEST['account'])) { 
    207207            return PEAR::raiseError(_("Error: no account supplied")); 
    208208        } 
     
    221221 
    222222        $privs = $this->checkPrivileges(); 
    223         if(PEAR::isError($privs)) return privs; 
    224  
    225         if(!isset($_REQUEST['account'])) { 
     223        if (PEAR::isError($privs)) return privs; 
     224 
     225        if (!isset($_REQUEST['account'])) { 
    226226            return PEAR::raiseError(_("Error: no account supplied")); 
    227227        } 
    228228 
    229         if(!isset($_REQUEST['domain'])) { 
     229        if (!isset($_REQUEST['domain'])) { 
    230230            return PEAR::raiseError(_("Error: no domain supplied")); 
    231231        } 
    232232 
    233233        $result = $this->user->delUser($this->domain, $_REQUEST['account']); 
    234         if(PEAR::isError($result)) { 
     234        if (PEAR::isError($result)) { 
    235235            return $result; 
    236236        } 
     
    244244 
    245245        $privs = $this->checkPrivileges(); 
    246         if(PEAR::isError($privs)) return privs; 
     246        if (PEAR::isError($privs)) return privs; 
    247247 
    248248        $this->setData('message', _("Delete Canceled")); 
     
    254254 
    255255        // Make sure account was supplied 
    256         if(!isset($_REQUEST['account'])) { 
     256        if (!isset($_REQUEST['account'])) { 
    257257            return PEAR::raiseError(_("Error: no account supplied")); 
    258258        } 
     
    260260 
    261261        // Check privs 
    262         if(!$this->user->isUserAdmin($account, $this->domain)) { 
     262        if (!$this->user->isUserAdmin($account, $this->domain)) { 
    263263            return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $this->domain); 
    264264        } 
    265265 
    266266        // See what user_info to use 
    267         if($this->user->isDomainAdmin($this->domain)) { 
     267        if ($this->user->isDomainAdmin($this->domain)) { 
    268268            $account_info = $this->user->userInfo($this->domain, $_REQUEST['account']); 
    269             if(PEAR::isError($account_info)) return $account_info; 
     269            if (PEAR::isError($account_info)) return $account_info; 
    270270        } else { 
    271271            $account_info = $this->user->loginUser; 
     
    274274        // Get .qmail info if it exists 
    275275        $dot_qmail = $this->user->readFile($this->domain, $_REQUEST['account'], '.qmail'); 
    276         if(PEAR::isError($dot_qmail) && $dot_qmail->getMessage() != '-ERR 2102 No such file or directory') { 
     276        if (PEAR::isError($dot_qmail) && $dot_qmail->getMessage() != '-ERR 2102 No such file or directory') { 
    277277            return $dot_qmail; 
    278278        } 
     
    294294        $this->setData('LANG_Modify_Account', _("Modify Account")); 
    295295        $this->setData('LANG_Domain_Menu', _("Domain Menu")); 
    296         if($this->user->isDomainAdmin($this->domain)) { 
     296        if ($this->user->isDomainAdmin($this->domain)) { 
    297297            $this->setData('isDomainAdmin', 1); 
    298298            $this->setData('LANG_Main_Menu', _("Main Menu")); 
     
    329329 
    330330        // Make sure account was supplied 
    331         if(!isset($_REQUEST['account'])) { 
     331        if (!isset($_REQUEST['account'])) { 
    332332            return PEAR::raiseError(_("Error: no account supplied")); 
    333333        } 
     
    335335 
    336336        // Check privs 
    337         if(!$this->user->isUserAdmin($account, $this->domain)) { 
     337        if (!$this->user->isUserAdmin($account, $this->domain)) { 
    338338            return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $this->domain); 
    339339        } 
     
    341341        // See what user_info to use 
    342342        $account_info = $this->user->userInfo($this->domain, $_REQUEST['account']); 
    343         if(PEAR::isError($account_info)) { 
     343        if (PEAR::isError($account_info)) { 
    344344            return $account_info; 
    345345        } 
     
    352352        $defaults = $this->user->parseHomeDotqmail($dot_qmail, $account_info); 
    353353        $form = $this->modifyAccountForm($account, $defaults); 
    354         if(!$form->validate()) { 
     354        if (!$form->validate()) { 
    355355            $this->setData('message', _("Error Modifying Account")); 
    356356            $renderer =& new HTML_QuickForm_Renderer_Array(); 
     
    364364        $routing = ''; 
    365365        $save_a_copy = 0; 
    366         if($_REQUEST['routing'] == 'routing_standard') { 
     366        if ($_REQUEST['routing'] == 'routing_standard') { 
    367367            $routing = 'standard'; 
    368         } else if($_REQUEST['routing'] == 'routing_deleted') { 
     368        } else if ($_REQUEST['routing'] == 'routing_deleted') { 
    369369            $routing = 'deleted'; 
    370         } else if($_REQUEST['routing'] == 'routing_forwarded') { 
    371             if(empty($_REQUEST['forward'])) { 
     370        } else if ($_REQUEST['routing'] == 'routing_forwarded') { 
     371            if (empty($_REQUEST['forward'])) { 
    372372                $this->setData('message', _('Error: you must supply a forward address')); 
    373373                return $this->modifyAccount(); 
     
    376376            } 
    377377            $routing = 'forwarded'; 
    378             if(isset($_REQUEST['save_a_copy'])) $save_a_copy = 1; 
     378            if (isset($_REQUEST['save_a_copy'])) $save_a_copy = 1; 
    379379        } else { 
    380380                $this->setData('message', _('Error: unsupported routing selection')); 
     
    384384        // Check for vacation 
    385385        $vacation = 0; 
    386         if(isset($_REQUEST['vacation'])) { 
     386        if (isset($_REQUEST['vacation'])) { 
    387387            $vacation = 1; 
    388388            $vacation_subject = $_REQUEST['vacation_subject']; 
     
    392392        // Build .qmail contents 
    393393        $dot_qmail_contents = ''; 
    394         if($routing == 'deleted') { 
     394        if ($routing == 'deleted') { 
    395395            $dot_qmail_contents = "# delete"; 
    396         } else if($routing == 'forwarded') { 
     396        } else if ($routing == 'forwarded') { 
    397397            $dot_qmail_contents = "&$forward"; 
    398             if($save_a_copy = 1) $dot_qmail_contents .= "\n./Maildir/"; 
    399         } 
    400  
    401         if($vacation == 1) { 
    402             if(strlen($dot_qmail_contents) > 0) $dot_qmail_contents .= "\n"; 
     398            if ($save_a_copy = 1) $dot_qmail_contents .= "\n./Maildir/"; 
     399        } 
     400 
     401        if ($vacation == 1) { 
     402            if (strlen($dot_qmail_contents) > 0) $dot_qmail_contents .= "\n"; 
    403403            $vacation_dir = $account_info['user_dir'] . '/vacation'; 
    404404            $dot_qmail_contents .= '| ' . VPOPMAIL_ROBOT_PROGRAM; 
     
    409409 
    410410        $dot_qmail_file = '.qmail'; 
    411         if(strlen($dot_qmail_contents) > 0) { 
     411        if (strlen($dot_qmail_contents) > 0) { 
    412412            $contents = explode("\n", $dot_qmail_contents); 
    413413            // Delete existing file 
     
    417417 
    418418            // Add vacation files 
    419             if($vacation == 1) { 
     419            if ($vacation == 1) { 
    420420                $vcontents = "From: " . $account_info['name'] . "@{$this->domain}\n"; 
    421421                $vcontents .= "Subject: $vacation_subject\n\n"; 
  • trunk/Framework/Module/Domains.php

    r162 r163  
    4747    public function accessDirector() 
    4848    { 
    49         if(!$this->user->isSysAdmin()) { 
     49        if (!$this->user->isSysAdmin()) { 
    5050            $domain = $this->session->__get('domain'); 
    5151            // Redirect to appropriate page 
    52             if($this->user->isDomainAdmin($domain)) { 
     52            if ($this->user->isDomainAdmin($domain)) { 
    5353                header("Location: ./?module=Domains&event=domainMenu&domain=" . urlencode($domain)); 
    5454                return; 
     
    7272        // Pagination setup 
    7373        $total = $this->user->domainCount(); 
    74         if(PEAR::isError($total)) return PEAR::raiseError($total); 
     74        if (PEAR::isError($total)) return PEAR::raiseError($total); 
    7575        $this->paginate($total); 
    7676 
     
    7979        $domains = array(); 
    8080        $count = 0; 
    81         while(list($key,$val) = each($domain_array)) { 
     81        while (list($key,$val) = each($domain_array)) { 
    8282            $domains[$count]['name'] = $key; 
    8383            $domains[$count]['edit_url'] = htmlspecialchars('./?module=Domains&event=domainMenu&domain=' . $key); 
     
    104104    { 
    105105        // Make sure the domain was supplied 
    106         if($domain == null) { 
    107             if(empty($_REQUEST['domain'])) 
     106        if ($domain == null) { 
     107            if (empty($_REQUEST['domain'])) 
    108108                return PEAR::raiseError(_("Error: no domain supplied")); 
    109109            $domain = $_REQUEST['domain']; 
    110110        } 
    111111 
    112         if(!$this->user->isDomainAdmin($domain)) { 
     112        if (!$this->user->isDomainAdmin($domain)) { 
    113113            return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $domain); 
    114114        } 
    115115 
    116         if($this->user->isSysAdmin()) $this->setData('isSysAdmin', 1); 
     116        if ($this->user->isSysAdmin()) $this->setData('isSysAdmin', 1); 
    117117        // Setup URLs 
    118118        $this->setData('domain', $domain); 
     
    135135    function addDomain() 
    136136    { 
    137         if(!$this->user->isSysAdmin()) { 
     137        if (!$this->user->isSysAdmin()) { 
    138138            return PEAR::raiseError(_('Error: you do not have add domain privileges')); 
    139139        } 
     
    149149    function addDomainNow() 
    150150    { 
    151         if(!$this->user->isSysAdmin()) { 
     151        if (!$this->user->isSysAdmin()) { 
    152152            return PEAR::raiseError(_('Error: you do not have add domain privileges')); 
    153153        } 
    154154 
    155155        $form = $this->addDomainForm(); 
    156         if(!$form->validate()) { 
     156        if (!$form->validate()) { 
    157157            $this->addDomain(); 
    158158            return; 
     
    161161        // Add domain 
    162162        $result = $this->user->AddDomain($_REQUEST['domain'], $_REQUEST['password']); 
    163         if(PEAR::isError($result)) { 
     163        if (PEAR::isError($result)) { 
    164164            $this->setData('message', _("Error: ") . $result->getMessage()); 
    165165            return $this->addDomain(); 
     
    187187    { 
    188188        // Make sure the domain was supplied 
    189         if($domain == null) { 
    190             if(empty($_REQUEST['domain'])) 
     189        if ($domain == null) { 
     190            if (empty($_REQUEST['domain'])) 
    191191                return PEAR::raiseError(_("Error: no domain supplied")); 
    192192            $domain = $_REQUEST['domain']; 
    193193        } 
    194194 
    195         if(!$this->user->isDomainAdmin($domain)) { 
     195        if (!$this->user->isDomainAdmin($domain)) { 
    196196            return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $domain); 
    197197        } 
     
    211211    { 
    212212        // Make sure the domain was supplied 
    213         if($domain == null) { 
    214             if(empty($_REQUEST['domain'])) 
     213        if ($domain == null) { 
     214            if (empty($_REQUEST['domain'])) 
    215215                return PEAR::raiseError(_("Error: no domain supplied")); 
    216216            $domain = $_REQUEST['domain']; 
    217217        } 
    218218 
    219         if(!$this->user->isDomainAdmin($domain)) { 
     219        if (!$this->user->isDomainAdmin($domain)) { 
    220220            return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $domain); 
    221221        } 
     
    223223        // Delete domain 
    224224        $result = $this->user->delDomain($domain); 
    225         if(PEAR::isError($result)) { 
     225        if (PEAR::isError($result)) { 
    226226            $this->setData('message', _("Error: ") . $result->getMessage()); 
    227227            return $this->listDomains(); 
  • trunk/Framework/Module/Forwards.php

    r154 r163  
    4141        parent::__construct(); 
    4242        // Make sure doamin was supplied 
    43         if(!isset($_REQUEST['domain']))  
     43        if (!isset($_REQUEST['domain']))  
    4444            throw new Framework_Exception(_("Error: no domain supplied")); 
    4545        $this->domain = $_REQUEST['domain']; 
     
    6161    protected function checkPrivileges() { 
    6262        // Verify that they have access to this domain 
    63         if(!$this->user->isDomainAdmin($this->domain)) { 
     63        if (!$this->user->isDomainAdmin($this->domain)) { 
    6464            return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $this->domain); 
    6565        } 
     
    7272        // Pagintation setup 
    7373        $full_alias_array = $this->user->ListAlias($this->domain); 
    74         if($this->user->Error) return PEAR::raiseError(_("Error: ") . $this->user->Error); 
     74        if ($this->user->Error) return PEAR::raiseError(_("Error: ") . $this->user->Error); 
    7575        // Format the valias outpt from vpopmaild 
    7676        $aliasesParsed = $this->user->parseAliases($full_alias_array, 'forwards'); 
     
    7979        $this->setData('total', $total); 
    8080        $this->setData('limit', (integer)Framework::$site->config->maxPerPage); 
    81         if(isset($_REQUEST['start']) && !ereg('[^0-9]', $_REQUEST['start'])) { 
    82             if($_REQUEST['start'] == 0) { 
     81        if (isset($_REQUEST['start']) && !ereg('[^0-9]', $_REQUEST['start'])) { 
     82            if ($_REQUEST['start'] == 0) { 
    8383                $start = 1; 
    8484            } else { 
     
    8686            } 
    8787        } 
    88         if(!isset($start)) $start = 1; 
     88        if (!isset($start)) $start = 1; 
    8989        $this->setData('start', $start); 
    9090        $this->setData('currentPage', ceil($this->data['start'] / $this->data['limit'])); 
     
    9393        // List Accounts 
    9494        $alias_array = $this->user->listAliases($aliasesParsed, $this->data['currentPage'], $this->data['limit']); 
    95         if($this->user->Error) return PEAR::raiseError(_("Error: ") . $this->user->Error); 
    96      
    97         if(count($alias_array) == 0) { 
     95        if ($this->user->Error) return PEAR::raiseError(_("Error: ") . $this->user->Error); 
     96     
     97        if (count($alias_array) == 0) { 
    9898            $this->setData('message', _("No Forwards.  Care to add one?")); 
    9999            return $this->addForward(); 
     
    102102        $aliases = array(); 
    103103        $count = 0; 
    104         while(list($key,$val) = each($alias_array)) { 
     104        while (list($key,$val) = each($alias_array)) { 
    105105            $forwardName = ereg_replace('@.*$', '', $key); 
    106106            $aliases[$count]['name'] = $forwardName; 
     
    132132    function addForward() { 
    133133        $result = $this->checkPrivileges(); 
    134         if(PEAR::isError($result)) return $result; 
     134        if (PEAR::isError($result)) return $result; 
    135135 
    136136        $form = $this->addForwardForm(); 
     
    168168    function addForwardNow() { 
    169169        $result = $this->checkPrivileges(); 
    170         if(PEAR::isError($result)) return $result; 
     170        if (PEAR::isError($result)) return $result; 
    171171 
    172172        $form = $this->addForwardForm(); 
    173         if(!$form->validate()) { 
     173        if (!$form->validate()) { 
    174174            $renderer =& new HTML_QuickForm_Renderer_Array(); 
    175175            $form->accept($renderer); 
     
    184184 
    185185        $result = $this->addForwardLine(); 
    186         if(PEAR::isError($result)) { 
    187             if($result->getMessage() == 'Forward Exists') { 
     186        if (PEAR::isError($result)) { 
     187            if ($result->getMessage() == 'Forward Exists') { 
    188188                $this->setData('message', _("Forward already exists")); 
    189189                return $this->addForward(); 
     
    198198 
    199199        $contents = $this->user->ReadFile($this->domain, '', ".qmail-" . $this->data['forward']); 
    200         if($type == 'new') { 
    201             if(!$this->user->Error) { 
     200        if ($type == 'new') { 
     201            if (!$this->user->Error) { 
    202202                return PEAR::raiseError("Forward Exists"); 
    203             } else if($this->user->Error != 'command failed - -ERR 2102 No such file or directory') { 
     203            } else if ($this->user->Error != 'command failed - -ERR 2102 No such file or directory') { 
    204204                return PEAR::raiseError(_("Error: ") . $this->user->Error); 
    205205            } 
    206206        } else { 
    207             if($this->user->Error) return PEAR::raiseError(_("Error: ") . $this->user->Error); 
     207            if ($this->user->Error) return PEAR::raiseError(_("Error: ") . $this->user->Error); 
    208208        } 
    209209     
    210210        // Now build a new array without that forward 
    211         if(empty($contents)) $contents = array(); 
    212         if(in_array("&" . $this->data['destination'], $contents)) { 
     211        if (empty($contents)) $contents = array(); 
     212        if (in_array("&" . $this->data['destination'], $contents)) { 
    213213            return PEAR::raiseError('Error: destination already exists'); 
    214214        } 
    215215        array_push($contents, "&" . $this->data['destination']); 
    216216        $this->user->WriteFile($contents, $this->domain, '', ".qmail-" . $this->data['forward']); 
    217         if($this->user->Error) { 
     217        if ($this->user->Error) { 
    218218                return PEAR::raiseError(_("Error: ") . $this->user->Error); 
    219219        } 
     
    223223 
    224224        $contents = $this->user->ReadFile($this->domain, '', ".qmail-" . $this->data['forward']); 
    225         if($this->user->Error) 
     225        if ($this->user->Error) 
    226226                return PEAR::raiseError($this->user->Error, 1); 
    227227     
    228228        // Now build a new array without that forward 
    229         if(!in_array($this->data['line'], $contents)) { 
     229        if (!in_array($this->data['line'], $contents)) { 
    230230            return PEAR::raiseError(_('Error: forward line does not exist'), 2); 
    231231        } 
    232232 
    233         if(count($contents) == 1) { 
     233        if (count($contents) == 1) { 
    234234            // tell caller to delete instead 
    235235            return PEAR::raiseError(_("Only one line, use delete instead"), 3); 
     
    237237        $newContents = array(); 
    238238        $count = 1; 
    239         while(list($key, $val) = each($contents)) { 
    240             if($val == $this->data['line']) continue; 
     239        while (list($key, $val) = each($contents)) { 
     240            if ($val == $this->data['line']) continue; 
    241241            $newContents[$count] = $val; 
    242242            $count++; 
    243243        } 
    244244        $this->user->WriteFile($newContents, $this->domain, '', ".qmail-" . $this->data['forward']); 
    245         if($this->user->Error) { 
     245        if ($this->user->Error) { 
    246246            return PEAR::raiseError(_("Error: ") . $this->user->Error, 4); 
    247247        } 
     
    253253        $this->checkPrivileges(); 
    254254        // Make sure forward was supplied 
    255         if(!isset($_REQUEST['forward'])) { 
     255        if (!isset($_REQUEST['forward'])) { 
    256256            $this->setData('message', _("Error: no forward provided")); 
    257257            return $this->listForwards(); 
     
    262262        // Get forward info if it exists 
    263263        $contents = $this->user->ReadFile($this->domain, '', ".qmail-$forward"); 
    264         if($this->user->Error) return PEAR::raiseError(_("Error: ") . $this->user->Error); 
     264        if ($this->user->Error) return PEAR::raiseError(_("Error: ") . $this->user->Error); 
    265265     
    266266        // Set template data 
     
    279279        $count = 0; 
    280280        $forward_array = array(); 
    281         while(list($key,$val) = each($contents)) { 
     281        while (list($key,$val) = each($contents)) { 
    282282            $forward_array[$count]['destination'] = $this->user->displayForwardLine($val); 
    283283            $forward_array[$count]['delete_url'] = htmlspecialchars("./?module=Forwards&event=deleteForwardLineNow&domain={$this->domain}&forward=" . $_REQUEST['forward'] . "&line=" . urlencode($val)); 
     
    295295        // Get forward info if it exists 
    296296        $contents = $this->user->ReadFile($this->domain, '', ".qmail-$forward"); 
    297         if($this->user->Error) return PEAR::raiseError(_("Error: ") . $this->user->Error); 
     297        if ($this->user->Error) return PEAR::raiseError(_("Error: ") . $this->user->Error); 
    298298 
    299299        $form = $this->modifyForwardForm(); 
    300         if(!$form->validate()) { 
     300        if (!$form->validate()) { 
    301301 
    302302            // Set template data 
     
    313313     
    314314        $result = $this->addForwardLine($type = 'modify'); 
    315         if(PEAR::isError($result)) { 
    316             if($result->getMessage() == 'Error: destination already exists') { 
     315        if (PEAR::isError($result)) { 
     316            if ($result->getMessage() == 'Error: destination already exists') { 
    317317                $this->setData('message', _("Error: destination already exists")); 
    318318                return $this->modifyForward(); 
     
    354354 
    355355        // Make sure forward was supplied 
    356         if(!isset($_REQUEST['forward'])) { 
     356        if (!isset($_REQUEST['forward'])) { 
    357357            $this->setData('message', _("Error: no forward provided")); 
    358358            return $this->listForwards(); 
    359359        } 
    360360        // Make sure line was supplied 
    361         if(!isset($_REQUEST['line'])) { 
     361        if (!isset($_REQUEST['line'])) { 
    362362            $this->setData('message', _("Error: no forward line provided")); 
    363363            return $this->modifyForward(); 
     
    369369 
    370370        $result = $this->deleteForwardLine(); 
    371         if(PEAR::isError($result)) { 
    372             if($result->getCode() == 1) { 
     371        if (PEAR::isError($result)) { 
     372            if ($result->getCode() == 1) { 
    373373                $this->setData('message', $result->getMessage()); 
    374374                return $this->listAliases(); 
    375             } else if($result->getCode() == 2) { 
     375            } else if ($result->getCode() == 2) { 
    376376                $this->setData('message', $result->getMessage()); 
    377377                return $this->modifyForward(); 
    378             } else if($result->getCode() == 3) { 
     378            } else if ($result->getCode() == 3) { 
    379379                return $this->deleteForward(); 
    380380            } else { 
     
    391391 
    392392        // Make sure forward was supplied 
    393         if(!isset($_REQUEST['forward'])) { 
     393        if (!isset($_REQUEST['forward'])) { 
    394394            $this->setData('message', _("Error: no forward provided")); 
    395395            return $this->listForwards(); 
     
    397397        $forward = ereg_replace('^.qmail-', '', $_REQUEST['forward']); 
    398398        $contents = $this->user->ReadFile($this->domain, '', ".qmail-" . $forward); 
    399         if($this->user->Error) 
     399        if ($this->user->Error) 
    400400            return PEAR::raiseError($this->user->Error); 
    401401        $this->user->RmFile($this->domain, '', '.qmail-' . $forward); 
    402         if($this->user->Error) 
     402        if ($this->user->Error) 
    403403            return PEAR::raiseError($this->user->Error); 
    404404        $this->setData('message', _("Forward Deleted Successfully")); 
  • trunk/Framework/Module/Login.php

    r149 r163  
    3939        if ($form->validate()) { 
    4040            $result = $this->user->authenticate($_POST['email'], $_POST['password']); 
    41             if(PEAR::isError($result)) { 
     41            if (PEAR::isError($result)) { 
    4242                $this->setData('loginError', $result->getMessage()); 
    4343                $this->setData('QF_Form', $form->toHtml()); 
  • trunk/Framework/Module/Responders.php

    r154 r163  
    3939        parent::__construct(); 
    4040        // Make sure doamin was supplied 
    41         if(!isset($_REQUEST['domain'])) 
     41        if (!isset($_REQUEST['domain'])) 
    4242            throw new Framework_Exception(_("Error: no domain supplied")); 
    4343        $this->domain = $_REQUEST['domain']; 
     
    5454    protected function checkPrivileges() { 
    5555        // Verify that they have access to this domain 
    56         if(!$this->user->isDomainAdmin($this->domain)) { 
     56        if (!$this->user->isDomainAdmin($this->domain)) { 
    5757            return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $this->domain); 
    5858        } 
     
    7979        // Pagintation setup 
    8080        $total = count($autoresponders_raw); 
    81         if($this->user->Error) die ("Error: {$this->user->Error}"); 
     81        if ($this->user->Error) die ("Error: {$this->user->Error}"); 
    8282        $this->setData('total', $total); 
    8383        $this->setData('limit', (integer)Framework::$site->config->maxPerPage); 
    84         if(isset($_REQUEST['start']) && !ereg('[^0-9]', $_REQUEST['start'])) { 
    85             if($_REQUEST['start'] == 0) { 
     84        if (isset($_REQUEST['start']) && !ereg('[^0-9]', $_REQUEST['start'])) { 
     85            if ($_REQUEST['start'] == 0) { 
    8686                $start = 1; 
    8787            } else { 
     
    8989            } 
    9090        } 
    91         if(!isset($start)) $start = 1; 
     91        if (!isset($start)) $start = 1; 
    9292        $this->setData('start', $start); 
    9393        $this->setData('currentPage', ceil($this->data['start'] / $this->data['limit'])); 
     
    9898        $autoresponders = array(); 
    9999        $count = 0; 
    100         while(list($key,$val) = each($autoresponders_paginated)) { 
     100        while (list($key,$val) = each($autoresponders_paginated)) { 
    101101            $autoresponders[$count]['autoresponder'] = $key; 
    102102            $autoresponders[$count]['edit_url'] = htmlspecialchars("./?module=Responders&domain={$this->domain}&responder=$key&event=modifyResponder"); 
     
    142142    static function sameDomain ($name, $value) { 
    143143        $emailArray = explode('@', $value); 
    144         if($emailArray[1] == $this->domain) return true; 
     144        if ($emailArray[1] == $this->domain) return true; 
    145145        return false; 
    146146    } 
     
    149149 
    150150        $form = $this->addForm(); 
    151         if(!$form->validate()) { 
     151        if (!$form->validate()) { 
    152152            $renderer =& new HTML_QuickForm_Renderer_Array(); 
    153153            $form->accept($renderer); 
     
    167167 
    168168        $this->user->AddUser($this->domain, $emailArray[0], $_REQUEST['password'], $_REQUEST['comment']); 
    169         if($this->user->Error) { 
     169        if ($this->user->Error) { 
    170170            $this->setData('message', _("Error: ") . $this->user->Error); 
    171171            $renderer =& new HTML_QuickForm_Renderer_Array(); 
     
    209209    function delete() { 
    210210 
    211         if(!isset($_REQUEST['account'])) { 
     211        if (!isset($_REQUEST['account'])) { 
    212212            return PEAR::raiseError(_("Error: no account supplied")); 
    213213        } 
     
    225225    function deleteNow() { 
    226226 
    227         if(!isset($_REQUEST['account'])) { 
     227        if (!isset($_REQUEST['account'])) { 
    228228            return PEAR::raiseError(_("Error: no account supplied")); 
    229229        } 
    230230 
    231         if(!isset($_REQUEST['domain'])) { 
     231        if (!isset($_REQUEST['domain'])) { 
    232232            return PEAR::raiseError(_("Error: no domain supplied")); 
    233233        } 
    234234 
    235235        $this->user->DelUser($this->domain, $_REQUEST['account']); 
    236         if($this->user->Error) { 
     236        if ($this->user->Error) { 
    237237            return PEAR::raiseError(_("Error: ") . $this->user->Error); 
    238238        } 
     
    252252 
    253253        // Make sure account was supplied 
    254         if(!isset($_REQUEST['responder'])) { 
     254        if (!isset($_REQUEST['responder'])) { 
    255255            return PEAR::raiseError(_("Error: no Auto-Responder supplied")); 
    256256        } 
     
    258258 
    259259        // Check privs 
    260         if(!$this->user->isUserAdmin($account, $this->domain)) { 
     260        if (!$this->user->isUserAdmin($account, $this->domain)) { 
    261261            return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $this->domain); 
    262262        } 
     
    266266        print_r($responder);exit; 
    267267 
    268         if($this->user->Error) { 
     268        if ($this->user->Error) { 
    269269            return PEAR::raiseError(_('Error: ') . $this->user->Error); 
    270270        } 
     
    287287        $this->setData('LANG_Modify_Account', _("Modify Account")); 
    288288        $this->setData('LANG_Domain_Menu', _("Domain Menu")); 
    289         if($this->user->isDomainAdmin($this->domain)) { 
     289        if ($this->user->isDomainAdmin($this->domain)) { 
    290290            $this->setData('isDomainAdmin', 1); 
    291291            $this->setData('LANG_Main_Menu', _("Main Menu")); 
     
    322322 
    323323        // Make sure account was supplied 
    324         if(!isset($_REQUEST['account'])) { 
     324        if (!isset($_REQUEST['account'])) { 
    325325            return PEAR::raiseError(_("Error: no account supplied")); 
    326326        } 
     
    328328 
    329329        // Check privs 
    330         if(!$this->user->isUserAdmin($account, $this->domain)) { 
     330        if (!$this->user->isUserAdmin($account, $this->domain)) { 
    331331            return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $this->domain); 
    332332        } 
     
    334334        // See what user_info to use 
    335335        $account_info = $this->user->UserInfo($this->domain, $_REQUEST['account']); 
    336         if($this->user->Error) { 
     336        if ($this->user->Error) { 
    337337            return PEAR::raiseError(_('Error: ') . $this->user->Error); 
    338338        } 
     
    340340        // Get .qmail info if it exists 
    341341        $dot_qmail = $this->user->ReadFile($this->domain, $_REQUEST['account'], '.qmail'); 
    342         if($this->user->Error && $this->user->Error != 'command failed - -ERR 2102 No such file or directory') { 
     342        if ($this->user->Error && $this->user->Error != 'command failed - -ERR 2102 No such file or directory') { 
    343343            return PEAR::raiseError(_('Error: ') . $this->user->Error); 
    344344        } 
    345345        $defaults = $this->user->parseHomeDotqmail($dot_qmail, $account_info); 
    346346        $form = $this->modifyAccountForm($account, $defaults); 
    347         if(!$form->validate()) { 
     347        if (!$form->validate()) { 
    348348            $this->setData('message', _("Error Modifying Account")); 
    349349            $renderer =& new HTML_QuickForm_Renderer_Array(); 
     
    357357        $routing = ''; 
    358358        $save_a_copy = 0; 
    359         if($_REQUEST['routing'] == 'routing_standard') { 
     359        if ($_REQUEST['routing'] == 'routing_standard') { 
    360360            $routing = 'standard'; 
    361         } else if($_REQUEST['routing'] == 'routing_deleted') { 
     361        } else if ($_REQUEST['routing'] == 'routing_deleted') { 
    362362            $routing = 'deleted'; 
    363         } else if($_REQUEST['routing'] == 'routing_forwarded') { 
    364             if(empty($_REQUEST['forward'])) { 
     363        } else if ($_REQUEST['routing'] == 'routing_forwarded') { 
     364            if (empty($_REQUEST['forward'])) { 
    365365                return PEAR::raiseError(_('Error: you must supply a forward address')); 
    366366            } else { 
     
    368368            } 
    369369            $routing = 'forwarded'; 
    370             if(isset($_REQUEST['save_a_copy'])) $save_a_copy = 1; 
     370            if (isset($_REQUEST['save_a_copy'])) $save_a_copy = 1; 
    371371        } else { 
    372372            return PEAR::raiseError(_('Error: unsupported routing selection')); 
     
    375375        // Check for vacation 
    376376        $vacation = 0; 
    377         if(isset($_REQUEST['vacation'])) { 
     377        if (isset($_REQUEST['vacation'])) { 
    378378            $vacation = 1; 
    379379            $vacation_subject = $_REQUEST['vacation_subject']; 
     
    383383        // Build .qmail contents 
    384384        $dot_qmail_contents = ''; 
    385         if($routing == 'deleted') { 
     385        if ($routing == 'deleted') { 
    386386            $dot_qmail_contents = "# delete"; 
    387         } else if($routing == 'forwarded') { 
     387        } else if ($routing == 'forwarded') { 
    388388            $dot_qmail_contents = "&$forward"; 
    389             if($save_a_copy = 1) $dot_qmail_contents .= "\n./Maildir/"; 
    390         } 
    391  
    392         if($vacation == 1) { 
    393             if(strlen($dot_qmail_contents) > 0) $dot_qmail_contents .= "\n"; 
     389            if ($save_a_copy = 1) $dot_qmail_contents .= "\n./Maildir/"; 
     390        } 
     391 
     392        if ($vacation == 1) { 
     393            if (strlen($dot_qmail_contents) > 0) $dot_qmail_contents .= "\n"; 
    394394            $vacation_dir = $account_info['user_dir'] . '/vacation'; 
    395395            $dot_qmail_contents .= "| $autorespond 86400 3 $vacation_dir/message $vacation_dir"; 
     
    399