コード例 #1
0
ファイル: SyncRole.php プロジェクト: stevebauman/ithub
 /**
  * Execute the command.
  */
 public function handle()
 {
     $group = $this->adldap->getProvider('default')->search()->groups()->find($this->argument('group-name'));
     if ($group instanceof Group) {
         if ($this->dispatch(new ImportGroup($group))) {
             $this->info("Successfully imported group: {$group->getName()}");
         }
     } else {
         $this->info('Error, there was an issue finding the specified group.');
     }
 }
コード例 #2
0
 /**
  * Creates a new computer from active directory.
  *
  * @param ComputerRequest $request
  *
  * @return Computer|bool
  */
 protected function storeFromActiveDirectory(ComputerRequest $request)
 {
     $computer = $this->adldap->getProvider('default')->search()->computers()->find($request->input('name'));
     if ($computer instanceof AdComputer) {
         return $this->dispatch(new ImportComputer($computer));
     }
     return false;
 }