Ejemplo n.º 1
0
 /**
  * Execute the console command
  */
 public function handle()
 {
     $this->initCommand();
     // open the site list
     $siteList = fopen($this->directories['list'], 'w');
     $domains = Domain::all();
     foreach ($domains as $domain) {
         // clear the site information string
         unset($siteInformation, $databaseName);
         // clear database username and password values
         $databaseName = $databaseUsername = $databasePassword = '';
         // check for WP and pull the proper template
         if ($domain->is_word_press) {
             // generate the database username and password
             $databaseName = substr(str_replace('.', '', $domain->name), 0, 6) . date('ynj') . '_wp';
             $databaseUsername = substr(str_replace('.', '', $domain->name), 0, 6) . date('ynj') . '_wp';
             $databasePassword = '' . str_random(24);
         }
         $databaseHost = env('WP_DB_HOST');
         // build the site information string
         //  format: domain name:username:password:is WP
         //  should be: domain.com:domauser:d0m4inP4$s!:true
         $siteInformation = '' . $domain->name . ':' . (int) $domain->is_word_press . ':' . $databaseName . ':' . $databaseUsername . ':' . $databasePassword . ':' . $databaseHost . ":\n";
         fwrite($siteList, $siteInformation);
         // soft-delete domain
         $domain->delete();
     }
     fclose($siteList);
 }
 public function index()
 {
     $domains = Domain::all();
     $domains = Domain::with('records')->get();
     return $domains;
 }
Ejemplo n.º 3
0
 protected function elements($defaults)
 {
     return array('password' => array('type' => 'password', 'description' => Output::translate('Admin password to prove you\'re one of the hims/hers.'), 'required' => true, 'minlength' => 4), 'prefs' => array('type' => 'grid', 'subtype' => 'checkbox', 'reverse' => true, 'title' => Output::translate('Choose categories'), 'horizontal' => array(Output::translate('Domain'), models\Domain::all('domain_id >= ?', $this->options->domain ? $this->options->domain->domain_id : 0)), 'vertical' => array(Output::translate('User'), models\User::all('user_id >= ?', $this->options->user ? $this->options->user->user_id : 0)), 'description' => Output::translate('One category per user / domain combination'), 'name' => 'options'), 'cat' => array('type' => 'options', 'options' => models\Category::all()));
 }