This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/_developer_data/Sakura.php

47 lines
932 B
PHP
Raw Normal View History

<?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();