-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshowuser.php
More file actions
113 lines (104 loc) · 3.01 KB
/
Copy pathshowuser.php
File metadata and controls
113 lines (104 loc) · 3.01 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
include("loginprotection.php");
if( isset($_GET['t']) && ($_GET['t']=="true" || $_GET['t']=="1" || $_GET['t']==1 || strpos($_GET['t'], "true") === true))
$t = true;
else
$t = false;
if(empty(t))
$t = false;
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, $t, $_POST["e_".$id]);
header('Location: http://schwerdainbolt.de/c/showuser.php?uid='.$_GET['uid'].(empty($t)?"":"&t=true"));
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, $t);
$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'].(empty($t)?"":"&t=true"));
exit;
}
}
else if(isset($_POST['char']))
{
addChar($_GET['uid'], $t, $_POST['char']);
header('Location: http://schwerdainbolt.de/c/showuser.php?uid='.$_GET['uid'].(empty($t)?"":"&t=true"));
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'], $t);
if($t===false)
{
echo " - <a href=\"info.php?uid=".$_GET['uid']."\">Steckbrief</a>(<a href=\"infocp.php?uid=".$_GET['uid']."\">CP</a>) - ";
}
echo "<a href=\"copypasterinochar.php?uid=".$_GET['uid'].(empty($t)?"":"&t=true")."\">Copy Pasterino</a>"; ?></h1>
<?php
getChars($_GET['uid'], $t);
//var_dump($_GET);
//var_dump($t);
//echo "==\"true\": ".($_GET['t']=="true")."<br>";
//echo "==\"1\": ".($_GET['t']=="1")."<br>";
//echo "==1: ".($_GET['t']==1)."<br>";
//echo "strpos != -1: ".(strpos($_GET['t'], "true") === true)."<br>";
?>
<p><font size="1">*Pflichtfeld</font></p>
<?php if($_GET['uid'] != $_SESSION['userid'] && false) { ?>
<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>