first few updates in ages
This commit is contained in:
parent
a435d15339
commit
888b22f14a
24 changed files with 350 additions and 345 deletions
|
@ -39,6 +39,7 @@ class ActiveUser
|
|||
->where('user_id', self::$user->id)
|
||||
->update([
|
||||
'user_last_online' => time(),
|
||||
'last_ip' => Net::pton(Net::ip()),
|
||||
]);
|
||||
} else {
|
||||
self::$user = User::construct(0);
|
||||
|
|
|
@ -36,6 +36,7 @@ class ForumController extends Controller
|
|||
{
|
||||
// Get the most active threads
|
||||
$activeThreadsIds = DB::table('posts')
|
||||
->where('forum_id', '!=', Config::get('forum_trash_id'))
|
||||
->groupBy('topic_id')
|
||||
->orderByRaw('COUNT(*) DESC')
|
||||
->limit(10)
|
||||
|
@ -69,6 +70,7 @@ class ForumController extends Controller
|
|||
|
||||
// Get the latest posts
|
||||
$latestPostsIds = DB::table('posts')
|
||||
->where('forum_id', '!=', Config::get('forum_trash_id'))
|
||||
->orderBy('post_id', 'desc')
|
||||
->limit(10)
|
||||
->get(['post_id']);
|
||||
|
@ -100,6 +102,7 @@ class ForumController extends Controller
|
|||
|
||||
// Get the most active poster
|
||||
$activePosterId = DB::table('posts')
|
||||
->where('forum_id', '!=', Config::get('forum_trash_id'))
|
||||
->where('post_time', '>', time() - (24 * 60 * 60))
|
||||
->groupBy('poster_id')
|
||||
->orderByRaw('COUNT(*) DESC')
|
||||
|
|
|
@ -69,15 +69,15 @@ class MetaController extends Controller
|
|||
'stats' => [
|
||||
'userCount' => DB::table('users')
|
||||
->where('password_algo', '!=', 'disabled')
|
||||
->whereNotIn('rank_main', [1, 10])
|
||||
->whereNotIn('rank_main', [Config::get('deactive_rank_id'), Config::get('restricted_rank_id')])
|
||||
->count(),
|
||||
'newestUser' => $newestUser,
|
||||
'lastRegDate' => date_diff(
|
||||
date_create(date('Y-m-d', $newestUser->registered)),
|
||||
date_create(date('Y-m-d'))
|
||||
)->format('%a'),
|
||||
'topicCount' => DB::table('topics')->count(),
|
||||
'postCount' => DB::table('posts')->count(),
|
||||
'topicCount' => DB::table('topics')->where('forum_id', '!=', Config::get('forum_trash_id'))->count(),
|
||||
'postCount' => DB::table('posts')->where('forum_id', '!=', Config::get('forum_trash_id'))->count(),
|
||||
'onlineUsers' => $onlineUsers,
|
||||
],
|
||||
]);
|
||||
|
|
|
@ -82,8 +82,9 @@ class AdvancedController extends Controller
|
|||
$sessions = DB::table('sessions')
|
||||
->where('user_id', ActiveUser::$user->id)
|
||||
->get();
|
||||
$active = ActiveUser::$session->sessionId;
|
||||
|
||||
Template::vars(compact('sessions'));
|
||||
Template::vars(compact('sessions', 'active'));
|
||||
|
||||
return Template::render('settings/advanced/sessions');
|
||||
}
|
||||
|
|
18
libraries/Exception.php
Normal file
18
libraries/Exception.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
/**
|
||||
* Holds the Exception class.
|
||||
*
|
||||
* @package Sakura
|
||||
*/
|
||||
|
||||
namespace Sakura;
|
||||
|
||||
/**
|
||||
* Sakura Exception class.
|
||||
*
|
||||
* @package Sakura
|
||||
* @author Julian van de Groep <me@flash.moe>
|
||||
*/
|
||||
class Exception extends \Exception
|
||||
{
|
||||
}
|
|
@ -10,6 +10,7 @@ namespace Sakura\Forum;
|
|||
use Sakura\BBcode;
|
||||
use Sakura\Config;
|
||||
use Sakura\DB;
|
||||
use Sakura\Exception;
|
||||
use Sakura\Net;
|
||||
use Sakura\User;
|
||||
|
||||
|
@ -124,13 +125,20 @@ class Post
|
|||
$this->thread = $postRow->topic_id;
|
||||
$this->forum = $postRow->forum_id;
|
||||
$this->poster = User::construct($postRow->poster_id);
|
||||
$this->ip = $postRow->poster_ip;
|
||||
$this->time = $postRow->post_time;
|
||||
$this->subject = $postRow->post_subject;
|
||||
$this->text = $postRow->post_text;
|
||||
$this->editTime = $postRow->post_edit_time;
|
||||
$this->editReason = $postRow->post_edit_reason;
|
||||
$this->editUser = User::construct($postRow->post_edit_user);
|
||||
|
||||
// Temporary backwards compatible IP storage system
|
||||
try {
|
||||
$this->ip = Net::ntop($postRow->poster_ip);
|
||||
} catch (Exception $e) {
|
||||
$this->ip = $postRow->poster_ip;
|
||||
$this->update();
|
||||
}
|
||||
}
|
||||
|
||||
// Parse the markup
|
||||
|
@ -168,7 +176,7 @@ class Post
|
|||
'topic_id' => $thread->id,
|
||||
'forum_id' => $thread->forum,
|
||||
'poster_id' => $poster->id,
|
||||
'poster_ip' => Net::ip(),
|
||||
'poster_ip' => Net::pton(Net::ip()),
|
||||
'post_time' => time(),
|
||||
'post_subject' => $subject,
|
||||
'post_text' => $text,
|
||||
|
@ -235,6 +243,11 @@ class Post
|
|||
*/
|
||||
public function unread($user)
|
||||
{
|
||||
// Return false if the user id is less than 1
|
||||
if ($user < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Attempt to get track row from the database
|
||||
$track = DB::table('topics_track')
|
||||
->where('user_id', $user)
|
||||
|
|
|
@ -347,6 +347,11 @@ class Thread
|
|||
*/
|
||||
public function unread($user)
|
||||
{
|
||||
// Return false if the user id is less than 1
|
||||
if ($user < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Attempt to get track row from the database
|
||||
$track = DB::table('topics_track')
|
||||
->where('user_id', $user)
|
||||
|
|
|
@ -56,7 +56,7 @@ class Net
|
|||
*
|
||||
* @param string $ip Printable IP string.
|
||||
*
|
||||
* @throws \Exception Thrown if an invalid IP is supplied.
|
||||
* @throws Exception Thrown if an invalid IP is supplied.
|
||||
*
|
||||
* @return string Unpacked IP address.
|
||||
*/
|
||||
|
@ -76,7 +76,7 @@ class Net
|
|||
}
|
||||
|
||||
// Throw an exception if an invalid IP was supplied
|
||||
throw new \Exception("Invalid IP address supplied.");
|
||||
throw new Exception("Invalid IP address supplied.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,7 +84,7 @@ class Net
|
|||
*
|
||||
* @param string $bin The unpacked IP.
|
||||
*
|
||||
* @throws \Exception Thrown if the unpacked IP is invalid.
|
||||
* @throws Exception Thrown if the unpacked IP is invalid.
|
||||
*
|
||||
* @return string The packed IP.
|
||||
*/
|
||||
|
@ -95,7 +95,7 @@ class Net
|
|||
|
||||
// Throw an exception if it's not 4 or 16 bytes
|
||||
if ($len !== 4 && $len !== 16) {
|
||||
throw new \Exception("Could not handle this IP type.");
|
||||
throw new Exception("Could not handle this IP type.");
|
||||
}
|
||||
|
||||
// Finally pack the IP
|
||||
|
|
|
@ -133,51 +133,8 @@ class Session
|
|||
return 0;
|
||||
}
|
||||
|
||||
// IP Check
|
||||
$ipCheck = false; // Forced disabled due to incompatibility with the Net class. -- Config::get('session_check');
|
||||
|
||||
// Origin checking
|
||||
if ($ipCheck) {
|
||||
// Split both IPs up
|
||||
$sessionIP = explode('.', $session[0]->user_ip);
|
||||
$userIP = explode('.', Net::ip());
|
||||
|
||||
// Take 1 off the ipCheck variable so it's equal to the array keys
|
||||
$ipCheck = $ipCheck - 1;
|
||||
|
||||
// Check if the user's IP is similar to the session's registered IP
|
||||
switch ($ipCheck) {
|
||||
// 000.xxx.xxx.xxx
|
||||
case 3:
|
||||
if ($userIP[3] !== $sessionIP[3]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// xxx.000.xxx.xxx
|
||||
case 2:
|
||||
case 3:
|
||||
if ($userIP[2] !== $sessionIP[2]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// xxx.xxx.000.xxx
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
if ($userIP[1] !== $sessionIP[1]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// xxx.xxx.xxx.000
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
if ($userIP[0] !== $sessionIP[0]) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* completely removed the code for ip checking because it only worked with IPv4
|
||||
good thing is i can probably do CIDR based checking */
|
||||
|
||||
// If the remember flag is set extend the session time
|
||||
if ($session[0]->session_remember) {
|
||||
|
|
|
@ -316,8 +316,6 @@ class User
|
|||
$this->email = $userRow->email;
|
||||
$this->mainRankId = $userRow->rank_main;
|
||||
$this->colour = $userRow->user_colour;
|
||||
$this->registerIp = Net::ntop($userRow->register_ip);
|
||||
$this->lastIp = Net::ntop($userRow->last_ip);
|
||||
$this->title = $userRow->user_title;
|
||||
$this->registered = $userRow->user_registered;
|
||||
$this->lastOnline = $userRow->user_last_online;
|
||||
|
@ -328,6 +326,31 @@ class User
|
|||
$this->header = $userRow->user_header;
|
||||
$this->page = $userRow->user_page;
|
||||
$this->signature = $userRow->user_signature;
|
||||
|
||||
// Temporary backwards compatible IP storage system
|
||||
try {
|
||||
$this->registerIp = Net::ntop($userRow->register_ip);
|
||||
} catch (Exception $e) {
|
||||
$this->registerIp = $userRow->register_ip;
|
||||
|
||||
DB::table('users')
|
||||
->where('user_id', $this->id)
|
||||
->update([
|
||||
'register_ip' => Net::pton($this->registerIp),
|
||||
]);
|
||||
}
|
||||
|
||||
try {
|
||||
$this->lastIp = Net::ntop($userRow->last_ip);
|
||||
} catch (Exception $e) {
|
||||
$this->lastIp = $userRow->last_ip;
|
||||
|
||||
DB::table('users')
|
||||
->where('user_id', $this->id)
|
||||
->update([
|
||||
'last_ip' => Net::pton($this->lastIp),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// Get all ranks
|
||||
|
|
17
routes.php
17
routes.php
|
@ -28,6 +28,22 @@ Router::filter('loginCheck', function () {
|
|||
}
|
||||
});
|
||||
|
||||
// Maintenance check
|
||||
Router::filter('maintenance', function () {
|
||||
if (Config::get('site_closed')) {
|
||||
ActiveUser::$session->destroy();
|
||||
|
||||
http_response_code(503);
|
||||
|
||||
$message = Config::get('site_closed_reason');
|
||||
|
||||
Template::vars(compact('message'));
|
||||
|
||||
return Template::render('global/maintenance');
|
||||
}
|
||||
});
|
||||
|
||||
Router::group(['before' => 'maintenance'], function () {
|
||||
// Meta pages
|
||||
Router::get('/', 'MetaController@index', 'main.index');
|
||||
Router::get('/faq', 'MetaController@faq', 'main.faq');
|
||||
|
@ -274,3 +290,4 @@ Router::group(['prefix' => 'settings', 'before' => 'loginCheck'], function () {
|
|||
* - Management
|
||||
* - Errors
|
||||
*/
|
||||
});
|
||||
|
|
38
sakura.php
38
sakura.php
|
@ -8,7 +8,7 @@
|
|||
namespace Sakura;
|
||||
|
||||
// Define Sakura version
|
||||
define('SAKURA_VERSION', 20160408);
|
||||
define('SAKURA_VERSION', 20160425);
|
||||
|
||||
// Define Sakura Path
|
||||
define('ROOT', __DIR__ . '/');
|
||||
|
@ -25,12 +25,12 @@ mb_internal_encoding('utf-8');
|
|||
|
||||
// Stop the execution if the PHP Version is older than 7.0.0
|
||||
if (version_compare(phpversion(), '7.0.0', '<')) {
|
||||
throw new \Exception('Sakura requires at least PHP 7.0.0, please upgrade to a newer PHP version.');
|
||||
throw new Exception('Sakura requires at least PHP 7.0.0, please upgrade to a newer PHP version.');
|
||||
}
|
||||
|
||||
// Check if the composer autoloader exists
|
||||
if (!file_exists(ROOT . 'vendor/autoload.php')) {
|
||||
throw new \Exception('Autoloader not found, did you run composer install?');
|
||||
throw new Exception('Autoloader not found, did you run composer install?');
|
||||
}
|
||||
|
||||
// Require composer libraries
|
||||
|
@ -87,9 +87,10 @@ Router::init();
|
|||
include_once ROOT . 'routes.php';
|
||||
|
||||
// Initialise the current session
|
||||
$cookiePrefix = Config::get('cookie_prefix');
|
||||
ActiveUser::init(
|
||||
intval($_COOKIE[Config::get('cookie_prefix') . 'id'] ?? 0),
|
||||
$_COOKIE[Config::get('cookie_prefix') . 'session'] ?? ''
|
||||
intval($_COOKIE["{$cookiePrefix}id"] ?? 0),
|
||||
$_COOKIE["{$cookiePrefix}session"] ?? ''
|
||||
);
|
||||
|
||||
if (!defined('SAKURA_NO_TPL')) {
|
||||
|
@ -98,32 +99,11 @@ if (!defined('SAKURA_NO_TPL')) {
|
|||
|
||||
// Set base page rendering data
|
||||
Template::vars([
|
||||
'sakura' => [
|
||||
'currentPage' => $_SERVER['REQUEST_URI'] ?? null,
|
||||
'referrer' => $_SERVER['HTTP_REFERER'] ?? null,
|
||||
],
|
||||
|
||||
'session' => array_merge([
|
||||
'sessionId' => ActiveUser::$session->sessionId,
|
||||
], $_SESSION),
|
||||
|
||||
'user' => ActiveUser::$user,
|
||||
|
||||
'get' => $_GET,
|
||||
'user' => ActiveUser::$user,
|
||||
'post' => $_POST,
|
||||
'request' => $_REQUEST,
|
||||
'server' => $_SERVER,
|
||||
'request' => $_REQUEST,
|
||||
'session' => $_SESSION,
|
||||
]);
|
||||
|
||||
// Site closing
|
||||
if (Config::get('site_closed')) {
|
||||
// Set parse variables
|
||||
Template::vars([
|
||||
'message' => Config::get('site_closed_reason'),
|
||||
]);
|
||||
|
||||
// Print page contents
|
||||
echo Template::render('global/information');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
<li><a href="{{ urls.format('SETTING_CAT', ['messages']) }}">Private Messages</a></li>
|
||||
<li><a href="{{ urls.format('SETTINGS_INDEX') }}">User Settings</a></li>
|
||||
<li><a href="{{ urls.format('MANAGE_INDEX') }}">Site Management</a></li>
|
||||
<li><a href="{{ urls.format('USER_LOGOUT', [date().timestamp, session_id(), sakura.currentPage]) }}">Logout</a></li>
|
||||
<li><a href="{{ urls.format('USER_LOGOUT', [date().timestamp, session_id(), server['REQUEST_URI']]) }}">Logout</a></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
<li class="edit"><a title="Edit your profile" href="{{ urls.format('SETTING_MODE', ['general', 'profile']) }}">Edit</a></li>
|
||||
<li class="settings"><a title="Change your settings" href="{{ urls.format('SETTINGS_INDEX') }}">Settings</a></li>
|
||||
{% else %}
|
||||
<li class="{% if user.checkFriends(profile.id) == 2 %}mutualFriend{% elseif user.checkFriends(profile.id) == 1 %}pendingFriend{% else %}addFriend{% endif %}"><a href="{% if user.checkFriends(profile.id) == 0 %}{{ urls.format('FRIEND_ADD', [profile.id, session_id(), date().timestamp, sakura.currentPage]) }}{% else %}{{ urls.format('FRIEND_REMOVE', [profile.id, session_id(), date().timestamp, sakura.currentPage]) }}{% endif %}">{% if user.checkFriends(profile.id) == 0 %}Add friend{% else %}Friends{% endif %}</a></li>
|
||||
<li class="{% if user.checkFriends(profile.id) == 2 %}mutualFriend{% elseif user.checkFriends(profile.id) == 1 %}pendingFriend{% else %}addFriend{% endif %}"><a href="{% if user.checkFriends(profile.id) == 0 %}{{ urls.format('FRIEND_ADD', [profile.id, session_id(), date().timestamp, server['REQUEST_URI']]) }}{% else %}{{ urls.format('FRIEND_REMOVE', [profile.id, session_id(), date().timestamp, server['REQUEST_URI']]) }}{% endif %}">{% if user.checkFriends(profile.id) == 0 %}Add friend{% else %}Friends{% endif %}</a></li>
|
||||
<li class="report"><a href="{{ route('user.report', profile.id) }}">Report</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<form enctype="multipart/form-data" method="post" action="{{ sakura.currentPage }}" class="box">
|
||||
<form enctype="multipart/form-data" method="post" action="{{ server['REQUEST_URI'] }}" class="box">
|
||||
<input type="hidden" name="sessid" value="{{ session_id() }}" />
|
||||
<input type="hidden" name="timestamp" value="{{ date().timestamp }}" />
|
||||
<input type="hidden" name="mode" value="options" />
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
Login
|
||||
</div>
|
||||
<form method="post" action="{{ route('auth.login') }}" id="loginForm">
|
||||
<input type="hidden" name="redirect" value="{{ sakura.referrer ? sakura.referrer : route('main.index') }}" />
|
||||
<input type="hidden" name="session" value="{{ session_id() }}" />
|
||||
<input type="hidden" name="redirect" value="{{ server['HTTP_REFERER'] ? server['HTTP_REFERER'] : route('main.index') }}" />
|
||||
<div class="leftAlign">
|
||||
<label for="loginUserName">Username:</label>
|
||||
</div>
|
||||
|
@ -30,7 +29,7 @@
|
|||
<input class="inputStyling" name="remember" type="checkbox" class="ignore-css" id="loginRemember" /><label for="loginRemember">Remember Me</a>
|
||||
</div>
|
||||
<div class="centreAlign">
|
||||
<button class="inputStyling" id="loginButton"><i class="fa fa-sign-in"></i> Login</button>
|
||||
<button class="inputStyling" id="loginButton" name="session" value="{{ session_id() }}"><i class="fa fa-sign-in"></i> Login</button>
|
||||
</div>
|
||||
<div class="subLinks centreAlign" style="line-height: 1.5em;">
|
||||
<p><a href="{{ route('auth.register') }}" class="default">I don't have an account yet!</a></p>
|
||||
|
|
|
@ -10,21 +10,6 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% if config('lock_authentication') %}
|
||||
<div class="head">Whoops!</div>
|
||||
You caught the site at the wrong moment! Right now registration <i>and</i> logging in is disabled for unspecified reasons. Sorry for the inconvenience but please try again later!
|
||||
<div class="indexSidePanelLinks">
|
||||
<a class="fa fa-lock" href="#" title="Authentication is locked"></a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="head">Welcome!</div>
|
||||
Welcome to Flashii! This is a site for a bunch of friends to hang out, nothing special. Anyone is pretty much welcome to register so why not have a go?
|
||||
<div class="indexSidePanelLinks">
|
||||
<a class="fa fa-magic" href="{{ route('auth.register') }}" title="Register" id="indexSidePanelRegister"></a>
|
||||
<a class="fa fa-sign-in" href="{{ route('auth.login') }}" title="Login" id="indexSidePanelLogin"></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div class="head">Stats</div>
|
||||
We have <b>{{ stats.userCount }} user{% if stats.userCount != 1 %}s{% endif %}</b>,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<h1>{% block header %}Confirmation{% endblock %}</h1>
|
||||
<hr class="default" />
|
||||
{{ message }}
|
||||
<form method="post" action="{{ sakura.currentPage }}" id="confirmationForm">
|
||||
<form method="post" action="{{ server['REQUEST_URI'] }}" id="confirmationForm">
|
||||
<input type="hidden" name="sessionid" value="{{ session_id() }}" />
|
||||
<input type="hidden" name="timestamp" value="{{ date().timestamp }}" />
|
||||
{% for key,value in conditions %}
|
||||
|
|
28
templates/yuuno/global/maintenance.twig
Normal file
28
templates/yuuno/global/maintenance.twig
Normal file
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Service unavailable</title>
|
||||
<link rel="stylesheet" type="text/css" href="{{ resource('css/error.css') }}" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<h1>
|
||||
<img src="{{ resource('images/404-info.gif') }}" />
|
||||
The page is currently unavailable
|
||||
</h1>
|
||||
<p>
|
||||
The page you are looking for is temporarily unavailable.
|
||||
</p>
|
||||
<hr />
|
||||
<h2>
|
||||
{{ message }}
|
||||
</h2>
|
||||
<h3>
|
||||
HTTP 503 - Service unavailable
|
||||
<br />
|
||||
Internet Explorer
|
||||
</h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -111,13 +111,10 @@
|
|||
{% if profile is defined ? profile.background : (user.permission(constant('Sakura\\Perms\\Site::CHANGE_BACKGROUND')) and user.optionFields.profileBackgroundSiteWide and user.background) %}
|
||||
<div id="userBackground" style="background-image: url('{{ route('file.background', (profile is defined ? profile : user).id) }}');"></div>
|
||||
{% endif %}
|
||||
{% if not user.isActive and sakura.currentPage != route('auth.login') %}
|
||||
{% if not user.isActive and server['REQUEST_URI'] != route('auth.login') %}
|
||||
<div class="headerLoginContainer">
|
||||
<form method="post" action="{{ route('auth.login') }}" id="headerLoginForm">
|
||||
<input type="hidden" name="redirect" value="{{ sakura.currentPage }}" />
|
||||
<input type="hidden" name="session" value="{{ session_id() }}" />
|
||||
<input type="hidden" name="time" value="{{ date().timestamp }}" />
|
||||
<input type="hidden" name="mode" value="login" />
|
||||
<input type="hidden" name="redirect" value="{{ server['REQUEST_URI'] }}" />
|
||||
<div>
|
||||
<label for="headerLoginUserName">Username:</label>
|
||||
<input type="text" id="headerLoginUserName" name="username" class="inputStyling" placeholder="Username" />
|
||||
|
@ -131,12 +128,9 @@
|
|||
<label for="headerLoginRemember">Remember me</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="submit" id="headerLoginButton" name="submit" class="inputStyling small" value="Login" />
|
||||
<button class="inputStyling small" name="session" value="{{ session_id() }}"><i class="fa fa-sign-in"></i> Login</button>
|
||||
</div>
|
||||
</form>
|
||||
<form method="get" action="{{ route('auth.register') }}">
|
||||
<button class="inputStyling small">Register</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) %}
|
||||
|
|
|
@ -4,6 +4,15 @@
|
|||
|
||||
{% set persistentPremium = user.permission(constant('Sakura\\Perms\\Site::STATIC_PREMIUM')) %}
|
||||
|
||||
{% set features = {
|
||||
"money": "Helping us pay for the bills to survive",
|
||||
"certificate": "A <span style='font-weight: bold; color: #EE9400'>special</span> name colour to stand out in the crowd",
|
||||
"magic": "The ability to change your username once a month",
|
||||
"pencil": "You can set a custom user title",
|
||||
"lock": "Access to some exclusive forums",
|
||||
"picture-o": "You get the ability to set a profile background"
|
||||
} %}
|
||||
|
||||
{% block content %}
|
||||
{% if get.fail %}
|
||||
<div class="headerNotify">
|
||||
|
@ -14,7 +23,7 @@
|
|||
<div class="content support">
|
||||
<div class="head">Support {{ config('sitename') }}</div>
|
||||
<div style="font-size: .9em; margin-bottom: 10px;">
|
||||
<p>In order to keep the site, its services and improvements on it going I need money but I'm not that big of a fan of asking for money without giving anything special in return thus Tenshi exists. Tenshi is the name for our supporter rank which gives you access to an extra set of features (which are listed further down on this page). With your help we can keep adding new stuff, get new hardware and keep the site awesome!</p>
|
||||
<p>To keep the site and everything surrounding it running I need money to pay the bills, however instead of just having a donate button I decided on adding a premium system to the site which gives you a few extras. The premium rank is indentified on the site by Tenshi. More stuff that literally doesn't exist yet will be added to the list of featuring down the line but in order, the stuff that already exist can be seen further down on this page. With your help we can keep adding new stuff, get new hardware and keep the site awesome!</p>
|
||||
</div>
|
||||
{% if user.isPremium %}
|
||||
<div class="sectionHeader">
|
||||
|
@ -29,46 +38,13 @@
|
|||
Why should I get Tenshi?
|
||||
</div>
|
||||
<div class="featureParent">
|
||||
{% for k,v in features %}
|
||||
<div class="featureBox">
|
||||
<div class="featureBoxIcon fa fa-money"></div>
|
||||
<div class="featureBoxDesc">Helping us pay for the bills to survive</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="featureBox">
|
||||
<div class="featureBoxIcon fa fa-certificate"></div>
|
||||
<div class="featureBoxDesc">A <span style="font-weight: bold; color: #EE9400">special</span> name colour to stand out in the crowd</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="featureBox">
|
||||
<div class="featureBoxIcon fa fa-magic"></div>
|
||||
<div class="featureBoxDesc">The ability to change your username once a month</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="featureBox">
|
||||
<div class="featureBoxIcon fa fa-pencil"></div>
|
||||
<div class="featureBoxDesc">You can set a custom user title</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="featureBox">
|
||||
<div class="featureBoxIcon fa fa-archive"></div>
|
||||
<div class="featureBoxDesc">You'll be able to read the chat logs</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="featureBox">
|
||||
<div class="featureBoxIcon fa fa-eye-slash"></div>
|
||||
<div class="featureBoxDesc">You can create temporary channels in the chat</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="featureBox">
|
||||
<div class="featureBoxIcon fa fa-users"></div>
|
||||
<div class="featureBoxDesc">You get to create a user group</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="featureBox">
|
||||
<div class="featureBoxIcon fa fa-picture-o"></div>
|
||||
<div class="featureBoxDesc">You get the ability to set a profile background</div>
|
||||
<div class="featureBoxIcon fa fa-{{ k }}"></div>
|
||||
<div class="featureBoxDesc">{{ v|raw }}</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="featureBox final">
|
||||
<div class="featureBoxIcon fa fa-heart"></div>
|
||||
<div class="featureBoxIcon right fa fa-heart"></div>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<a href="{{ route('members.rank', rank.id) }}" class="clean">{{ rank.name }}</a>
|
||||
</td>
|
||||
<td style="width: 90px;">
|
||||
<form method="post" action="{{ sakura.currentPage }}">
|
||||
<form method="post" action="{{ route('settings.account.ranks') }}">
|
||||
<input type="hidden" name="session" value="{{ session_id() }}" />
|
||||
<input type="hidden" name="rank" value="{{ rank.id }}" />
|
||||
<button class="inputStyling small" name="mode" value="main">Set as main</button>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
</tfoot>
|
||||
<tbody>
|
||||
{% for s in sessions %}
|
||||
<tr {% if s.session_key == session.sessionId %} class="current-session"{% endif %}>
|
||||
<tr {% if s.session_key == active %} class="current-session"{% endif %}>
|
||||
<td>
|
||||
{{ s.user_ip }}
|
||||
</td>
|
||||
|
|
|
@ -75,6 +75,11 @@ function get_country_name($code)
|
|||
return 'Anonymous Proxy';
|
||||
}
|
||||
|
||||
// Catch proxy
|
||||
if (strtolower($code) === 'a2') {
|
||||
return 'Satellite Provider';
|
||||
}
|
||||
|
||||
return locale_get_display_region("-{$code}", 'en');
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue