Beispiel #1
0
 public function getSecurity()
 {
     $this->data = array('groups' => Groups::all(), 'pageTitle' => 'Login And Security', 'pageNote' => 'Login Configuration and Setting', 'hybrid' => Config::get('hybridauth'), 'groups' => Groups::all());
     $this->layout->nest('content', 'admin/config/security', $this->data)->with('menus', $this->menus);
 }
Beispiel #2
0
 function postSave($id = 0)
 {
     $rules = array('title' => 'required', 'alias' => 'required|alpha_dash', 'filename' => 'required|alpha', 'status' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->passes()) {
         $content = Input::get('content');
         $data = $this->validatePost('tb_pages');
         if (Input::get('pageID') == 1) {
             $filename = public_path() . "protected/app/views/pages/template/home.blade.php";
         } else {
             $filename = public_path() . "protected/app/views/pages/template/" . Input::get('filename') . ".blade.php";
         }
         $fp = fopen($filename, "w+");
         fwrite($fp, $content);
         fclose($fp);
         $groups = Groups::all();
         $access = array();
         foreach ($groups as $group) {
             $access[$group->group_id] = isset($_POST['group_id'][$group->group_id]) ? '1' : '0';
         }
         $data['access'] = json_encode($access);
         $data['allow_guest'] = Input::get('allow_guest');
         $data['template'] = Input::get('template');
         $this->model->insertRow($data, Input::get('pageID'));
         self::createRouters();
         return Redirect::to('pages')->with('message', SiteHelpers::alert('success', 'Data Has Been Save Successfull'));
     } else {
         return Redirect::to('pages/add/' . $id)->with('message', SiteHelpers::alert('error', 'The following errors occurred'))->withErrors($validator)->withInput();
     }
 }