Ejemplo n.º 1
0
 /**
  * Installer::SiteSetup()
  * 
  * @return
  */
 public static function SiteSetup()
 {
     /*$_POST['SITE_NAME'] == '' || $_POST['firstname'] == '' || $_POST['lastname'] == ''
     		|| $_POST['email'] == '' ||  $_POST['password'] == '' || $_POST['vaname'] == ''
     		|| $_POST['vacode'] == ''*/
     // first add the airline
     $_POST['vacode'] = strtoupper($_POST['vacode']);
     if (!OperationsData::addAirline($_POST['vacode'], $_POST['vaname'])) {
         self::$error = __FILE__ . ' ' . __LINE__ . ' ' . DB::$error;
         return false;
     }
     // Add the user
     $data = array('firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'email' => $_POST['email'], l, 'password' => $_POST['password'], 'code' => $_POST['vacode'], 'location' => 'US', 'hub' => 'KJFK', 'confirm' => true);
     if (!RegistrationData::addUser($data)) {
         self::$error = __FILE__ . ' ' . __LINE__ . ' ' . DB::$error;
         return false;
     }
     RanksData::calculatePilotRanks();
     # Add to admin group
     $pilotdata = PilotData::getPilotByEmail($_POST['email']);
     if (!PilotGroups::addUsertoGroup($pilotdata->pilotid, 'Administrators')) {
         self::$error = __FILE__ . ' ' . __LINE__ . ' ' . DB::$error;
         return false;
     }
     # Add the final settings in
     SettingsData::SaveSetting('SITE_NAME', $_POST['SITE_NAME']);
     SettingsData::SaveSetting('ADMIN_EMAIL', $_POST['email']);
     SettingsData::SaveSetting('GOOGLE_KEY', $_POST['googlekey']);
     return true;
 }