Example #1
0
 public static function initializeMasterTenant()
 {
     $session = Session::instance();
     Doctrine::getTable('Location')->getRecordListener()->get('MultiTenant')->setOption('disabled', true);
     Doctrine::getTable('User')->getRecordListener()->get('MultiTenant')->setOption('disabled', true);
     $options = array();
     $options['account'] = array('name' => 'Master Account', 'type' => Account::TYPE_NORMAL);
     $options['location'] = array('name' => 'Main Location');
     $options['user'] = array('username' => $session->get('installer.adminEmailAddress'), 'password' => $session->get('installer.adminPassword'), 'user_type' => User::TYPE_SYSTEM_ADMIN);
     Bluebox_Tenant::initializeTenant($options);
     Bluebox_Tenant::initializeSite('localhost', 1);
     // Force a login of the master/admin user for the remainder of the install
     Auth::instance()->force_login($session->get('installer.adminEmailAddress'));
     users::isUserAuthentic();
     users::getCurrentUser();
 }