public function run()
 {
     $faker = Faker::create('en_GB');
     $dcs = [['@hasla.org.uk', 'DC=hasla,DC=org,DC=uk', '8454612-DC01.hasla.org.uk', 'web.team', Crypt::encrypt('Hastings1'), 0, 389]];
     foreach (range(1, count($dcs)) as $index) {
         DomainController::create(['account_suffix' => $dcs[$index - 1][0], 'base_dn' => $dcs[$index - 1][1], 'domain_controller' => $dcs[$index - 1][2], 'admin_username' => $dcs[$index - 1][3], 'admin_password' => $dcs[$index - 1][4], 'use_ssl' => $dcs[$index - 1][5], 'ad_port' => $dcs[$index - 1][6]]);
     }
 }
Example #2
0
 public function sync()
 {
     $domainControllers = \App\DomainController::all();
     foreach ($domainControllers as $domainController) {
         $this->options = ['account_suffix' => $domainController->account_suffix, 'base_dn' => $domainController->base_dn, 'domain_controllers' => [$domainController->domain_controller], 'admin_username' => $domainController->admin_username, 'admin_password' => Crypt::decrypt($domainController->admin_password), 'use_ssl' => (bool) $domainController->use_ssl, 'ad_port' => $domainController->ad_port];
         $this->adLDAP = new adLDAP($this->options);
         $this->getUsers($domainController);
     }
 }
Example #3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     DomainController::truncate();
     Trust::truncate();
     Site::truncate();
     Role::truncate();
     Permission::truncate();
     Module::truncate();
     DB::statement('SET FOREIGN_KEY_CHECKS=1;');
     Model::unguard();
     $this->call('DomainControllersTableSeeder');
     $this->call('TrustsTableSeeder');
     $this->call('SitesTableSeeder');
     $this->call('RolesTableSeeder');
     $this->call('ModulesTableSeeder');
     $this->call('PermissionsTableSeeder');
 }