Changeset 4 for index.php


Ignore:
Timestamp:
Nov 26, 2008, 9:56:46 PM (15 years ago)
Author:
maron
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • index.php

    r3 r4  
    1717                echo ROZPIS;
    1818                show_mass();
     19                echo '<br><br>';
     20                $files = scandir('mass');
     21                for ($i=0;$i<count($files);++$i) {
     22                  $file = 'mass/'.$files[$i];
     23                  if (filetype($file) <> 'dir') echo '<a href="?img='.$file.'"><img width="200" src='.$file.' title="'.FILE_SAVED . date ("m d Y H:i:s.", filemtime($file)).'"></a>';
     24                }
    1925                show_article(3);
    2026
     
    2632        } else if (array_key_exists('admin',$_GET)) {
    2733                echo ADMIN;
    28                 show_article(5);
     34                if (array_key_exists('pass',$_POST) ) {
     35                  if ($_POST['pass'] == $Config['webpass'])  {
     36                        $_SESSION['pass'] = $_POST['pass'];
     37                  } else {
     38                        echo BAD_PASS;
     39                  }
     40                }
     41                if (isset($_SESSION['pass'])) {
     42                        if ($_SESSION['pass'] == $Config['webpass']) {
     43                                //administrátorská část
     44                                show_upload_mass();  //nahrání rozpisu
     45                                save_file();
     46                                show_article(5);
     47                        }
     48                } else {
     49                  show_login();
     50                }
     51
     52
     53        } else if (array_key_exists('img',$_GET)) {
     54                $file = $_GET['img'];
     55                echo '<img width="100%" src='.$file.' title="'."Soubor byl vložen " . date ("m d Y H:i:s.", filemtime($file)).'">';
    2956
    3057
Note: See TracChangeset for help on using the changeset viewer.