r20151231, happy new year to whoever reads this!

This commit is contained in:
flash 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 same "printed page" as the copyright notice for easier
identification within third-party archives. 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"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with 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', 'username_clean' => 'user',
'password_hash' => '', 'password_hash' => '',
'password_salt' => '', 'password_salt' => '',
'password_algo' => 'nologin', 'password_algo' => 'disabled',
'password_iter' => 0, 'password_iter' => 0,
'password_chan' => 0, 'password_chan' => 0,
'email' => 'sakura@localhost', 'email' => 'sakura@localhost',
@ -818,8 +818,8 @@ class User
{ {
// Validate password // Validate password
switch ($this->data['password_algo']) { switch ($this->data['password_algo']) {
// Abyssing // Disabled account
case 'nologin': case 'disabled':
return [0, 'NO_LOGIN']; return [0, 'NO_LOGIN'];
// Default hashing method // Default hashing method

View file

@ -123,8 +123,8 @@ class Users
// Validate password // Validate password
switch ($user->password()['password_algo']) { switch ($user->password()['password_algo']) {
// Abyssing // Disabled
case 'nologin': case 'disabled':
return [0, 'NO_LOGIN']; return [0, 'NO_LOGIN'];
// Default hashing method // Default hashing method
@ -137,7 +137,6 @@ class Users
])) { ])) {
return [0, 'INCORRECT_PASSWORD', $user->id(), $user->password()['password_chan']]; return [0, 'INCORRECT_PASSWORD', $user->id(), $user->password()['password_chan']];
} }
} }
// Check if the user has the required privs to log in // 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 // Get the ID for the premium user rank from the database
$premiumRank = Config::get('premium_rank_id'); $premiumRank = Config::get('premium_rank_id');
$excepted = Config::get('restricted_rank_id');
// Create user object // Create user object
$user = User::construct($id); $user = User::construct($id);
@ -767,7 +767,7 @@ class Users
$check = $user->isPremium(); $check = $user->isPremium();
// Check if the user has premium // Check if the user has premium
if ($check[0]) { if ($check[0] && !in_array($excepted, $user->ranks())) {
// If so add the rank to them // If so add the rank to them
$user->addRanks([$premiumRank]); $user->addRanks([$premiumRank]);
@ -816,8 +816,7 @@ class Users
// Go over all users and check if they have the rank id // Go over all users and check if they have the rank id
foreach ($users as $user) { foreach ($users as $user) {
// If so store the user's row in the array // If so store the user's row in the array
if ($user->hasRanks([$rankId], $user->id()) if ($user->hasRanks([$rankId], $user->id())) {
&& ($excludeAbyss ? $user->password()['password_algo'] != 'nologin' : true)) {
$rank[] = $user; $rank[] = $user;
} }
} }
@ -837,11 +836,6 @@ class Users
// Reorder shit // Reorder shit
foreach ($getUsers as $user) { foreach ($getUsers as $user) {
// Skip abyss
if (!$includeAbyss && $user['password_algo'] == 'nologin') {
continue;
}
$user = User::construct($user['user_id']); $user = User::construct($user['user_id']);
// Skip if inactive and not include deactivated users // Skip if inactive and not include deactivated users
@ -947,6 +941,6 @@ class Users
// Get the ID of the newest user // Get the ID of the newest user
public static function getNewestUserId() 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 <?php
/* /*
* Sakura Community Management System * Sakura Community Management System
* (c) 2013-2015 Flashwave <http://flash.moe> * (c) 2013-2016 Flashwave <http://flash.moe>
*/ */
// Declare namespace // Declare namespace
namespace Sakura; namespace Sakura;
// Define Sakura version // Define Sakura version
define('SAKURA_VERSION', '20151229'); define('SAKURA_VERSION', '20151231');
define('SAKURA_VLABEL', 'Eminence'); define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_COLOUR', '#6C3082'); define('SAKURA_COLOUR', '#6C3082');

View file

@ -133,7 +133,7 @@
<div class="inner"> <div class="inner">
<div class="ft-logo"></div> <div class="ft-logo"></div>
<div class="ft-text"> <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><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>
</div> </div>

View file

@ -1,6 +1,6 @@
{% extends 'global/master.tpl' %} {% 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 %} {% set noUserpage = profile.userPage|length < 1 %}
@ -146,7 +146,9 @@
{% if profileHidden %} {% if profileHidden %}
<div class="standing" style="color: #444;">Unknown</div> <div class="standing" style="color: #444;">Unknown</div>
{% elseif profile.checkBan %} {% 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 %} {% else %}
{% if profile.getWarnings %} {% if profile.getWarnings %}
<div class="standing" style="color: #A22;">Bad</div> <div class="standing" style="color: #A22;">Bad</div>

View file

@ -167,7 +167,9 @@
{% if session.checkLogin %} {% 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 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-envelope" href="{{ urls.format('SETTING_CAT', ['messages']) }}" title="Messages"></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> <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-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> <a class="menu-item fa-sign-out" href="{{ urls.format('USER_LOGOUT', [php.time, php.sessionid, sakura.currentPage]) }}" title="Logout" id="headerLogoutLink"></a>
{% else %} {% else %}
@ -241,7 +243,7 @@
</div> </div>
<div class="footer"> <div class="footer">
<div class="ftsections"> <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"> <ul class="ftsection">
<li class="fthead">General</li> <li class="fthead">General</li>
<li><a href="{{ urls.format('SITE_HOME') }}" title="Flashii Frontpage">Home</a></li> <li><a href="{{ urls.format('SITE_HOME') }}" title="Flashii Frontpage">Home</a></li>

View file

@ -1,6 +1,6 @@
{% extends 'global/master.tpl' %} {% 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 %} {% set noUserpage = profile.userPage|length < 1 %}
@ -10,7 +10,8 @@
{% block content %} {% block content %}
{% if profileHidden %} {% if profileHidden %}
<div class="content standalone" style="padding: 20px;"> <div class="content standalone">
<div style="padding: 20px;">
<h1>The requested user does not exist!</h1> <h1>The requested user does not exist!</h1>
There are a few possible reasons for this: There are a few possible reasons for this:
<ul style="padding-left: 40px;"> <ul style="padding-left: 40px;">
@ -20,6 +21,7 @@
<li>They never existed.</li> <li>They never existed.</li>
</ul> </ul>
</div> </div>
</div>
{% else %} {% else %}
<div class="content profile"> <div class="content profile">
<div class="content-right content-column"> <div class="content-right content-column">