-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshowuser_old.php
More file actions
96 lines (88 loc) · 2.6 KB
/
Copy pathshowuser_old.php
File metadata and controls
96 lines (88 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
include("loginprotection.php");
$t = isset($_GET['t']) && ($_GET['t']=="true" || $_GET['t']=="1" || $_GET['t']==1 || strpos($_GET['t'], "#") != -1);
if(isset($_POST['editsave']) || isset($_POST['teacher']))
{
$id = -1;
foreach(array_keys($_POST) as $name)
{
if(strpos($name, "s_") !== false)
{
$id = str_replace("s_", "", $name);
updateChar($id, isset($_GET['t'])?$_GET['t']:0, $_POST["e_".$id]);
header('Location: http://schwerdainbolt.de/c/showuser.php?uid='.$_GET['uid'].'&t='.(isset($_GET['t'])?$_GET['t']:"false"));
exit;
}
}
foreach(array_keys($_POST) as $name)
{
if(strpos($name, "id_") !== false)
{
$id = str_replace("id_", "", $name);
break;
}
}
$done = false;
if($_SESSION['admin'])
{
deleteChar($id, $_POST["teacher"]);
$done = true;
}
else
{
if(strlen($_POST["reason"][$id]) >= 5)
{
addRequest($id, $_POST["teacher"], $_POST["reason"][$id]);
$done = true;
}
else
{
$err = "Der Grund um einen Beitrag zu melden muss mindestens 5 (fünf) Zeichen lang sein.";
}
}
if($done)
{
header('Location: http://schwerdainbolt.de/c/showuser.php?uid='.$_GET['uid'].'&t='.(isset($_GET['t'])?$_GET['t']:"false"));
exit;
}
}
else if(isset($_POST['char']))
{
addChar($_GET['uid'], isset($_GET['t'])?$_GET['t']:"false", $_POST['char']);
header('Location: http://schwerdainbolt.de/c/showuser.php?uid='.$_GET['uid'].'&t='.(isset($_GET['t'])?$_GET['t']:"false"));
exit;
}
?>
<html>
<head>
<title>Show User</title>
<link rel="stylesheet" href="<?php echo $_SESSION['style']; ?>.css">
</head>
<body>
<p><font size="14" color="#FF0000"><b><?php if(isset($err)) echo $err ?></b></font></p>
<h1><?php echo getName($_GET['uid'], isset($_GET['t'])?$_GET['t']:false);?></h1>
<?php
getChars($_GET['uid'], isset($_GET['t'])?$_GET['t']:false);
?>
<p><font size="1">*Pflichtfeld</font></p>
<?php if($_GET['uid'] != $_SESSION['userid']) { ?>
<form action="#" method="POST">
<table width="300px" border="0" cellpadding="3" cellspacing="1">
<tr>
<th width="140" align="left">Charakteristik hinzufügen:</th>
</tr>
<tr>
<th width="140" align="left">Mehrere Nachrichten mit "|" trennen.</th>
</tr>
<tr>
<td align="left"><input type="text" name="char" value="" style="width:100%"></td>
</tr>
<tr>
<td colspan="2" align="left" nowrap><br><input type="submit" name="add" value="hinzufügen" style="width:99%"></td>
</tr>
</table>
</form>
<?php } ?>
<p><a href="index.php">Menü</a><br><br><a href="logout.php">Logout</a><br>keks: <?php echo isset($_COOKIE['userid'])?"yep":"nope"; ?></p>
</body>
</html>