Esempio n. 1
0
 /**
  * 基础配置修改
  */
 public function editAction()
 {
     if ($this->_request->isPost()) {
         //修改密码验证
         $aCookie = Util_Cookie::get(Yaf_G::getConf('authkey', 'cookie'));
         $iAdminID = $aCookie['iAdminID'];
         $aUser = Model_Admin::getDetail($iAdminID);
         $pwd = $this->getParam('pwd');
         if (!isset($pwd) || $pwd == '') {
             return $this->showMsg('修改密码不可以为空', false);
         }
         if ($aUser['sEditPassword'] != md5($pwd)) {
             return $this->showMsg('修改密码不正确', false);
         }
         $aDomain = $this->_checkData('update');
         if (empty($aDomain)) {
             return null;
         }
         $aDomain['iAutoID'] = intval($this->getParam('iAutoID'));
         $aOldDomain = Model_Domain::getDetail($aDomain['iAutoID']);
         if (empty($aOldDomain)) {
             return $this->showMsg('基础配置不存在!', false);
         }
         if ($aOldDomain['sName'] != $aDomain['sName']) {
             if (Model_Domain::getRow(array('where' => array('sName' => $aDomain['sName'], 'iType' => $aDomain['iType'], 'iStatus' => 1)))) {
                 return $this->showMsg('基础配置已经存在!', false);
             }
         }
         if (1 == Model_Domain::updData($aDomain)) {
             return $this->showMsg('基础配置信息更新成功!', true);
         } else {
             return $this->showMsg('基础配置信息更新失败!', false);
         }
     } else {
         $iAutoID = intval($this->getParam('id'));
         $aDomain = Model_Domain::getDetail($iAutoID);
         $this->assign('aDomain', $aDomain);
     }
     $this->assign('iType', Model_Domain::$iType);
 }