~studentersamfundet-web/dns-mms/main

« back to all changes in this revision

Viewing changes to moderate.php

  • Committer: Jon Ramvi
  • Date: 2009-10-09 13:49:17 UTC
  • Revision ID: ramvi@tul-1x-dhcp226.studby.uio.no-20091009134917-br2ozl4qk2ske7yx
Dagens endringer

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
 
 
3
session_start();
 
4
 
 
5
if(isset($_GET['logout']))
 
6
{
 
7
header('Location: ?');
 
8
unset($_SESSION['hemmelig']);
 
9
exit;
 
10
}
 
11
 
 
12
 
 
13
if(!isset($_SESSION['hemmelig']))
 
14
{
 
15
if(isset($_POST['pswrd']) && $_POST['pswrd'] == 'hemmelig')
 
16
{
 
17
$_SESSION['hemmelig'] = 1;
 
18
}
 
19
else
 
20
{
 
21
echo '<form method="post"><input type="password" name="pswrd" /><input type="submit" value="login" /></form>';
 
22
exit;
 
23
}
 
24
}
 
25
if(isset($_GET['fjern']))
 
26
{
 
27
$path = 'images/' .basename( $_GET['fjern']);
 
28
$dest = 'sensur/' . basename($_GET['fjern']);
 
29
if(copy($path, $dest))
 
30
   unlink($path);
 
31
header('Location: ?');
 
32
exit;
 
33
}
 
34
 
 
35
if(isset($_GET['leggtil']))
 
36
{
 
37
$path = 'sensur/'.basename($_GET['leggtil']);
 
38
$dest = 'images/'.basename($_GET['leggtil']);
 
39
if(copy($path, $dest))
 
40
   unlink($path);
 
41
header('Location: ?');
 
42
exit;
 
43
}
3
44
$images = glob('images/*');
4
45
 
5
46
$removed = glob('sensur/*');
6
47
 
7
 
echo '<h1>bilde i loop</h1>';
 
48
 
 
49
echo '<a href="?logout=1">Logout</a>';
 
50
echo '<h1>bilder i loopen</h1>';
8
51
echo '<div>';
9
52
 
10
53
foreach($images as $image)