public function getSecurity()
 {
     $this->data = array('groups' => Groups::all(), 'pageTitle' => 'Login And Security', 'pageNote' => 'Login Configuration and Setting', 'active' => 'security');
     return view('sximo.config.security', $this->data);
 }
 function getBlast()
 {
     $this->data = array('groups' => Groups::all(), 'pageTitle' => 'Blast Email', 'pageNote' => 'Send email to users');
     return view('admin.core.users.blast', $this->data);
 }
 function postSave(Request $request, $id = 0)
 {
     $rules = array('title' => 'required', 'alias' => 'required|alpha_dash', 'filename' => 'required|alpha', 'status' => 'required');
     $validator = Validator::make($request->all(), $rules);
     if ($validator->passes()) {
         $content = $request->input('content');
         $data = $this->validatePost('tb_pages');
         if ($request->input('pageID') == 1) {
             $filename = base_path() . "/resources/views/pages/home.blade.php";
         } else {
             $filename = base_path() . "/resources/views/pages/" . $request->input('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'] = $request->input('allow_guest');
         $data['template'] = $request->input('template');
         $this->model->insertRow($data, $request->input('pageID'));
         self::createRouters();
         return Redirect::to('admin/core/pages?return=' . self::returnUrl())->with('messagetext', \Lang::get('core.note_success'))->with('msgstatus', 'success');
     } else {
         return Redirect::to('admin/core/pages/update/' . $id)->with('messagetext', \Lang::get('core.note_error'))->with('msgstatus', 'error')->withErrors($validator)->withInput();
     }
 }