Begin work on session system and start work on Sock Chat auth.

This commit is contained in:
Pachira 2015-04-06 20:26:05 +00:00
parent c1c8bfaaf9
commit 0c47a9037d
6 changed files with 71 additions and 36 deletions

View file

@ -0,0 +1,46 @@
<?php
/*
* Sakura Sock Chat authentication script
* By Flashwave
*/
// Settings
$sockSakuraPath = ''; // Filesystem path to the _sakura folder WITHOUT an ending /
/* * * DON'T EDIT ANYTHING BELOW THIS LINE * * */
// Include Sakura
require_once $sockSakuraPath .'/sakura.php';
use sockchat\Auth;
if(Auth::getPageType() == AUTH_FETCH) {
// Check if user is logged into the Sakura backend if not deny
if(/* Login check */) {
// If so append the required arguments and accept
Auth::AppendArguments([/* User ID */, /* Session ID */]);
Auth::Accept();
} else
Auth::Deny();
} else {
// Check if session is active else deny
if(/* Check if session is active */) {
Auth::SetUserData(
/* User ID */,
/* Username */,
/* User colour */
);
} else
Auth::Deny();
}
// Serve the authentication data
Auth::Serve();

View file

@ -1,19 +1,23 @@
<?php
/*
* Session Handler
*/
namespace Sakura;
class Session {
// Initiate new session
public static function init() {
// Start PHP session
if(session_status() != PHP_SESSION_ACTIVE)
session_start();
}
}
<?php
/*
* Session Handler
*/
namespace Sakura;
class Session {
// Current user data
public static $userId;
public static $sessionId;
// Initiate new session
public static function init() {
// Start PHP session
if(session_status() != PHP_SESSION_ACTIVE)
session_start();
}
}

View file

@ -19,8 +19,8 @@ class Users {
'password_chan' => 0,
'password_new' => '',
'email' => 'deleted@flashii.net',
'group_main' => 0,
'groups' => '[0]',
'rank_main' => 0,
'ranks' => '[0]',
'name_colour' => '',
'register_ip' => '127.0.0.1',
'last_ip' => '127.0.0.1',

View file

@ -1 +0,0 @@
# Empty .htaccess to make git realise this directory exists

View file

@ -1 +0,0 @@
&lt;wow aja i mean sock chat&gt;

View file

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Amu Style Tests</title>
<style type="text/css">
</style>
</head>
<body>
<input type="submit" />
</body>
</html>