Changeset 222

Show
Ignore:
Timestamp:
12/09/07 00:33:54 (1 year ago)
Author:
shupp
Message:

update Forwards to use domain auth container, clean up top doc blocks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Framework/Module/Forwards.php

    r195 r222  
    11<?php 
    22 
    3 /** 
    4  * 
    5  * Forward Module 
    6  * 
    7  * This module is for viewing and editing vpopmail forwards 
    8  * 
    9  * @author Bill Shupp <hostmaster@shupp.org> 
    10  * @package ToasterAdmin 
    11  * @version 1.0 
    12  * 
    13  */ 
    14  
     3/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ 
    154 
    165/** 
    176 * Framework_Module_Forwards  
    187 *  
    19  * @package ToasterAdmin 
    20  * @copyright 2005-2006 Bill Shupp 
    21  * @author Bill Shupp <hostmaster@shupp.org>  
    22  * @license GPL 2.0  {@link http://www.gnu.org/licenses/gpl.txt} 
     8 * This module is for viewing and editing vpopmail forwards 
     9 *  
     10 * PHP Version 5 
     11 *  
     12 * @uses      ToasterAdmin_Auth_Domain 
     13 * @package   ToasterAdmin 
     14 * @author    Bill Shupp <hostmaster@shupp.org>  
     15 * @copyright 2007 Bill Shupp 
     16 * @license   GPL 2.0  {@link http://www.gnu.org/licenses/gpl.txt} 
     17 * @link      http://trac.merchbox.com/trac/toasteradmin 
    2318 */ 
    24 class Framework_Module_Forwards extends ToasterAdmin_Common 
     19 
     20/** 
     21 * Framework_Module_Forwards  
     22 *  
     23 * This module is for viewing and editing vpopmail forwards 
     24 *  
     25 * @uses      ToasterAdmin_Auth_Domain 
     26 * @package   ToasterAdmin 
     27 * @author    Bill Shupp <hostmaster@shupp.org>  
     28 * @copyright 2007 Bill Shupp 
     29 * @license   GPL 2.0  {@link http://www.gnu.org/licenses/gpl.txt} 
     30 * @link      http://trac.merchbox.com/trac/toasteradmin 
     31 */ 
     32class Framework_Module_Forwards extends ToasterAdmin_Auth_Domain 
    2533{ 
    2634 
     
    3543    function __construct() { 
    3644        parent::__construct(); 
    37         // Make sure doamin was supplied 
    38         if (($result = $this->noDomainSupplied())) { 
    39             return $result; 
    40         } 
    41         // Make sure they are authorized 
    42         if (($result = $this->noDomainPrivs())) { 
    43             return $result; 
    44         } 
     45        $this->noDomainSupplied())) { 
    4546    } 
    4647 
     
    5556    } 
    5657 
    57  
    58     /** 
    59      * checkPrivileges  
    60      *  
    61      * @access protected 
    62      * @return mixed true on success, PEAR_Error on failure 
    63      */ 
    64     protected function checkPrivileges() { 
    65         // Verify that they have access to this domain 
    66         if (!$this->user->isDomainAdmin($this->domain)) { 
    67             return PEAR::raiseError(_('Error: you do not have edit privileges on domain ') . $this->domain); 
    68         } 
    69         return true; 
    70     } 
    71      
    7258    /** 
    7359     * listForwards  
     
    7864    function listForwards() { 
    7965     
    80         $result = $this->checkPrivileges(); 
    81         if (PEAR::isError($result)) return $result; 
    82  
    8366        // Pagintation setup 
    8467        $full_alias_array = $this->user->listAlias($this->domain); 
     
    133116     */ 
    134117    function addForward() { 
    135         $result = $this->checkPrivileges(); 
    136         if (PEAR::isError($result)) return $result; 
    137  
    138118        $form = $this->addForwardForm(); 
    139119        $renderer =& new HTML_QuickForm_Renderer_AssocArray(); 
     
    179159     */ 
    180160    function addForwardNow() { 
    181         $result = $this->checkPrivileges(); 
    182         if (PEAR::isError($result)) return $result; 
    183  
    184161        $form = $this->addForwardForm(); 
    185162        if (!$form->validate()) { 
     
    248225     */ 
    249226    protected function deleteForwardLine() { 
    250  
    251227        $contents = $this->user->readFile($this->domain, '', ".qmail-" . $this->data['forward']); 
    252228        if (PEAR::isError($contents)) { 
     
    286262     */ 
    287263    function modifyForward() { 
    288      
    289         $this->checkPrivileges(); 
    290264        // Make sure forward was supplied 
    291265        if (!isset($_REQUEST['forward'])) { 
     
    336310     */ 
    337311    function modifyForwardNow() { 
    338         $this->checkPrivileges(); 
    339  
    340312        $forward = ereg_replace('^.qmail-', '', $_REQUEST['forward']); 
    341313        $this->setData('forward', $forward); 
     
    411383     */ 
    412384    function deleteForwardLineNow() { 
    413         $this->checkPrivileges(); 
    414  
    415385        // Make sure forward was supplied 
    416386        if (!isset($_REQUEST['forward'])) { 
     
    453423     */ 
    454424    function deleteForward() { 
    455         $result = $this->checkPrivileges(); 
    456         if (PEAR::isError($result)) return $result; 
    457  
    458425        // Make sure forward was supplied 
    459426        if (!isset($_REQUEST['forward'])) {