Exemple #1
0
 public function oauth_edit_act()
 {
     $id = IFilter::act(IReq::get('id'));
     if ($id == 0) {
         $this->redirect('oauth_list', false);
         Util::showMessage('请选择要修改的登录平台');
         exit;
     }
     $oauthDBObj = new IModel('oauth');
     $oauthRow = $oauthDBObj->getObj('id = ' . $id);
     if (empty($oauthRow)) {
         $this->redirect('oauth_list', false);
         Util::showMessage('请选择要修改的登录平台');
         exit;
     }
     $dataArray = array('name' => IFilter::act(IReq::get('name')), 'is_close' => IFilter::act(IReq::get('is_close')), 'description' => IFilter::act(IReq::get('description')), 'config' => array());
     //获取字段数据
     $oauthObj = new Oauth($id);
     $oauthFields = $oauthObj->getFields();
     if (!empty($oauthFields)) {
         $parmsArray = array_keys($oauthFields);
         foreach ($parmsArray as $val) {
             $dataArray['config'][$val] = IFilter::act(IReq::get($val));
         }
     }
     $dataArray['config'] = serialize($dataArray['config']);
     $oauthDBObj->setData($dataArray);
     $oauthDBObj->update('id = ' . $id);
     $this->redirect('oauth_list');
 }