Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gameauth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sucssite
gameauth
Commits
42f4d6f6
Commit
42f4d6f6
authored
9 years ago
by
Stuart John Watson
Browse files
Options
Downloads
Patches
Plain Diff
commit to checkout another branch
parent
8b85fe64
No related branches found
No related tags found
1 merge request
!1
Major Rebuild: AJAX and working game info
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gameauth.db
+0
-0
0 additions, 0 deletions
gameauth.db
index.php
+29
-16
29 additions, 16 deletions
index.php
with
29 additions
and
16 deletions
gameauth.db
+
0
−
0
View file @
42f4d6f6
No preview for this file type
This diff is collapsed.
Click to expand it.
index.php
+
29
−
16
View file @
42f4d6f6
...
...
@@ -7,6 +7,19 @@
<link
href=
"css/material-wfont.min.css"
rel=
"stylesheet"
>
<title>
SUCS Games Server
</title>
<style>
.if-NO_LOGIN
,
.if-NO_GAMES
,
.if-GAME_ACCESS
{
display
:
none
;
}
.mode-NO_LOGIN
.if-NO_LOGIN
,
.mode-NO_GAMES
.if-NO_
{
}
</style>
</head>
<body>
<nav
class=
"navbar navbar-inverse navbar-warning"
>
...
...
@@ -143,35 +156,36 @@
function
loginRefresh
(){
console
.
log
()
$
.
post
(
"
controll.php
"
,{},
onPostResponse
);
$
.
post
(
"
controll.php
"
,{
renew
:
1
},
onPostResponse
);
}
function
onPostResponse
(
response
){
console
.
log
(
response
)
var
level
=
response
[
"
level
"
],
error
=
response
[
"
loginError
"
],
username
=
response
[
"
username
"
],
extraPayload
=
response
[
"
extraPayload
"
]
if
(
level
==
"
NO_LOGIN
"
){
//Show an error if there is one
if
(
response
.
loginError
){
$
(
"
#loginErrorWrap
"
).
show
();
$
(
"
#loginError
"
).
text
(
ERR_MAP
[
error
]);
}
else
{
$
(
"
#loginErrorWrap
"
).
hide
();
}
var
username
=
response
[
"
username
"
],
extraPayload
=
response
[
"
extraPayload
"
];
if
(
response
.
level
==
"
NO_LOGIN
"
){
//User isn't logged in
$
(
"
#onlineListWrap
"
).
hide
()
$
(
"
#username
"
).
hide
();
$
(
"
#login
"
).
show
();
$
(
"
#logout
"
).
hide
();
$
(
"
#signup
"
).
show
()
}
else
{
//User is logged in ...
setTimeout
(
loginRefresh
,
30
*
1000
);
$
(
"
#username
"
).
show
().
text
(
"
Hello
"
+
username
);
$
(
"
#login
"
).
hide
();
$
(
"
#logout
"
).
show
();
setTimeout
(
loginRefresh
,
30
*
1000
);
if
(
level
==
"
NO_GAMES
"
)
{
//...but cannot access games
$
(
"
#loginErrorWrap
"
).
show
();
$
(
"
#loginError
"
).
text
(
ERR_MAP
[
error
]);
if
(
error
==
"
UNI_DISALLOWED
"
){
$
(
"
#loginMessage
"
).
show
().
html
(
SIGNUP_INFO
);
$
(
"
#signup
"
).
show
()
...
...
@@ -179,7 +193,6 @@
$
(
"
#loginMessage
"
).
hide
()
}
$
(
"
#onlineList
"
).
hide
()
}
else
if
(
level
==
"
GAME_ACCESS
"
)
{
//...and can access games
$
(
"
#loginMessage
"
).
show
().
html
(
SUCCESS
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment