示例#1
0
 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $response = $next($request);
     if (!$request->ajax()) {
         $v = View::make('boomcms::people.manager', ['groups' => Group::findAll(), 'content' => $response->getContent()]);
         $response->setContent($v);
     }
     return $response;
 }
示例#2
0
 /**
  * @return void
  */
 public function handle()
 {
     $password = (string) new RandomPassword();
     $this->credentials['password'] = Auth::hash($password);
     try {
         $person = Person::create($this->credentials);
     } catch (DuplicateEmailException $e) {
     }
     if (isset($person)) {
         foreach ($this->groups as $groupId) {
             $person->addGroup(Group::find($groupId));
         }
         Event::fire(new AccountCreated($person, $password, Auth::getPerson()));
         return $person;
     } else {
         return Person::findByEmail($this->credentials['email']);
     }
 }
示例#3
0
 public function save()
 {
     $this->group->setName($this->request->input('name'));
     Group::save($this->group);
 }
示例#4
0
 public function removeGroup()
 {
     $group = Group::find($this->request->input('group_id'));
     $this->editPerson->removeGroup($group);
 }
示例#5
0
 public function addGroup()
 {
     return view("{$this->viewPrefix}/addgroup", ['person' => $this->editPerson, 'groups' => GroupFacade::allExcept($this->editPerson->getGroupIds())]);
 }
示例#6
0
文件: Acl.php 项目: boomcms/boom-core
 /**
  * View the page ACL settings.
  *
  * @param Page $page
  *
  * @return View
  */
 public function index(Page $page)
 {
     $this->auth($page);
     return view('boomcms::editor.page.settings.acl', ['page' => $page, 'allGroups' => GroupFacade::findAll(), 'groupIds' => $page->getAclGroupIds()]);
 }
示例#7
0
 public function update(Request $request, GroupModel $group)
 {
     $group->setName($request->input('name'));
     GroupFacade::save($group);
 }