Changeset 241

Show
Ignore:
Timestamp:
01/08/08 01:38:11 (1 year ago)
Author:
shupp
Message:

fixes in add ip maps so that server side validation works properly

Files:

Legend:

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

    r233 r241  
    110110    public function add() 
    111111    { 
    112         $this->setData('addForm', $this->_addForm()->toHtml()); 
    113         $this->tplFile = 'addIPMap.tpl'
     112        $form = $this->_addForm(); 
     113        $this->_renderForm($form)
    114114    } 
    115115 
     
    126126        $form = $this->_addForm(); 
    127127        if (!$form->validate()) { 
    128             return $this->add(); 
     128            $this->_renderForm($form); 
     129            return; 
    129130        } 
    130131        try { 
     
    132133        } catch (Net_Vpopmaild_Exception $e) { 
    133134            $this->setData('message', _('Error adding IP Map')); 
    134             return $this->add(); 
     135            $this->_renderForm($form); 
     136            return; 
    135137        } 
    136138        $this->tplFile = 'addIPMapSuccess.tpl'; 
     
    162164        return $form; 
    163165    } 
     166 
     167    private function _renderForm($form) 
     168    { 
     169        $this->setData('addForm', $form->toHtml()); 
     170        $this->tplFile = 'addIPMap.tpl'; 
     171    } 
    164172} 
    165173?>