예제 #1
0
 private function CheckForAuthentication()
 {
     if ($this->securityGuard->IsAuthenticated()) {
         $this->page->SetShowDatabasePrompt(true);
         return;
     }
     $this->page->SetShowDatabasePrompt(false);
 }
예제 #2
0
 private function Configure()
 {
     if (!$this->securityGuard->IsAuthenticated()) {
         return;
     }
     $user = ServiceLocator::GetServer()->GetUserSession();
     Log::Debug('Editing configuration file. Email=%s, UserId=%s', $user->Email, $user->UserId);
     $configFile = ROOT_DIR . 'config/config.php';
     $configDistFile = ROOT_DIR . 'config/config.dist.php';
     $configurator = new Configurator();
     if ($configurator->CanOverwriteFile($configFile)) {
         $configurator->Merge($configFile, $configDistFile);
         $this->page->ShowConfigUpdateSuccess();
     } else {
         $manualConfig = $configurator->GetMergedString($configFile, $configDistFile);
         $this->page->ShowManualConfig($manualConfig);
     }
 }