예제 #1
0
파일: Index.php 프로젝트: nemtos/PhotoShow
 function __construct()
 {
     /// Initialize variables
     Settings::init();
     /// Initialize CurrentUser
     try {
         CurrentUser::init();
     } catch (Exception $e) {
         $page = new RegisterPage(true);
         $page->toHTML();
         return;
     }
     /// Check what to do
     switch (CurrentUser::$action) {
         case "Judge":
             // Same as page
         // Same as page
         case "Page":
             $page = new MainPage();
             $page->toHTML();
             break;
         case "Log":
             $page = new LoginPage();
             $page->toHTML();
             break;
         case "Reg":
             $page = new RegisterPage();
             $page->toHTML();
             break;
         case "JS":
             $page = new JS();
             break;
         case "Img":
             Provider::Image(CurrentUser::$path);
             break;
         case "BDl":
             Provider::Image(CurrentUser::$path, false, true, true, true);
             break;
         case "Big":
             Provider::Image(CurrentUser::$path, false, true);
             break;
         case "Thb":
             Provider::Image(CurrentUser::$path, true);
             break;
         case "Zip":
             Provider::Zip(CurrentUser::$path);
             break;
         case "Acc":
             if (CurrentUser::$admin && isset($_POST['login'])) {
                 $acc = new Account($_POST['login']);
             } else {
                 $acc = CurrentUser::$account;
             }
             $acc->toHTML();
             break;
         case "Adm":
             $page = new Admin();
             $page->toHTML();
             break;
     }
 }
예제 #2
0
 public function __construct()
 {
     /// Execute stuff automagically
     new Admin();
     if (isset($_GET['j'])) {
         switch ($_GET['j']) {
             case "Pag":
                 $m = new Menu();
                 $p = new Board();
                 $ap = new AdminPanel();
                 echo "<div id='menu' class='menu'>\n";
                 $m->toHTML();
                 echo "</div>\n";
                 echo "<div class='panel'>\n";
                 $p->toHTML();
                 echo "</div>\n";
                 echo "<div class='image_panel hidden'>\n";
                 echo "</div>\n";
                 if (CurrentUser::$admin) {
                     echo "<div class='infos'>\n";
                     $ap->toHTML();
                     echo "</div>\n";
                 }
                 break;
             case "Log":
                 $p = new LoginPage();
                 $p->toHTML();
                 break;
             case "Reg":
                 $p = new RegisterPage();
                 $p->toHTML();
                 break;
             case "Pan":
                 if (is_file(CurrentUser::$path)) {
                     $b = new ImagePanel(CurrentUser::$path);
                     $b->toHTML();
                 } else {
                     $b = new Board(CurrentUser::$path);
                     $b->toHTML();
                 }
                 break;
             case "Men":
                 $m = new Menu();
                 $m->toHTML();
                 break;
             case "Pan":
                 $f = new AdminPanel();
                 $f->toHTML();
                 break;
             case "Inf":
                 $f = new Infos();
                 $f->toHTML();
                 break;
             case "Jud":
                 $j = new Judge(CurrentUser::$path);
                 $j->toHTML();
                 break;
             case "Acc":
                 $f = new Group();
                 $f->toHTML();
                 break;
             case "Comm":
                 $f = new Comments(CurrentUser::$path);
                 $f->toHTML();
                 break;
             default:
                 break;
         }
     }
 }