/**
  * Show the form for creating a new resource.
  * GET /users/create
  *
  * @return Response
  */
 public function create()
 {
     $pagetitle = 'Create User';
     $departments = Department::orderBy('department')->lists('department', 'id');
     $roles = Role::orderBy('name')->lists('name', 'id');
     return View::make('user.create', compact('pagetitle', 'departments', 'roles'));
 }
Esempio n. 2
0
 static function getLookup()
 {
     $role = new Role();
     $role->orderBy('name');
     $role->find();
     $roleList = array();
     while ($role->fetch()) {
         $roleList[$role->roleId] = $role->name . ' - ' . $role->description;
     }
     return $roleList;
 }
 public function permission_index()
 {
     $president_id = Auth::user()->id;
     $users = User::with('AssigmentRole')->with('Neighbors')->paginate(10);
     $president_urbanism = Neighbors::with('NeighborProperty')->findOrFail($president_id);
     foreach ($president_urbanism->NeighborProperty as $row) {
         $urbanism_id = $row->urbanism_id;
         $neighbors = NeighborProperty::where('urbanism_id', '=', $urbanism_id)->get();
     }
     $roles = Role::orderBy('id', 'ASC')->lists('name', 'id');
     return View::make('dashboard.admin.permission.index', ['select' => ['' => 'Seleccione'], 'neighbors' => $neighbors, 'roles' => $roles, 'users' => $users]);
 }
Esempio n. 4
0
 public function getView($id)
 {
     User::onlyHas('user-edit');
     $this->data['user'] = User::find($id);
     $this->data['roles'] = Role::orderBy('key', 'asc')->get();
     if ($this->data['user']) {
         $this->layout->content = View::make('sections.user.view', $this->data);
         return $this->layout;
     } else {
         throw new Exception("User not found");
     }
 }
Esempio n. 5
0
 /**
  * get the Filemanager
  *
  * @return Response
  */
 public function getRolePermission()
 {
     //User
     $data['user'] = Auth::user();
     //Roles
     $data['roles'] = Role::orderBy('name', 'ASC')->get();
     //Interface
     $data['noAriane'] = true;
     if (Request::ajax()) {
         return Response::json(View::make('theme::' . 'admin.role_permission.index', $data)->renderSections());
     } else {
         return View::make('theme::' . 'admin.role_permission.index', $data);
     }
 }
Esempio n. 6
0
 public function _list($page = 1, $searchString = null)
 {
     if (!empty($searchString)) {
         $roles = Role::where('ime', 'like', '%' . $searchString . '%')->orderBy('ime');
     } else {
         $roles = Role::orderBy('ime');
     }
     if ($page != 1) {
         Paginator::setCurrentPage($page);
     }
     $roles = $roles->paginate(10);
     $v = View::make('Role.list')->with('roles', $roles);
     if (Request::ajax()) {
         return $v->renderSections()['list'];
     }
     return $v;
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $roles = Role::orderBy('name')->get();
     return View::make("admin.role.list", array("roles" => $roles));
 }
 public static function manageprivilleges($id)
 {
     $pagetitle = 'Update User Role';
     $user_id = $id;
     $selectrole = DB::table('assigned_roles')->where('user_id', $id)->first();
     $myrole = DB::table('roles')->where('id', $selectrole->role_id)->first();
     $roles = Role::orderBy('name')->where('id', '!=', $myrole->id)->lists('name', 'id');
     return View::make('user.roleedit', compact('pagetitle', 'myrole', 'roles', 'user_id'));
 }
 public function registro()
 {
     $perfiles = Role::orderBy('name')->get();
     $this->array_view['perfiles'] = $perfiles;
     return View::make($this->folder_name . '.registro', $this->array_view);
 }
Esempio n. 10
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit(General $general, User $user)
 {
     $theme = $general->theme();
     if ($user->id == Auth::user()->id) {
         return redirect('/admin/user/' . $user->id);
     }
     dd($user);
     $roles = Role::orderBy('level')->lists('name', 'id');
     $theme['title'] = 'Edit User';
     $theme['description'] = 'edit user entry';
     $button_text = 'Update User';
     return view('admin.group.edit', compact('theme', 'group', 'roles', 'button_text'));
 }
Esempio n. 11
0
 public static function getRolesOrdered($pagination = 10)
 {
     return Role::orderBy('id', 'desc')->paginate($pagination);
 }