コード例 #1
0
ファイル: actions.class.php プロジェクト: poliloco/pdns-gui
 public function validateEdit()
 {
     if ($this->isPOST()) {
         if (!($this->template = TemplatePeer::retrieveByPK($this->getRequestParameter('id')))) {
             $this->getRequest()->setError('id', 'Invalid template id.');
             return false;
         }
         $c = new Criteria();
         $c->add(TemplatePeer::ID, $this->getRequestParameter('id'), Criteria::NOT_EQUAL);
         $c->add(TemplatePeer::NAME, $this->getRequestParameter('name'));
         if (TemplatePeer::doSelectOne($c)) {
             $this->getRequest()->setError('name', 'Name already in use.');
             return false;
         }
         return $this->commonValidate();
     }
     return true;
 }