Beispiel #1
0
 public function index()
 {
     if (AccessHelper::is_allowed()) {
         $users = User::all();
         return View("Base::User")->with('users', $users);
     } else {
         return \View('Base::Base.forbiden');
     }
 }
Beispiel #2
0
 public function delete(Request $request)
 {
     if (AccessHelper::is_allowed()) {
         MenuModel::where('id', '=', $request->id)->delete();
         return \Redirect::to('settings/menus');
     } else {
         return \View('Base::Base.forbiden');
     }
 }
Beispiel #3
0
 public function addmenutogroup_form(Request $request)
 {
     if (AccessHelper::is_allowed()) {
         $group = GroupModel::find($request->id);
         $users = UserModel::all();
         $groups = GroupModel::all();
         $routes = RoutesModel::all();
         $groupusers = GroupUserModel::where('group_id', '=', $request->id)->get();
         $menus = GroupUserMenuAccessModel::where('group_id', '=', $request->id)->get();
         $datas = GroupModel::userGroupName(\Auth::user()->id);
         $topMenuByGroup = MenuModel::getTopMenu(\Auth::user()->id);
         return View("Base::addmenutogroup_form")->with('group', $group)->with('users', $users)->with('groupusers', $groupusers)->with('routes', $routes)->with('menus', $menus)->with('datas', $datas)->with('topMenuByGroup', $topMenuByGroup);
     } else {
         return \View('Base::Base.forbiden');
     }
 }
Beispiel #4
0
 public function reload()
 {
     if (AccessHelper::is_allowed()) {
         $lists = array_diff(scandir(app_path() . "/Addons"), array('..', '.'));
         foreach ($lists as $key => $value) {
             $__erp__ = app_path() . "/Addons/{$value}/__erp__.php";
             if (file_exists($__erp__)) {
                 $addons = Addons::where('dir', '=', $value)->first();
                 if ($addons) {
                     $installed = $addons->is_installed;
                 } else {
                     $installed = "0";
                 }
                 include $__erp__;
                 Addons::where('dir', '=', $value)->update(["name" => $erp['name'], "version" => $erp['version'], "category" => $erp['category'], "description" => $erp['description'], "url" => $erp['website'], "dir" => $value, "is_installed" => $installed, "author" => $erp['author']]);
             }
         }
         return \Redirect::to('settings/addons');
     } else {
         return \View('Base::Base.forbiden');
     }
 }