Пример #1
0
 function Run()
 {
     //Load config
     $config = new Config();
     $config->Load();
     $displayManager = new DisplayManager();
     //Create Login Manager
     $loginManager = new LoginManager();
     $loginManager->Load();
     $loginFail = false;
     if ($loginManager->WantLogin()) {
         $loginFail = !$loginManager->TryLogin();
         if (!$loginFail) {
             header('location: index.php');
         }
     }
     if ($loginManager->WantLogout()) {
         $loginManager->Logout();
     }
     if (isset($_GET['want']) and $_GET['want'] == 'logo') {
         $logo = new Logo();
         $logo->Generate();
         return;
     } elseif (isset($_GET['want']) and $_GET['want'] == 'source') {
         $displayManager->DisplaySource();
     } else {
         if ($loginManager->IsLogged()) {
             $imageManager = new ImageManager();
             $images = $imageManager->GetImages();
             $displayManager->DisplayImagesPage($images);
         } else {
             $displayManager->DisplayLoginPage($loginFail);
         }
     }
 }
Пример #2
0
 function Run()
 {
     $displayManager = new DisplayManager();
     if (isset($_GET['want']) and $_GET['want'] == 'logo') {
         $logo = new Logo();
         $logo->Generate();
         return;
     } elseif (isset($_GET['want']) and $_GET['want'] == 'source') {
         $displayManager->DisplaySource();
     } else {
         $displayManager->DisplaySitePage();
     }
 }
Пример #3
0
 function Run()
 {
     //Load config
     Config::SetInstance(new Config());
     Config::GetInstance()->Load();
     $albumManager = new AlbumManager();
     $album = new Album();
     $album->SetPath(Config::GetInstance()->GetPath());
     LinkManager::SetInstance(new LinkManager());
     LinkManager::GetInstance()->SetAlbum($album);
     $displayManager = new DisplayManager();
     //Create Login Manager
     $loginManager = new LoginManager();
     LoginManager::SetInstance($loginManager);
     $loginManager->Load();
     $loginFail = false;
     if ($loginManager->WantLogin()) {
         $loginFail = !$loginManager->TryLogin();
         if (!$loginFail) {
             header('location: ' . LinkManager::GetInstance()->Generate());
         }
     }
     if ($loginManager->WantLogout()) {
         $loginManager->Logout();
     }
     if (isset($_GET['want']) and $_GET['want'] == 'logo') {
         $logo = new Logo();
         $logo->Generate();
         return;
     } elseif (isset($_GET['want']) and $_GET['want'] == 'source') {
         $displayManager->DisplaySource();
     } elseif (isset($_GET['want']) and $_GET['want'] == 'help') {
         $displayManager->DisplayHelpPage();
     } else {
         if ($loginManager->IsAccessAllowed($album)) {
             $displayManager->DisplayImagesPage($album);
         } else {
             if ($loginManager->IsLogged()) {
                 $displayManager->DisplayAccessRefusedPage($album);
             } else {
                 $displayManager->DisplayLoginPage($album, $loginFail);
             }
         }
     }
 }