r20151231, happy new year to whoever reads this!

This commit is contained in:
Pachira 2015-12-31 15:51:01 +01:00
parent c30048a1cd
commit b5334b27a0
8 changed files with 34 additions and 34 deletions

View file

@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2015 Flashwave <http://flash.moe>
Copyright 2016 Julian van de Groep <https://flash.moe>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View file

@ -21,7 +21,7 @@ class User
'username_clean' => 'user',
'password_hash' => '',
'password_salt' => '',
'password_algo' => 'nologin',
'password_algo' => 'disabled',
'password_iter' => 0,
'password_chan' => 0,
'email' => 'sakura@localhost',
@ -818,8 +818,8 @@ class User
{
// Validate password
switch ($this->data['password_algo']) {
// Abyssing
case 'nologin':
// Disabled account
case 'disabled':
return [0, 'NO_LOGIN'];
// Default hashing method

View file

@ -123,8 +123,8 @@ class Users
// Validate password
switch ($user->password()['password_algo']) {
// Abyssing
case 'nologin':
// Disabled
case 'disabled':
return [0, 'NO_LOGIN'];
// Default hashing method
@ -137,7 +137,6 @@ class Users
])) {
return [0, 'INCORRECT_PASSWORD', $user->id(), $user->password()['password_chan']];
}
}
// Check if the user has the required privs to log in
@ -759,6 +758,7 @@ class Users
{
// Get the ID for the premium user rank from the database
$premiumRank = Config::get('premium_rank_id');
$excepted = Config::get('restricted_rank_id');
// Create user object
$user = User::construct($id);
@ -767,7 +767,7 @@ class Users
$check = $user->isPremium();
// Check if the user has premium
if ($check[0]) {
if ($check[0] && !in_array($excepted, $user->ranks())) {
// If so add the rank to them
$user->addRanks([$premiumRank]);
@ -816,8 +816,7 @@ class Users
// Go over all users and check if they have the rank id
foreach ($users as $user) {
// If so store the user's row in the array
if ($user->hasRanks([$rankId], $user->id())
&& ($excludeAbyss ? $user->password()['password_algo'] != 'nologin' : true)) {
if ($user->hasRanks([$rankId], $user->id())) {
$rank[] = $user;
}
}
@ -837,11 +836,6 @@ class Users
// Reorder shit
foreach ($getUsers as $user) {
// Skip abyss
if (!$includeAbyss && $user['password_algo'] == 'nologin') {
continue;
}
$user = User::construct($user['user_id']);
// Skip if inactive and not include deactivated users
@ -947,6 +941,6 @@ class Users
// Get the ID of the newest user
public static function getNewestUserId()
{
return Database::fetch('users', false, ['password_algo' => ['nologin', '!=']], ['user_id', true], ['1'])['user_id'];
return Database::fetch('users', false, ['rank_main' => [Config::get('restricted_rank_id'), '!=']], ['user_id', true], ['1'])['user_id'];
}
}

View file

@ -1,14 +1,14 @@
<?php
/*
* Sakura Community Management System
* (c) 2013-2015 Flashwave <http://flash.moe>
* (c) 2013-2016 Flashwave <http://flash.moe>
*/
// Declare namespace
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20151229');
define('SAKURA_VERSION', '20151231');
define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_COLOUR', '#6C3082');

View file

@ -133,7 +133,7 @@
<div class="inner">
<div class="ft-logo"></div>
<div class="ft-text">
<div>Powered by <a href="https://github.com/flashwave/sakura/" target="_blank">Sakura</a>, <a href="https://flash.moe/" target="_blank">Flashwave</a> 2013-2015</div>
<div>Powered by <a href="https://github.com/flashwave/sakura/" target="_blank">Sakura</a>, <a href="https://flash.moe/" target="_blank">Flashwave</a> 2013-2016</div>
<div><a href="{{ urls.format('INFO_PAGE', ['terms']) }}">Terms of Service</a> | <a href="{{ urls.format('INFO_PAGE', ['contact']) }}">Contact</a> | <a href="{{ urls.format('SITE_FAQ') }}">FAQ</a> | <a href="{{ urls.format('INFO_PAGE', ['rules']) }}">Rules</a> | <a href="https://sakura.flash.moe/">Changelog</a> | <a href="https://fiistat.us/">Status</a></div>
</div>
</div>

View file

@ -1,6 +1,6 @@
{% extends 'global/master.tpl' %}
{% set profileHidden = profile.permission(constant('Sakura\\Perms\\Site::DEACTIVATED')) or profile.password.password_algo == 'nologin' or (profile.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) and (user.id != profile.id and not user.permission(constant('Sakura\\Perms\\Manage::USE_MANAGE'), constant('Sakura\\Perms::MANAGE')))) %}
{% set profileHidden = profile.permission(constant('Sakura\\Perms\\Site::DEACTIVATED')) or (profile.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) and (user.id != profile.id and not user.permission(constant('Sakura\\Perms\\Manage::USE_MANAGE'), constant('Sakura\\Perms::MANAGE')))) %}
{% set noUserpage = profile.userPage|length < 1 %}
@ -146,7 +146,9 @@
{% if profileHidden %}
<div class="standing" style="color: #444;">Unknown</div>
{% elseif profile.checkBan %}
<h2 class="standing" style="color: #800;">Banned</h2>
<h2 class="standing" style="color: #811;">Banned</h2>
{% elseif profile.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) %}
<h2 class="standing" style="color: #811;">Restricted</h2>
{% else %}
{% if profile.getWarnings %}
<div class="standing" style="color: #A22;">Bad</div>

View file

@ -167,7 +167,9 @@
{% if session.checkLogin %}
<a class="menu-item avatar" href="{{ urls.format('USER_PROFILE', [user.id]) }}" title="Logged in as {{ user.username }}" style="background-image: url('{{ urls.format('IMAGE_AVATAR', [user.id]) }}'); width: auto; color: {{ user.colour }}; border-color: {{ user.colour }}; font-weight: 700;"></a>
<a class="menu-item fa-envelope" href="{{ urls.format('SETTING_CAT', ['messages']) }}" title="Messages"></a>
<a class="menu-item fa-gavel" href="{{ urls.format('MANAGE_INDEX') }}" title="Manage"></a>
{% if user.permission(constant('Sakura\\Perms\\Manage::USE_MANAGE'), constant('Sakura\\Perms::MANAGE')) %}
<a class="menu-item fa-gavel" href="{{ urls.format('MANAGE_INDEX') }}" title="Manage"></a>
{% endif %}
<a class="menu-item fa-cogs" href="{{ urls.format('SETTINGS_INDEX') }}" title="Settings"></a>
<a class="menu-item fa-sign-out" href="{{ urls.format('USER_LOGOUT', [php.time, php.sessionid, sakura.currentPage]) }}" title="Logout" id="headerLogoutLink"></a>
{% else %}
@ -232,7 +234,7 @@
{% block content %}
<h1 class="stylised" style="text-align: center; margin: 2em auto;">{{ php.self }} is now printing!</h1>
{% endblock %}
{#<div class="ad-container ad-footer" id="footerAd">
<div class="ad-box">
<img src="http://i.flash.moe/1445792838-522-8610.png" />
@ -241,7 +243,7 @@
</div>
<div class="footer">
<div class="ftsections">
<div class="copycentre">Powered by <a href="https://github.com/flashwave/sakura/" target="_blank">Sakura</a>{% if sakura.dev.showChangelog %} <a href="https://sakura.flash.moe/#r{{ sakura.versionInfo.version }}" target="_blank">r{{ sakura.versionInfo.version }}</a>{% endif %} &copy; 2013-2015 <a href="http://flash.moe/" target="_blank">Flashwave</a></div>
<div class="copycentre">Powered by <a href="https://github.com/flashwave/sakura/" target="_blank">Sakura</a>{% if sakura.dev.showChangelog %} <a href="https://sakura.flash.moe/#r{{ sakura.versionInfo.version }}" target="_blank">r{{ sakura.versionInfo.version }}</a>{% endif %} &copy; 2013-2016 <a href="http://flash.moe/" target="_blank">Flashwave</a></div>
<ul class="ftsection">
<li class="fthead">General</li>
<li><a href="{{ urls.format('SITE_HOME') }}" title="Flashii Frontpage">Home</a></li>

View file

@ -1,6 +1,6 @@
{% extends 'global/master.tpl' %}
{% set profileHidden = profile.permission(constant('Sakura\\Perms\\Site::DEACTIVATED')) or profile.password.password_algo == 'nologin' or (profile.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) and (user.id != profile.id and not user.permission(constant('Sakura\\Perms\\Manage::USE_MANAGE'), constant('Sakura\\Perms::MANAGE')))) %}
{% set profileHidden = profile.permission(constant('Sakura\\Perms\\Site::DEACTIVATED')) or (profile.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) and (user.id != profile.id and not user.permission(constant('Sakura\\Perms\\Manage::USE_MANAGE'), constant('Sakura\\Perms::MANAGE')))) %}
{% set noUserpage = profile.userPage|length < 1 %}
@ -10,15 +10,17 @@
{% block content %}
{% if profileHidden %}
<div class="content standalone" style="padding: 20px;">
<h1>The requested user does not exist!</h1>
There are a few possible reasons for this:
<ul style="padding-left: 40px;">
<li>They changed their username.</li>
<li>They may have been <a href="{{ urls.format('SITE_FAQ') }}#abyss" class="default">abyss'd</a>.</li>
<li>You made a typo.</li>
<li>They never existed.</li>
</ul>
<div class="content standalone">
<div style="padding: 20px;">
<h1>The requested user does not exist!</h1>
There are a few possible reasons for this:
<ul style="padding-left: 40px;">
<li>They changed their username.</li>
<li>They may have been <a href="{{ urls.format('SITE_FAQ') }}#abyss" class="default">abyss'd</a>.</li>
<li>You made a typo.</li>
<li>They never existed.</li>
</ul>
</div>
</div>
{% else %}
<div class="content profile">