Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PHP-Chat
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SST
PHP-Chat
Commits
bfa7df74
Commit
bfa7df74
authored
Jul 18, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erste Anpassungen am Admin Menü
parent
a52e3472
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
26 deletions
+67
-26
admin.php
admin.php
+67
-26
No files found.
admin.php
View file @
bfa7df74
<?php
include
(
"config.php"
);
?>
<!DOCTYPE
HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>
<!DOCTYPE
html
>
<html>
<head>
<title>
Admin Men
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"standard.css"
>
</head>
<body
class=
"bodyadmin"
onBlur=
"this.focus()"
>
<head
lang=
"de"
>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
PHP-Chat
</title>
<!-- Latest compiled and minified CSS -->
<link
rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
integrity=
"sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
crossorigin=
"anonymous"
>
<!-- Optional theme -->
<link
rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"
integrity=
"sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r"
crossorigin=
"anonymous"
>
<!--custrom css-->
<link
rel=
"stylesheet"
href=
"style.css"
>
</head>
<body>
<div
class=
"container-fluid"
>
<?php
$result
=
mysql_query
(
"SELECT * FROM user WHERE id = '
{
$_SESSION
[
'chatuserid'
]
}
'"
);
...
...
@@ -15,35 +28,62 @@ if(!isset($_SESSION['chatuserid']) OR $users['online'] == 0)
echo
"Erst anmelden..."
;
else
{
if
(
$users
[
'admin'
]
>=
3
)
{
echo
"<h2>Admin-Men</h2>"
;
echo
"<a href=
\"
admin.php
\"
>Home</a> | "
;
echo
"<a href=
\"
admin.php?action=delete_chat
\"
>Chat leeren</a> | "
;
echo
"<a href=
\"
admin.php?action=show_user
\"
>Zeige User</a> | "
;
echo
"<a href=
\"
admin.php?action=startseitentext
\"
>Startseitentext bearbeiten</a> | "
;
echo
"<a href=
\"
admin.php?action=admin_log
\"
>Admin Log</a> | <hr>"
;
?>
<nav
class=
"navbar navbar-default navbar-fixed-top"
>
<div
class=
"container-fluid"
>
<div
class=
"navbar-header"
>
<button
type=
"button"
class=
"navbar-toggle collapsed"
data-toggle=
"collapse"
data-target=
"#mainnavbar"
aria-expanded=
"false"
>
<span
class=
"sr-only"
>
Toggle navigation
</span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand"
href=
"
<?php
echo
$_SERVER
[
'SCRIPT_NAME'
];
?>
"
>
PHP-Chat Admin
</a>
</div>
<div
class=
"collapse navbar-collapse"
id=
"mainnavbar"
>
<ul
class=
"nav navbar-nav"
>
<li
<?php
echo
(
!
isset
(
$_GET
[
'action'
])
?
'class="active"'
:
''
);
?>
><a
href=
"
<?php
echo
$_SERVER
[
'SCRIPT_NAME'
];
?>
"
><span
class=
"glyphicon glyphicon-home"
/></a></li>
<li
<?php
echo
(
$_GET
[
'action'
]
==
"delete_chat"
?
'class="active"'
:
''
);
?>
><a
href=
"
<?php
echo
$_SERVER
[
'SCRIPT_NAME'
];
?>
?action=delete_chat"
>
Chat leeren
</a></li>
<li
<?php
echo
(
$_GET
[
'action'
]
==
"show_user"
?
'class="active"'
:
''
);
?>
><a
href=
"
<?php
echo
$_SERVER
[
'SCRIPT_NAME'
];
?>
?action=show_user"
>
Zeige User
</a></li>
<li
<?php
echo
(
$_GET
[
'action'
]
==
"startseitentext"
?
'class="active"'
:
''
);
?>
><a
href=
"
<?php
echo
$_SERVER
[
'SCRIPT_NAME'
];
?>
?action=startseitentext"
>
Startseitentext
</a></li>
<li
<?php
echo
(
$_GET
[
'action'
]
==
"admin_log"
?
'class="active"'
:
''
);
?>
><a
href=
"
<?php
echo
$_SERVER
[
'SCRIPT_NAME'
];
?>
?action=admin_log"
>
Admin Log
</a></li>
</ul>
<ul
class=
"nav navbar-nav navbar-right"
>
<li
id=
"LoginBtn"
><a
href=
"#"
onclick=
"window.close();"
><span
class=
"glyphicon glyphicon-remove-circle"
></span>
Schließen
</a></li>
</ul>
</div>
</div>
</nav>
<div
class=
"row"
>
<div
class=
"col-xs-10 col-xs-offset-1"
>
<?php
if
(
$_GET
[
'action'
]
==
"delete_chat"
)
{
echo
"<font size=
\"
5
\"
>Chat Lschen</font><br><br>"
;
echo
"<font size=
\"
5
\"
>Chat L
�
schen</font><br><br>"
;
echo
"<a href=
\"
admin.php?action=delete_chat&del=privat
\"
>Chat leeren (mit Privaten)</a><br>"
;
if
(
$_GET
[
'del'
]
==
"privat"
)
{
mysql_query
(
"DELETE FROM chat WHERE hidden = 0"
);
AdminLogAdd
(
"Chat gelscht (mit Privat)"
,
$_SESSION
[
'chatuserid'
],
2
);
echo
"<font color=
\"
green
\"
>Chat gelscht (mit Privat)</font><script>window.setTimeout(
\"
parent.location.href = 'admin.php?action=admin_log';
\"
,1000);</script><br>"
;
AdminLogAdd
(
"Chat gel
�
scht (mit Privat)"
,
$_SESSION
[
'chatuserid'
],
2
);
echo
"<font color=
\"
green
\"
>Chat gel
�
scht (mit Privat)</font><script>window.setTimeout(
\"
parent.location.href = 'admin.php?action=admin_log';
\"
,1000);</script><br>"
;
}
echo
"<a href=
\"
admin.php?action=delete_chat&del=global
\"
>Chat leeren (ohne Privaten)</a><br>"
;
if
(
$_GET
[
'del'
]
==
"global"
)
{
mysql_query
(
"DELETE FROM chat WHERE privat=0 AND hidden = 0"
);
AdminLogAdd
(
"Chat gelscht (ohne Privat)"
,
$_SESSION
[
'chatuserid'
],
2
);
echo
"<font color=
\"
green
\"
>Chat gelscht (ohne Privat)</font><script>window.setTimeout(
\"
parent.location.href = 'admin.php?action=admin_log';
\"
,1000);</script><br>"
;
AdminLogAdd
(
"Chat gel
�
scht (ohne Privat)"
,
$_SESSION
[
'chatuserid'
],
2
);
echo
"<font color=
\"
green
\"
>Chat gel
�
scht (ohne Privat)</font><script>window.setTimeout(
\"
parent.location.href = 'admin.php?action=admin_log';
\"
,1000);</script><br>"
;
}
echo
"<a href=
\"
admin.php?action=delete_chat&del=all
\"
>Chat leeren (mit Privaten und Adminlog)</a><br>"
;
if
(
$_GET
[
'del'
]
==
"all"
)
{
mysql_query
(
"DELETE FROM chat"
);
AdminLogAdd
(
"Chat gelscht (Alles)"
,
$_SESSION
[
'chatuserid'
],
2
);
echo
"<font color=
\"
green
\"
>Chat gelscht (Alles)</font><script>window.setTimeout(
\"
parent.location.href = 'admin.php?action=admin_log';
\"
,1000);</script><br>"
;
AdminLogAdd
(
"Chat gel
�
scht (Alles)"
,
$_SESSION
[
'chatuserid'
],
2
);
echo
"<font color=
\"
green
\"
>Chat gel
�
scht (Alles)</font><script>window.setTimeout(
\"
parent.location.href = 'admin.php?action=admin_log';
\"
,1000);</script><br>"
;
}
}
else
if
(
$_GET
[
'action'
]
==
"show_user"
)
...
...
@@ -52,8 +92,8 @@ else{
if
(
isset
(
$_GET
[
'id'
]))
{
$name
=
IDtoUsername
(
$_GET
[
'id'
]);
mysql_query
(
"DELETE FROM user WHERE id ="
.
$_GET
[
'id'
]);
AdminLogAdd
(
"User: "
.
$name
.
" wurde gelscht!"
,
$_SESSION
[
'chatuserid'
],
1
);
echo
"<font color=
\"
green
\"
>User: "
.
$name
.
" wurde gelscht!</font><br>"
;
AdminLogAdd
(
"User: "
.
$name
.
" wurde gel
�
scht!"
,
$_SESSION
[
'chatuserid'
],
1
);
echo
"<font color=
\"
green
\"
>User: "
.
$name
.
" wurde gel
�
scht!</font><br>"
;
}
echo
"<table border=
\"
1
\"
>
...
...
@@ -67,7 +107,7 @@ else{
<td>
{
$user
[
'name'
]
}
</td>
<td><abbr title=
\"
{
$user
[
'pass'
]
}
\"
>Versteckt!</abbr></td>
<td>
{
$user
[
'admin'
]
}
</td>
<td><!--
{
$user
[
'online'
]
}
--> "
.
$online
.
"</td><td><a href=
\"
admin.php?action=show_user&id=
{
$user
[
'id'
]
}
\"
>lschen!</a></td></tr>"
;
<td><!--
{
$user
[
'online'
]
}
--> "
.
$online
.
"</td><td><a href=
\"
admin.php?action=show_user&id=
{
$user
[
'id'
]
}
\"
>l
�
schen!</a></td></tr>"
;
}
echo
"</table>"
;
}
...
...
@@ -85,7 +125,7 @@ else{
$fileData
=
fread
(
$fs
,
2048
);
}
fclose
(
$fs
);
echo
"<form method=
\"
post
\"
><textarea name=
\"
fileData
\"
rows=
\"
23
\"
cols=
\"
60
\"
>
$fileData
</textarea><br><input type=
\"
submit
\"
value=
\"
ndern!
\"
name=
\"
submit
\"
></form>"
;
echo
"<form method=
\"
post
\"
><textarea name=
\"
fileData
\"
rows=
\"
23
\"
cols=
\"
60
\"
>
$fileData
</textarea><br><input type=
\"
submit
\"
value=
\"
�
ndern!
\"
name=
\"
submit
\"
></form>"
;
}
else
if
(
$_GET
[
'action'
]
==
"admin_log"
)
{
...
...
@@ -101,14 +141,15 @@ else{
}
else
{
echo
"<font size=
\"
5
\"
>Admin Men</font><br><table border=
\"
1
\"
>"
;
echo
'Hier ist das Adminmen Herzlich Willkommen!'
;
echo
"<font size=
\"
5
\"
>Admin Men
�
</font><br><table border=
\"
1
\"
>"
;
echo
'Hier ist das Adminmen
�
Herzlich Willkommen!'
;
}
}
else
echo
"Zugriff verweigert!"
;
}
?>
<br><br><a
href=
"#"
onclick=
"window.close();"
>
Fenster schlieen
</a>
</div>
</div>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment