r20151204
This commit is contained in:
parent
96afe1717b
commit
ba13f084b3
21 changed files with 197 additions and 204 deletions
|
@ -44,3 +44,9 @@ whoisservers = config/whois.json
|
||||||
|
|
||||||
; JSON file containing ISO 3166 country codes
|
; JSON file containing ISO 3166 country codes
|
||||||
iso3166 = config/iso3166.json
|
iso3166 = config/iso3166.json
|
||||||
|
|
||||||
|
|
||||||
|
; Development mode settings
|
||||||
|
[dev]
|
||||||
|
; Enable development mode
|
||||||
|
enable = true
|
||||||
|
|
|
@ -117,12 +117,12 @@ class Comments
|
||||||
{
|
{
|
||||||
|
|
||||||
// Check if the comment is long enough
|
// Check if the comment is long enough
|
||||||
if (strlen($content) < Config::getConfig('comment_min_length')) {
|
if (strlen($content) < Config::get('comment_min_length')) {
|
||||||
return [0, 'TOO_SHORT'];
|
return [0, 'TOO_SHORT'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the comment isn't too long
|
// Check if the comment isn't too long
|
||||||
if (strlen($content) > Config::getConfig('comment_max_length')) {
|
if (strlen($content) > Config::get('comment_max_length')) {
|
||||||
return [0, 'TOO_LONG'];
|
return [0, 'TOO_LONG'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ class Config
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get values from the configuration on the file system
|
// Get values from the configuration on the file system
|
||||||
public static function getLocalConfig($key, $subkey = null)
|
public static function local($key, $subkey = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Check if the key that we're looking for exists
|
// Check if the key that we're looking for exists
|
||||||
|
@ -83,38 +83,17 @@ class Config
|
||||||
'Unable to get local configuration value "' . $key . '"',
|
'Unable to get local configuration value "' . $key . '"',
|
||||||
E_USER_ERROR
|
E_USER_ERROR
|
||||||
);
|
);
|
||||||
}
|
return null;
|
||||||
|
|
||||||
// Dynamically set local configuration values, does not update the configuration file
|
|
||||||
public static function setLocalConfig($key, $subkey, $value)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Check if we also do a subkey
|
|
||||||
if ($subkey) {
|
|
||||||
// If we do we make sure that the parent key is an array
|
|
||||||
if (!isset(self::$local[$key])) {
|
|
||||||
self::$local[$key] = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
// And then assign the value
|
|
||||||
self::$local[$key][$subkey] = $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise we just straight up assign it
|
|
||||||
self::$local[$key] = $value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get values from the configuration in the database
|
// Get values from the configuration in the database
|
||||||
public static function getConfig($key, $returnNull = false)
|
public static function get($key, $returnNull = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Check if the key that we're looking for exists
|
// Check if the key that we're looking for exists
|
||||||
if (array_key_exists($key, self::$database)) {
|
if (array_key_exists($key, self::$database)) {
|
||||||
// Then return the value
|
// Then return the value
|
||||||
return self::$database[$key];
|
return self::$database[$key];
|
||||||
} elseif ($returnNull) {
|
|
||||||
// Avoid the error trigger if requested
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then return the value
|
// Then return the value
|
||||||
|
@ -122,5 +101,6 @@ class Config
|
||||||
'Unable to get configuration value "' . $key . '"',
|
'Unable to get configuration value "' . $key . '"',
|
||||||
E_USER_ERROR
|
E_USER_ERROR
|
||||||
);
|
);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,23 +31,23 @@ class mysql
|
||||||
// Initialise connection
|
// Initialise connection
|
||||||
$this->initConnect(
|
$this->initConnect(
|
||||||
(
|
(
|
||||||
Config::getLocalConfig('database', 'unixsocket') ?
|
Config::local('database', 'unixsocket') ?
|
||||||
$this->prepareSock(
|
$this->prepareSock(
|
||||||
Config::getLocalConfig('database', 'host'),
|
Config::local('database', 'host'),
|
||||||
Config::getLocalConfig('database', 'database')
|
Config::local('database', 'database')
|
||||||
) :
|
) :
|
||||||
$this->prepareHost(
|
$this->prepareHost(
|
||||||
Config::getLocalConfig('database', 'host'),
|
Config::local('database', 'host'),
|
||||||
Config::getLocalConfig('database', 'database'),
|
Config::local('database', 'database'),
|
||||||
(
|
(
|
||||||
Config::getLocalConfig('database', 'port') !== null ?
|
Config::local('database', 'port') !== null ?
|
||||||
Config::getLocalConfig('database', 'port') :
|
Config::local('database', 'port') :
|
||||||
3306
|
3306
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
Config::getLocalConfig('database', 'username'),
|
Config::local('database', 'username'),
|
||||||
Config::getLocalConfig('database', 'password')
|
Config::local('database', 'password')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class mysql
|
||||||
{
|
{
|
||||||
|
|
||||||
// Begin preparation of the statement
|
// Begin preparation of the statement
|
||||||
$prepare = 'SELECT ' . ($distinct ? 'DISTINCT ' : '') . ($column == '*' ? '' : '`') . $column . ($column == '*' ? '' : '`') . ' FROM `' . ($prefix ? $prefix : Config::getLocalConfig('database', 'prefix')) . $table . '`';
|
$prepare = 'SELECT ' . ($distinct ? 'DISTINCT ' : '') . ($column == '*' ? '' : '`') . $column . ($column == '*' ? '' : '`') . ' FROM `' . ($prefix ? $prefix : Config::local('database', 'prefix')) . $table . '`';
|
||||||
|
|
||||||
// If $data is set and is an array continue
|
// If $data is set and is an array continue
|
||||||
if (is_array($data)) {
|
if (is_array($data)) {
|
||||||
|
@ -200,7 +200,7 @@ class mysql
|
||||||
{
|
{
|
||||||
|
|
||||||
// Begin preparation of the statement
|
// Begin preparation of the statement
|
||||||
$prepare = 'INSERT INTO `' . ($prefix ? $prefix : Config::getLocalConfig('database', 'prefix')) . $table . '` ';
|
$prepare = 'INSERT INTO `' . ($prefix ? $prefix : Config::local('database', 'prefix')) . $table . '` ';
|
||||||
|
|
||||||
// Run the foreach statement twice for (`stuff`) VALUES (:stuff)
|
// Run the foreach statement twice for (`stuff`) VALUES (:stuff)
|
||||||
for ($i = 0; $i < 2; $i++) {
|
for ($i = 0; $i < 2; $i++) {
|
||||||
|
@ -241,7 +241,7 @@ class mysql
|
||||||
{
|
{
|
||||||
|
|
||||||
// Begin preparation of the statement
|
// Begin preparation of the statement
|
||||||
$prepare = 'UPDATE `' . ($prefix ? $prefix : Config::getLocalConfig('database', 'prefix')) . $table . '`';
|
$prepare = 'UPDATE `' . ($prefix ? $prefix : Config::local('database', 'prefix')) . $table . '`';
|
||||||
|
|
||||||
// Run a foreach on $data and complete the statement
|
// Run a foreach on $data and complete the statement
|
||||||
foreach ($data as $key => $values) {
|
foreach ($data as $key => $values) {
|
||||||
|
@ -294,7 +294,7 @@ class mysql
|
||||||
{
|
{
|
||||||
|
|
||||||
// Begin preparation of the statement
|
// Begin preparation of the statement
|
||||||
$prepare = 'DELETE FROM `' . ($prefix ? $prefix : Config::getLocalConfig('database', 'prefix')) . $table . '`';
|
$prepare = 'DELETE FROM `' . ($prefix ? $prefix : Config::local('database', 'prefix')) . $table . '`';
|
||||||
|
|
||||||
// If $data is set and is an array continue
|
// If $data is set and is an array continue
|
||||||
if (is_array($data)) {
|
if (is_array($data)) {
|
||||||
|
@ -333,7 +333,7 @@ class mysql
|
||||||
{
|
{
|
||||||
|
|
||||||
// Begin preparation of the statement
|
// Begin preparation of the statement
|
||||||
$prepare = 'SELECT COUNT(*) FROM `' . ($prefix ? $prefix : Config::getLocalConfig('database', 'prefix')) . $table . '`';
|
$prepare = 'SELECT COUNT(*) FROM `' . ($prefix ? $prefix : Config::local('database', 'prefix')) . $table . '`';
|
||||||
|
|
||||||
// If $data is set and is an array continue
|
// If $data is set and is an array continue
|
||||||
if (is_array($data)) {
|
if (is_array($data)) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Main
|
||||||
Config::init($config);
|
Config::init($config);
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
Database::init(Config::getLocalConfig('database', 'driver'));
|
Database::init(Config::local('database', 'driver'));
|
||||||
|
|
||||||
// "Dynamic" Configuration
|
// "Dynamic" Configuration
|
||||||
Config::initDB();
|
Config::initDB();
|
||||||
|
@ -70,7 +70,7 @@ class Main
|
||||||
// Attempt to get the response
|
// Attempt to get the response
|
||||||
$resp = @file_get_contents(
|
$resp = @file_get_contents(
|
||||||
'https://www.google.com/recaptcha/api/siteverify?secret='
|
'https://www.google.com/recaptcha/api/siteverify?secret='
|
||||||
. Config::getConfig('recaptcha_private')
|
. Config::get('recaptcha_private')
|
||||||
. '&response='
|
. '&response='
|
||||||
. $response
|
. $response
|
||||||
);
|
);
|
||||||
|
@ -160,6 +160,9 @@ class Main
|
||||||
die('An error occurred while executing the script.|1|javascript:alert("' . (isset($errid) ? 'Error Log ID: '. $errid : 'Failed to log.') . '");');
|
die('An error occurred while executing the script.|1|javascript:alert("' . (isset($errid) ? 'Error Log ID: '. $errid : 'Failed to log.') . '");');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for dev mode
|
||||||
|
$detailed = Config::local('dev', 'enable');
|
||||||
|
|
||||||
// Build page
|
// Build page
|
||||||
$errorPage = '<!DOCTYPE html>
|
$errorPage = '<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
@ -193,7 +196,7 @@ class Main
|
||||||
|
|
||||||
if (isset($errid)) {
|
if (isset($errid)) {
|
||||||
$errorPage .= '<p>The error and surrounding data has been logged.</p>
|
$errorPage .= '<p>The error and surrounding data has been logged.</p>
|
||||||
<h2>' . (SAKURA_STABLE ? 'Report the following text to a staff member' : 'Logged as') . '</h2>
|
<h2>' . ($detailed ? 'Report the following text to a staff member' : 'Logged as') . '</h2>
|
||||||
<pre class="error">' . $errid . '</pre>';
|
<pre class="error">' . $errid . '</pre>';
|
||||||
} else {
|
} else {
|
||||||
$errorPage .= '<p>Sakura was not able to log this error which could mean that there was an error
|
$errorPage .= '<p>Sakura was not able to log this error which could mean that there was an error
|
||||||
|
@ -202,7 +205,7 @@ class Main
|
||||||
know about this error if it occurs again.</p>';
|
know about this error if it occurs again.</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SAKURA_STABLE) {
|
if (!$detailed) {
|
||||||
$errorPage .= ' <h2>Summary</h2>
|
$errorPage .= ' <h2>Summary</h2>
|
||||||
<pre class="error">' . $error . '</pre>
|
<pre class="error">' . $error . '</pre>
|
||||||
<h2>Backtraces</h2>';
|
<h2>Backtraces</h2>';
|
||||||
|
@ -249,28 +252,28 @@ class Main
|
||||||
$mail->isSMTP();
|
$mail->isSMTP();
|
||||||
|
|
||||||
// Set the SMTP server host
|
// Set the SMTP server host
|
||||||
$mail->Host = Config::getConfig('smtp_server');
|
$mail->Host = Config::get('smtp_server');
|
||||||
|
|
||||||
// Do we require authentication?
|
// Do we require authentication?
|
||||||
$mail->SMTPAuth = Config::getConfig('smtp_auth');
|
$mail->SMTPAuth = Config::get('smtp_auth');
|
||||||
|
|
||||||
// Do we encrypt as well?
|
// Do we encrypt as well?
|
||||||
$mail->SMTPSecure = Config::getConfig('smtp_secure');
|
$mail->SMTPSecure = Config::get('smtp_secure');
|
||||||
|
|
||||||
// Set the port to the SMTP server
|
// Set the port to the SMTP server
|
||||||
$mail->Port = Config::getConfig('smtp_port');
|
$mail->Port = Config::get('smtp_port');
|
||||||
|
|
||||||
// If authentication is required log in as well
|
// If authentication is required log in as well
|
||||||
if (Config::getConfig('smtp_auth')) {
|
if (Config::get('smtp_auth')) {
|
||||||
$mail->Username = Config::getConfig('smtp_username');
|
$mail->Username = Config::get('smtp_username');
|
||||||
$mail->Password = base64_decode(Config::getConfig('smtp_password'));
|
$mail->Password = base64_decode(Config::get('smtp_password'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a reply-to header
|
// Add a reply-to header
|
||||||
$mail->addReplyTo(Config::getConfig('smtp_replyto_mail'), Config::getConfig('smtp_replyto_name'));
|
$mail->addReplyTo(Config::get('smtp_replyto_mail'), Config::get('smtp_replyto_name'));
|
||||||
|
|
||||||
// Set a from address as well
|
// Set a from address as well
|
||||||
$mail->setFrom(Config::getConfig('smtp_from_email'), Config::getConfig('smtp_from_name'));
|
$mail->setFrom(Config::get('smtp_from_email'), Config::get('smtp_from_name'));
|
||||||
|
|
||||||
// Set the addressee
|
// Set the addressee
|
||||||
foreach ($to as $email => $name) {
|
foreach ($to as $email => $name) {
|
||||||
|
@ -287,8 +290,8 @@ class Main
|
||||||
$htmlMail = file_get_contents(ROOT . 'templates/htmlEmail.tpl');
|
$htmlMail = file_get_contents(ROOT . 'templates/htmlEmail.tpl');
|
||||||
|
|
||||||
// Replace template tags
|
// Replace template tags
|
||||||
$htmlMail = str_replace('{{ sitename }}', Config::getConfig('sitename'), $htmlMail);
|
$htmlMail = str_replace('{{ sitename }}', Config::get('sitename'), $htmlMail);
|
||||||
$htmlMail = str_replace('{{ siteurl }}', '//' . Config::getConfig('url_main'), $htmlMail);
|
$htmlMail = str_replace('{{ siteurl }}', '//' . Config::get('url_main'), $htmlMail);
|
||||||
$htmlMail = str_replace('{{ contents }}', self::mdParse($body), $htmlMail);
|
$htmlMail = str_replace('{{ contents }}', self::mdParse($body), $htmlMail);
|
||||||
|
|
||||||
// Set HTML body
|
// Set HTML body
|
||||||
|
@ -317,7 +320,7 @@ class Main
|
||||||
{
|
{
|
||||||
|
|
||||||
// Run common sanitisation function over string
|
// Run common sanitisation function over string
|
||||||
$string = htmlentities($string, ENT_NOQUOTES | ENT_HTML401, Config::getConfig('charset'));
|
$string = htmlentities($string, ENT_NOQUOTES | ENT_HTML401, Config::get('charset'));
|
||||||
$string = stripslashes($string);
|
$string = stripslashes($string);
|
||||||
$string = strip_tags($string);
|
$string = strip_tags($string);
|
||||||
|
|
||||||
|
@ -454,7 +457,7 @@ class Main
|
||||||
|
|
||||||
// Get CloudFlare Subnet list
|
// Get CloudFlare Subnet list
|
||||||
$cfhosts = file_get_contents(
|
$cfhosts = file_get_contents(
|
||||||
ROOT . Config::getLocalConfig('data', 'cfipv' . (self::ipVersion($ip)))
|
ROOT . Config::local('data', 'cfipv' . (self::ipVersion($ip)))
|
||||||
);
|
);
|
||||||
|
|
||||||
// Replace \r\n with \n
|
// Replace \r\n with \n
|
||||||
|
@ -597,7 +600,7 @@ class Main
|
||||||
$iso3166 = json_decode(
|
$iso3166 = json_decode(
|
||||||
utf8_encode(
|
utf8_encode(
|
||||||
file_get_contents(
|
file_get_contents(
|
||||||
ROOT . Config::getLocalConfig('data', 'iso3166')
|
ROOT . Config::local('data', 'iso3166')
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
true
|
true
|
||||||
|
|
|
@ -32,8 +32,8 @@ class Payments
|
||||||
try {
|
try {
|
||||||
self::$paypal = new \PayPal\Rest\ApiContext(
|
self::$paypal = new \PayPal\Rest\ApiContext(
|
||||||
new \PayPal\Auth\OAuthTokenCredential(
|
new \PayPal\Auth\OAuthTokenCredential(
|
||||||
Config::getConfig('paypal_client_id'),
|
Config::get('paypal_client_id'),
|
||||||
Config::getConfig('paypal_secret')
|
Config::get('paypal_secret')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
|
@ -99,7 +99,7 @@ class Session
|
||||||
}
|
}
|
||||||
|
|
||||||
// IP Check
|
// IP Check
|
||||||
$ipCheck = Config::getConfig('session_check');
|
$ipCheck = Config::get('session_check');
|
||||||
|
|
||||||
// Origin checking
|
// Origin checking
|
||||||
if ($ipCheck) {
|
if ($ipCheck) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Template
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
// Set template to default
|
// Set template to default
|
||||||
$this->setTemplate(Config::getConfig('site_style'));
|
$this->setTemplate(Config::get('site_style'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a template name
|
// Set a template name
|
||||||
|
@ -59,7 +59,7 @@ class Template
|
||||||
$twigEnv = [];
|
$twigEnv = [];
|
||||||
|
|
||||||
// Enable caching
|
// Enable caching
|
||||||
if (Config::getConfig('enable_tpl_cache')) {
|
if (Config::get('enable_tpl_cache')) {
|
||||||
$twigEnv['cache'] = ROOT . 'cache/twig';
|
$twigEnv['cache'] = ROOT . 'cache/twig';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@ class Urls
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if mod_rewrite is enabled
|
// Check if mod_rewrite is enabled
|
||||||
$rewrite = ($rewrite === null ? Config::getConfig('url_rewrite') : $rewrite) ? 1 : 0;
|
$rewrite = ($rewrite === null ? Config::get('url_rewrite') : $rewrite) ? 1 : 0;
|
||||||
|
|
||||||
// Format urls
|
// Format urls
|
||||||
$formatted = vsprintf($this->urls[$lid][$rewrite], $args);
|
$formatted = vsprintf($this->urls[$lid][$rewrite], $args);
|
||||||
|
|
|
@ -179,7 +179,7 @@ class User
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise use the standard method
|
// Otherwise use the standard method
|
||||||
return $this->data['user_last_online'] > (time() - Config::getConfig('max_online_time'));
|
return $this->data['user_last_online'] > (time() - Config::get('max_online_time'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compatibility
|
// Compatibility
|
||||||
|
@ -686,19 +686,19 @@ class User
|
||||||
$username_clean = Main::cleanString($username, true);
|
$username_clean = Main::cleanString($username, true);
|
||||||
|
|
||||||
// Check if the username is too short
|
// Check if the username is too short
|
||||||
if (strlen($username_clean) < Config::getConfig('username_min_length')) {
|
if (strlen($username_clean) < Config::get('username_min_length')) {
|
||||||
return [0, 'TOO_SHORT'];
|
return [0, 'TOO_SHORT'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the username is too long
|
// Check if the username is too long
|
||||||
if (strlen($username_clean) > Config::getConfig('username_max_length')) {
|
if (strlen($username_clean) > Config::get('username_max_length')) {
|
||||||
return [0, 'TOO_LONG'];
|
return [0, 'TOO_LONG'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if this username hasn't been used in the last amount of days set in the config
|
// Check if this username hasn't been used in the last amount of days set in the config
|
||||||
$getOld = Database::fetch('username_history', false, [
|
$getOld = Database::fetch('username_history', false, [
|
||||||
'username_old_clean' => [$username_clean, '='],
|
'username_old_clean' => [$username_clean, '='],
|
||||||
'change_time' => [(Config::getConfig('old_username_reserve') * 24 * 60 * 60), '>'],
|
'change_time' => [(Config::get('old_username_reserve') * 24 * 60 * 60), '>'],
|
||||||
], ['change_id', true]);
|
], ['change_id', true]);
|
||||||
|
|
||||||
// Check if anything was returned
|
// Check if anything was returned
|
||||||
|
@ -796,7 +796,7 @@ class User
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check password entropy
|
// Check password entropy
|
||||||
if (Main::pwdEntropy($new) < Config::getConfig('min_entropy')) {
|
if (Main::pwdEntropy($new) < Config::get('min_entropy')) {
|
||||||
return [0, 'PASS_TOO_SHIT'];
|
return [0, 'PASS_TOO_SHIT'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,11 @@ class Users
|
||||||
public static function checkLogin($uid = null, $sid = null)
|
public static function checkLogin($uid = null, $sid = null)
|
||||||
{
|
{
|
||||||
// Assign $uid and $sid
|
// Assign $uid and $sid
|
||||||
$uid = $uid ? $uid : (isset($_COOKIE[Config::getConfig('cookie_prefix') . 'id'])
|
$uid = $uid ? $uid : (isset($_COOKIE[Config::get('cookie_prefix') . 'id'])
|
||||||
? $_COOKIE[Config::getConfig('cookie_prefix') . 'id']
|
? $_COOKIE[Config::get('cookie_prefix') . 'id']
|
||||||
: 0);
|
: 0);
|
||||||
$sid = $sid ? $sid : (isset($_COOKIE[Config::getConfig('cookie_prefix') . 'session'])
|
$sid = $sid ? $sid : (isset($_COOKIE[Config::get('cookie_prefix') . 'session'])
|
||||||
? $_COOKIE[Config::getConfig('cookie_prefix') . 'session']
|
? $_COOKIE[Config::get('cookie_prefix') . 'session']
|
||||||
: 0);
|
: 0);
|
||||||
|
|
||||||
// Get session
|
// Get session
|
||||||
|
@ -32,20 +32,20 @@ class Users
|
||||||
if ($sessionValid == 0 || Permissions::check('SITE', 'DEACTIVATED', $uid, 1)) {
|
if ($sessionValid == 0 || Permissions::check('SITE', 'DEACTIVATED', $uid, 1)) {
|
||||||
// Unset User ID
|
// Unset User ID
|
||||||
setcookie(
|
setcookie(
|
||||||
Config::getConfig('cookie_prefix') . 'id',
|
Config::get('cookie_prefix') . 'id',
|
||||||
0,
|
0,
|
||||||
time() - 60,
|
time() - 60,
|
||||||
Config::getConfig('cookie_path'),
|
Config::get('cookie_path'),
|
||||||
Config::getConfig('cookie_domain')
|
Config::get('cookie_domain')
|
||||||
);
|
);
|
||||||
|
|
||||||
// Unset Session ID
|
// Unset Session ID
|
||||||
setcookie(
|
setcookie(
|
||||||
Config::getConfig('cookie_prefix') . 'session',
|
Config::get('cookie_prefix') . 'session',
|
||||||
'',
|
'',
|
||||||
time() - 60,
|
time() - 60,
|
||||||
Config::getConfig('cookie_path'),
|
Config::get('cookie_path'),
|
||||||
Config::getConfig('cookie_domain')
|
Config::get('cookie_domain')
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -55,20 +55,20 @@ class Users
|
||||||
if ($sessionValid == 2) {
|
if ($sessionValid == 2) {
|
||||||
// User ID cookie
|
// User ID cookie
|
||||||
setcookie(
|
setcookie(
|
||||||
Config::getConfig('cookie_prefix') . 'id',
|
Config::get('cookie_prefix') . 'id',
|
||||||
$uid,
|
$uid,
|
||||||
time() + 604800,
|
time() + 604800,
|
||||||
Config::getConfig('cookie_path'),
|
Config::get('cookie_path'),
|
||||||
Config::getConfig('cookie_domain')
|
Config::get('cookie_domain')
|
||||||
);
|
);
|
||||||
|
|
||||||
// Session ID cookie
|
// Session ID cookie
|
||||||
setcookie(
|
setcookie(
|
||||||
Config::getConfig('cookie_prefix') . 'session',
|
Config::get('cookie_prefix') . 'session',
|
||||||
$sid,
|
$sid,
|
||||||
time() + 604800,
|
time() + 604800,
|
||||||
Config::getConfig('cookie_path'),
|
Config::get('cookie_path'),
|
||||||
Config::getConfig('cookie_domain')
|
Config::get('cookie_domain')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ class Users
|
||||||
public static function login($username, $password, $remember = false, $cookies = true)
|
public static function login($username, $password, $remember = false, $cookies = true)
|
||||||
{
|
{
|
||||||
// Check if authentication is disallowed
|
// Check if authentication is disallowed
|
||||||
if (Config::getConfig('lock_authentication')) {
|
if (Config::get('lock_authentication')) {
|
||||||
return [0, 'AUTH_LOCKED'];
|
return [0, 'AUTH_LOCKED'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,20 +150,20 @@ class Users
|
||||||
if ($cookies) {
|
if ($cookies) {
|
||||||
// User ID cookie
|
// User ID cookie
|
||||||
setcookie(
|
setcookie(
|
||||||
Config::getConfig('cookie_prefix') . 'id',
|
Config::get('cookie_prefix') . 'id',
|
||||||
$user->id(),
|
$user->id(),
|
||||||
time() + 604800,
|
time() + 604800,
|
||||||
Config::getConfig('cookie_path'),
|
Config::get('cookie_path'),
|
||||||
Config::getConfig('cookie_domain')
|
Config::get('cookie_domain')
|
||||||
);
|
);
|
||||||
|
|
||||||
// Session ID cookie
|
// Session ID cookie
|
||||||
setcookie(
|
setcookie(
|
||||||
Config::getConfig('cookie_prefix') . 'session',
|
Config::get('cookie_prefix') . 'session',
|
||||||
$sessionKey,
|
$sessionKey,
|
||||||
time() + 604800,
|
time() + 604800,
|
||||||
Config::getConfig('cookie_path'),
|
Config::get('cookie_path'),
|
||||||
Config::getConfig('cookie_domain')
|
Config::get('cookie_domain')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,20 +184,20 @@ class Users
|
||||||
|
|
||||||
// Unset User ID
|
// Unset User ID
|
||||||
setcookie(
|
setcookie(
|
||||||
Config::getConfig('cookie_prefix') . 'id',
|
Config::get('cookie_prefix') . 'id',
|
||||||
0,
|
0,
|
||||||
time() - 60,
|
time() - 60,
|
||||||
Config::getConfig('cookie_path'),
|
Config::get('cookie_path'),
|
||||||
Config::getConfig('cookie_domain')
|
Config::get('cookie_domain')
|
||||||
);
|
);
|
||||||
|
|
||||||
// Unset Session ID
|
// Unset Session ID
|
||||||
setcookie(
|
setcookie(
|
||||||
Config::getConfig('cookie_prefix') . 'session',
|
Config::get('cookie_prefix') . 'session',
|
||||||
'',
|
'',
|
||||||
time() - 60,
|
time() - 60,
|
||||||
Config::getConfig('cookie_path'),
|
Config::get('cookie_path'),
|
||||||
Config::getConfig('cookie_domain')
|
Config::get('cookie_domain')
|
||||||
);
|
);
|
||||||
|
|
||||||
// Return true indicating a successful logout
|
// Return true indicating a successful logout
|
||||||
|
@ -208,17 +208,17 @@ class Users
|
||||||
public static function register($username, $password, $confirmpass, $email, $tos, $captcha = null, $regkey = null)
|
public static function register($username, $password, $confirmpass, $email, $tos, $captcha = null, $regkey = null)
|
||||||
{
|
{
|
||||||
// Check if authentication is disallowed
|
// Check if authentication is disallowed
|
||||||
if (Config::getConfig('lock_authentication')) {
|
if (Config::get('lock_authentication')) {
|
||||||
return [0, 'AUTH_LOCKED'];
|
return [0, 'AUTH_LOCKED'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if registration is even enabled
|
// Check if registration is even enabled
|
||||||
if (Config::getConfig('disable_registration')) {
|
if (Config::get('disable_registration')) {
|
||||||
return [0, 'DISABLED'];
|
return [0, 'DISABLED'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if registration codes are required
|
// Check if registration codes are required
|
||||||
if (Config::getConfig('require_registration_code')) {
|
if (Config::get('require_registration_code')) {
|
||||||
// Check if the code is valid
|
// Check if the code is valid
|
||||||
if (!self::checkRegistrationCode($regkey)) {
|
if (!self::checkRegistrationCode($regkey)) {
|
||||||
return [0, 'INVALID_REG_KEY'];
|
return [0, 'INVALID_REG_KEY'];
|
||||||
|
@ -231,7 +231,7 @@ class Users
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify the captcha if it's enabled
|
// Verify the captcha if it's enabled
|
||||||
if (Config::getConfig('recaptcha')) {
|
if (Config::get('recaptcha')) {
|
||||||
if (!Main::verifyCaptcha($captcha)['success']) {
|
if (!Main::verifyCaptcha($captcha)['success']) {
|
||||||
return [0, 'CAPTCHA_FAIL'];
|
return [0, 'CAPTCHA_FAIL'];
|
||||||
}
|
}
|
||||||
|
@ -243,12 +243,12 @@ class Users
|
||||||
}
|
}
|
||||||
|
|
||||||
// Username too short
|
// Username too short
|
||||||
if (strlen($username) < Config::getConfig('username_min_length')) {
|
if (strlen($username) < Config::get('username_min_length')) {
|
||||||
return [0, 'NAME_TOO_SHORT'];
|
return [0, 'NAME_TOO_SHORT'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Username too long
|
// Username too long
|
||||||
if (strlen($username) > Config::getConfig('username_max_length')) {
|
if (strlen($username) > Config::get('username_max_length')) {
|
||||||
return [0, 'NAME_TOO_LONG'];
|
return [0, 'NAME_TOO_LONG'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ class Users
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check password entropy
|
// Check password entropy
|
||||||
if (Main::pwdEntropy($password) < Config::getConfig('min_entropy')) {
|
if (Main::pwdEntropy($password) < Config::get('min_entropy')) {
|
||||||
return [0, 'PASS_TOO_SHIT'];
|
return [0, 'PASS_TOO_SHIT'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ class Users
|
||||||
$usernameClean = Main::cleanString($username, true);
|
$usernameClean = Main::cleanString($username, true);
|
||||||
$emailClean = Main::cleanString($email, true);
|
$emailClean = Main::cleanString($email, true);
|
||||||
$password = Hashing::createHash($password);
|
$password = Hashing::createHash($password);
|
||||||
$requireActive = Config::getConfig('require_activation');
|
$requireActive = Config::get('require_activation');
|
||||||
$userRank = $requireActive ? [1] : [2];
|
$userRank = $requireActive ? [1] : [2];
|
||||||
$userRankJson = json_encode($userRank);
|
$userRankJson = json_encode($userRank);
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ class Users
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if registration codes are required
|
// Check if registration codes are required
|
||||||
if (Config::getConfig('require_registration_code')) {
|
if (Config::get('require_registration_code')) {
|
||||||
// If we do mark the registration code that was used as used
|
// If we do mark the registration code that was used as used
|
||||||
self::markRegistrationCodeUsed($regkey, $uid);
|
self::markRegistrationCodeUsed($regkey, $uid);
|
||||||
}
|
}
|
||||||
|
@ -322,7 +322,7 @@ class Users
|
||||||
public static function sendPasswordForgot($username, $email)
|
public static function sendPasswordForgot($username, $email)
|
||||||
{
|
{
|
||||||
// Check if authentication is disallowed
|
// Check if authentication is disallowed
|
||||||
if (Config::getConfig('lock_authentication')) {
|
if (Config::get('lock_authentication')) {
|
||||||
return [0, 'AUTH_LOCKED'];
|
return [0, 'AUTH_LOCKED'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,17 +358,17 @@ class Users
|
||||||
|
|
||||||
// Build the e-mail
|
// Build the e-mail
|
||||||
$message = "Hello " . $user['username'] . ",\r\n\r\n";
|
$message = "Hello " . $user['username'] . ",\r\n\r\n";
|
||||||
$message .= "You are receiving this notification because you have (or someone pretending to be you has) requested a password reset link to be sent for your account on \"" . Config::getConfig('sitename') . "\". If you did not request this notification then please ignore it, if you keep receiving it please contact the site administrator.\r\n\r\n";
|
$message .= "You are receiving this notification because you have (or someone pretending to be you has) requested a password reset link to be sent for your account on \"" . Config::get('sitename') . "\". If you did not request this notification then please ignore it, if you keep receiving it please contact the site administrator.\r\n\r\n";
|
||||||
$message .= "To use this password reset key you need to go to a special page. To do this click the link provided below.\r\n\r\n";
|
$message .= "To use this password reset key you need to go to a special page. To do this click the link provided below.\r\n\r\n";
|
||||||
$message .= "http://" . Config::getConfig('url_main') . $urls->format('SITE_FORGOT_PASSWORD') . "?pw=true&uid=" . $user['user_id'] . "&key=" . $verk . "\r\n\r\n";
|
$message .= "http://" . Config::get('url_main') . $urls->format('SITE_FORGOT_PASSWORD') . "?pw=true&uid=" . $user['user_id'] . "&key=" . $verk . "\r\n\r\n";
|
||||||
$message .= "If successful you should be able to change your password here.\r\n\r\n";
|
$message .= "If successful you should be able to change your password here.\r\n\r\n";
|
||||||
$message .= "Alternatively if the above method fails for some reason you can go to http://" . Config::getConfig('url_main') . $urls->format('SITE_FORGOT_PASSWORD') . "?pw=true&uid=" . $user['user_id'] . " and use the key listed below:\r\n\r\n";
|
$message .= "Alternatively if the above method fails for some reason you can go to http://" . Config::get('url_main') . $urls->format('SITE_FORGOT_PASSWORD') . "?pw=true&uid=" . $user['user_id'] . " and use the key listed below:\r\n\r\n";
|
||||||
$message .= "Verification key: " . $verk . "\r\n\r\n";
|
$message .= "Verification key: " . $verk . "\r\n\r\n";
|
||||||
$message .= "You can of course change this password yourself via the profile page. If you have any difficulties please contact the site administrator.\r\n\r\n";
|
$message .= "You can of course change this password yourself via the profile page. If you have any difficulties please contact the site administrator.\r\n\r\n";
|
||||||
$message .= "--\r\n\r\nThanks\r\n\r\n" . Config::getConfig('mail_signature');
|
$message .= "--\r\n\r\nThanks\r\n\r\n" . Config::get('mail_signature');
|
||||||
|
|
||||||
// Send the message
|
// Send the message
|
||||||
Main::sendMail([$user['email'] => $user['username']], Config::getConfig('sitename') . ' password restoration', $message);
|
Main::sendMail([$user['email'] => $user['username']], Config::get('sitename') . ' password restoration', $message);
|
||||||
|
|
||||||
// Return success
|
// Return success
|
||||||
return [1, 'SUCCESS'];
|
return [1, 'SUCCESS'];
|
||||||
|
@ -378,12 +378,12 @@ class Users
|
||||||
public static function resetPassword($verk, $uid, $newpass, $verpass)
|
public static function resetPassword($verk, $uid, $newpass, $verpass)
|
||||||
{
|
{
|
||||||
// Check if authentication is disallowed
|
// Check if authentication is disallowed
|
||||||
if (Config::getConfig('lock_authentication')) {
|
if (Config::get('lock_authentication')) {
|
||||||
return [0, 'AUTH_LOCKED'];
|
return [0, 'AUTH_LOCKED'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check password entropy
|
// Check password entropy
|
||||||
if (Main::pwdEntropy($newpass) < Config::getConfig('min_entropy')) {
|
if (Main::pwdEntropy($newpass) < Config::get('min_entropy')) {
|
||||||
return [0, 'PASS_TOO_SHIT'];
|
return [0, 'PASS_TOO_SHIT'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +426,7 @@ class Users
|
||||||
public static function resendActivationMail($username, $email)
|
public static function resendActivationMail($username, $email)
|
||||||
{
|
{
|
||||||
// Check if authentication is disallowed
|
// Check if authentication is disallowed
|
||||||
if (Config::getConfig('lock_authentication')) {
|
if (Config::get('lock_authentication')) {
|
||||||
return [0, 'AUTH_LOCKED'];
|
return [0, 'AUTH_LOCKED'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,25 +481,25 @@ class Users
|
||||||
$urls = new Urls();
|
$urls = new Urls();
|
||||||
|
|
||||||
// Build the e-mail
|
// Build the e-mail
|
||||||
$message = "Welcome to " . Config::getConfig('sitename') . "!\r\n\r\n";
|
$message = "Welcome to " . Config::get('sitename') . "!\r\n\r\n";
|
||||||
$message .= "Please keep this e-mail for your records. Your account intormation is as follows:\r\n\r\n";
|
$message .= "Please keep this e-mail for your records. Your account intormation is as follows:\r\n\r\n";
|
||||||
$message .= "----------------------------\r\n\r\n";
|
$message .= "----------------------------\r\n\r\n";
|
||||||
$message .= "Username: " . $user['username'] . "\r\n\r\n";
|
$message .= "Username: " . $user['username'] . "\r\n\r\n";
|
||||||
$message .= "Your profile: http://" . Config::getConfig('url_main') . $urls->format('USER_PROFILE', [$user['user_id']]) . "\r\n\r\n";
|
$message .= "Your profile: http://" . Config::get('url_main') . $urls->format('USER_PROFILE', [$user['user_id']]) . "\r\n\r\n";
|
||||||
$message .= "----------------------------\r\n\r\n";
|
$message .= "----------------------------\r\n\r\n";
|
||||||
$message .= "Please visit the following link in order to activate your account:\r\n\r\n";
|
$message .= "Please visit the following link in order to activate your account:\r\n\r\n";
|
||||||
$message .= "http://" . Config::getConfig('url_main') . $urls->format('SITE_ACTIVATE') . "?mode=activate&u=" . $user['user_id'] . "&k=" . $activate . "\r\n\r\n";
|
$message .= "http://" . Config::get('url_main') . $urls->format('SITE_ACTIVATE') . "?mode=activate&u=" . $user['user_id'] . "&k=" . $activate . "\r\n\r\n";
|
||||||
$message .= "Your password has been securely stored in our database and cannot be retrieved. ";
|
$message .= "Your password has been securely stored in our database and cannot be retrieved. ";
|
||||||
$message .= "In the event that it is forgotten, you will be able to reset it using the email address associated with your account.\r\n\r\n";
|
$message .= "In the event that it is forgotten, you will be able to reset it using the email address associated with your account.\r\n\r\n";
|
||||||
$message .= "Thank you for registering.\r\n\r\n";
|
$message .= "Thank you for registering.\r\n\r\n";
|
||||||
$message .= "--\r\n\r\nThanks\r\n\r\n" . Config::getConfig('mail_signature');
|
$message .= "--\r\n\r\nThanks\r\n\r\n" . Config::get('mail_signature');
|
||||||
|
|
||||||
// Send the message
|
// Send the message
|
||||||
Main::sendMail(
|
Main::sendMail(
|
||||||
[
|
[
|
||||||
$user['email'] => $user['username'],
|
$user['email'] => $user['username'],
|
||||||
],
|
],
|
||||||
Config::getConfig('sitename') . ' Activation Mail',
|
Config::get('sitename') . ' Activation Mail',
|
||||||
$message
|
$message
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -605,7 +605,7 @@ class Users
|
||||||
'regcodes',
|
'regcodes',
|
||||||
true,
|
true,
|
||||||
['uid' => [$userId, '=']]
|
['uid' => [$userId, '=']]
|
||||||
)[0] >= Config::getConfig('max_reg_keys')) {
|
)[0] >= Config::get('max_reg_keys')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -693,7 +693,7 @@ class Users
|
||||||
public static function checkAllOnline()
|
public static function checkAllOnline()
|
||||||
{
|
{
|
||||||
// Assign time - 500 to a variable
|
// Assign time - 500 to a variable
|
||||||
$time = time() - Config::getConfig('max_online_time');
|
$time = time() - Config::get('max_online_time');
|
||||||
|
|
||||||
$return = [];
|
$return = [];
|
||||||
|
|
||||||
|
@ -746,7 +746,7 @@ class Users
|
||||||
public static function updatePremiumMeta($id)
|
public static function updatePremiumMeta($id)
|
||||||
{
|
{
|
||||||
// Get the ID for the premium user rank from the database
|
// Get the ID for the premium user rank from the database
|
||||||
$premiumRank = Config::getConfig('premium_rank_id');
|
$premiumRank = Config::get('premium_rank_id');
|
||||||
|
|
||||||
// Create user object
|
// Create user object
|
||||||
$user = new User($id);
|
$user = new User($id);
|
||||||
|
|
|
@ -38,7 +38,6 @@ RewriteRule ^members/?$ members.php [L,QSA]
|
||||||
RewriteRule ^members/([a-z]+)/?$ members.php?sort=$1 [L,QSA]
|
RewriteRule ^members/([a-z]+)/?$ members.php?sort=$1 [L,QSA]
|
||||||
RewriteRule ^members/([0-9]+)/?$ members.php?rank=$1 [L,QSA]
|
RewriteRule ^members/([0-9]+)/?$ members.php?rank=$1 [L,QSA]
|
||||||
RewriteRule ^members/([a-z]+)/([0-9]+)/?$ members.php?sort=$1&rank=$2 [L,QSA]
|
RewriteRule ^members/([a-z]+)/([0-9]+)/?$ members.php?sort=$1&rank=$2 [L,QSA]
|
||||||
RewriteRule ^members/([0-9]+)/p([0-9]+)/?$ members.php?rank=$1&page=$2 [L,QSA]
|
|
||||||
|
|
||||||
# Profiles
|
# Profiles
|
||||||
RewriteRule ^u/?$ profile.php [L,QSA]
|
RewriteRule ^u/?$ profile.php [L,QSA]
|
||||||
|
|
|
@ -220,12 +220,12 @@ if (isset($_REQUEST['mode'])) {
|
||||||
$_REQUEST['email'],
|
$_REQUEST['email'],
|
||||||
isset($_REQUEST['tos']),
|
isset($_REQUEST['tos']),
|
||||||
(
|
(
|
||||||
Config::getConfig('recaptcha') ?
|
Config::get('recaptcha') ?
|
||||||
$_REQUEST['g-recaptcha-response'] :
|
$_REQUEST['g-recaptcha-response'] :
|
||||||
null
|
null
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
Config::getConfig('require_registration_code') ?
|
Config::get('require_registration_code') ?
|
||||||
$_REQUEST['registercode'] :
|
$_REQUEST['registercode'] :
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
|
@ -247,7 +247,7 @@ if (isset($_REQUEST['mode'])) {
|
||||||
'INVALID_EMAIL' => 'Your e-mail address is formatted incorrectly.',
|
'INVALID_EMAIL' => 'Your e-mail address is formatted incorrectly.',
|
||||||
'INVALID_MX' => 'No valid MX-Record found on the e-mail address you supplied.',
|
'INVALID_MX' => 'No valid MX-Record found on the e-mail address you supplied.',
|
||||||
'EMAILSENT' => 'Your registration went through! An activation e-mail has been sent.',
|
'EMAILSENT' => 'Your registration went through! An activation e-mail has been sent.',
|
||||||
'SUCCESS' => 'Your registration went through! Welcome to ' . Config::getConfig('sitename') . '!',
|
'SUCCESS' => 'Your registration went through! Welcome to ' . Config::get('sitename') . '!',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ define('SAKURA_NO_TPL', true);
|
||||||
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . 'sakura.php';
|
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . 'sakura.php';
|
||||||
|
|
||||||
// Path to user uploads
|
// Path to user uploads
|
||||||
$userDirPath = ROOT . Config::getConfig('user_uploads') . '/';
|
$userDirPath = ROOT . Config::get('user_uploads') . '/';
|
||||||
|
|
||||||
// Check if the m(ode) GET request is set
|
// Check if the m(ode) GET request is set
|
||||||
if (isset($_GET['m'])) {
|
if (isset($_GET['m'])) {
|
||||||
|
@ -23,17 +23,17 @@ if (isset($_GET['m'])) {
|
||||||
$noAvatar = ROOT . str_replace(
|
$noAvatar = ROOT . str_replace(
|
||||||
'{{ TPL }}',
|
'{{ TPL }}',
|
||||||
$templateName,
|
$templateName,
|
||||||
Config::getConfig('no_avatar_img')
|
Config::get('no_avatar_img')
|
||||||
);
|
);
|
||||||
$deactiveAvatar = ROOT . str_replace(
|
$deactiveAvatar = ROOT . str_replace(
|
||||||
'{{ TPL }}',
|
'{{ TPL }}',
|
||||||
$templateName,
|
$templateName,
|
||||||
Config::getConfig('deactivated_avatar_img')
|
Config::get('deactivated_avatar_img')
|
||||||
);
|
);
|
||||||
$bannedAvatar = ROOT . str_replace(
|
$bannedAvatar = ROOT . str_replace(
|
||||||
'{{ TPL }}',
|
'{{ TPL }}',
|
||||||
$templateName,
|
$templateName,
|
||||||
Config::getConfig('banned_avatar_img')
|
Config::get('banned_avatar_img')
|
||||||
);
|
);
|
||||||
|
|
||||||
// If ?u= isn't set or if it isn't numeric
|
// If ?u= isn't set or if it isn't numeric
|
||||||
|
@ -69,7 +69,7 @@ if (isset($_GET['m'])) {
|
||||||
|
|
||||||
case 'background':
|
case 'background':
|
||||||
// Set paths
|
// Set paths
|
||||||
$noBackground = ROOT . Config::getConfig('no_background_img');
|
$noBackground = ROOT . Config::get('no_background_img');
|
||||||
|
|
||||||
// If ?u= isn't set or if it isn't numeric
|
// If ?u= isn't set or if it isn't numeric
|
||||||
if (!isset($_GET['u']) || !is_numeric($_GET['u'])) {
|
if (!isset($_GET['u']) || !is_numeric($_GET['u'])) {
|
||||||
|
@ -105,7 +105,7 @@ if (isset($_GET['m'])) {
|
||||||
|
|
||||||
case 'header':
|
case 'header':
|
||||||
// Set paths
|
// Set paths
|
||||||
$noHeader = ROOT . Config::getConfig('no_header_img');
|
$noHeader = ROOT . Config::get('no_header_img');
|
||||||
|
|
||||||
// If ?u= isn't set or if it isn't numeric
|
// If ?u= isn't set or if it isn't numeric
|
||||||
if (!isset($_GET['u']) || !is_numeric($_GET['u'])) {
|
if (!isset($_GET['u']) || !is_numeric($_GET['u'])) {
|
||||||
|
@ -140,11 +140,11 @@ if (isset($_GET['m'])) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$serveImage = ROOT . Config::getConfig('pixel_img');
|
$serveImage = ROOT . Config::get('pixel_img');
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$serveImage = ROOT . Config::getConfig('pixel_img');
|
$serveImage = ROOT . Config::get('pixel_img');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add original filename
|
// Add original filename
|
||||||
|
|
|
@ -46,9 +46,9 @@ if (isset($_GET['p'])) {
|
||||||
// Are we in forum mode?
|
// Are we in forum mode?
|
||||||
$forumMode = isset($_GET['forum']) ? ($_GET['forum'] == true) : false;
|
$forumMode = isset($_GET['forum']) ? ($_GET['forum'] == true) : false;
|
||||||
|
|
||||||
$renderData['news'] = ($forumMode ? null : (new News(Config::getConfig('site_news_category'))));
|
$renderData['news'] = ($forumMode ? null : (new News(Config::get('site_news_category'))));
|
||||||
|
|
||||||
$renderData['newsCount'] = Config::getConfig('front_page_news_posts');
|
$renderData['newsCount'] = Config::get('front_page_news_posts');
|
||||||
|
|
||||||
$renderData['forum'] = ($forumMode ? (new Forum\Forum()) : null);
|
$renderData['forum'] = ($forumMode ? (new Forum\Forum()) : null);
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ if (Users::checkLogin()) {
|
||||||
|
|
||||||
$renderData['users'] = ($_MEMBERLIST_ACTIVE && !$_MEMBERLIST_NFOUND ? Users::getUsersInRank($_MEMBERLIST_ACTIVE) : Users::getAllUsers());
|
$renderData['users'] = ($_MEMBERLIST_ACTIVE && !$_MEMBERLIST_NFOUND ? Users::getUsersInRank($_MEMBERLIST_ACTIVE) : Users::getAllUsers());
|
||||||
|
|
||||||
$renderData['membersPerPage'] = Config::getConfig('members_per_page');
|
$renderData['membersPerPage'] = Config::get('members_per_page');
|
||||||
|
|
||||||
// Set parse variables
|
// Set parse variables
|
||||||
$template->setVariables($renderData);
|
$template->setVariables($renderData);
|
||||||
|
|
|
@ -13,7 +13,7 @@ use DOMDocument;
|
||||||
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . 'sakura.php';
|
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . 'sakura.php';
|
||||||
|
|
||||||
// Create a new News object
|
// Create a new News object
|
||||||
$news = new News(isset($_GET['cat']) ? $_GET['cat'] : Config::getConfig('site_news_category'));
|
$news = new News(isset($_GET['cat']) ? $_GET['cat'] : Config::get('site_news_category'));
|
||||||
|
|
||||||
// News XML feed
|
// News XML feed
|
||||||
if (isset($_GET['xml'])) {
|
if (isset($_GET['xml'])) {
|
||||||
|
@ -22,11 +22,11 @@ if (isset($_GET['xml'])) {
|
||||||
|
|
||||||
// Meta data attributes
|
// Meta data attributes
|
||||||
$metaData = [
|
$metaData = [
|
||||||
'title' => ($_FEED_TITLE = Config::getConfig('sitename')) . ' News',
|
'title' => ($_FEED_TITLE = Config::get('sitename')) . ' News',
|
||||||
'link' => ($_FEED_URL = 'http://' . Config::getConfig('url_main')),
|
'link' => ($_FEED_URL = 'http://' . Config::get('url_main')),
|
||||||
'description' => 'News about ' . $_FEED_TITLE,
|
'description' => 'News about ' . $_FEED_TITLE,
|
||||||
'language' => 'en-gb',
|
'language' => 'en-gb',
|
||||||
'webMaster' => Config::getConfig('admin_email') . ' (' . $_FEED_TITLE . ' Webmaster)',
|
'webMaster' => Config::get('admin_email') . ' (' . $_FEED_TITLE . ' Webmaster)',
|
||||||
'pubDate' => ($_FEED_DATE = date('r', $posts[array_keys($posts)[0]]['news_timestamp'])),
|
'pubDate' => ($_FEED_DATE = date('r', $posts[array_keys($posts)[0]]['news_timestamp'])),
|
||||||
'lastBuildDate' => $_FEED_DATE,
|
'lastBuildDate' => $_FEED_DATE,
|
||||||
];
|
];
|
||||||
|
@ -120,7 +120,7 @@ if (isset($_GET['xml'])) {
|
||||||
|
|
||||||
$renderData = array_merge($renderData, [
|
$renderData = array_merge($renderData, [
|
||||||
'news' => $news,
|
'news' => $news,
|
||||||
'postsPerPage' => Config::getConfig('news_posts_per_page'),
|
'postsPerPage' => Config::get('news_posts_per_page'),
|
||||||
'viewPost' => isset($_GET['id']),
|
'viewPost' => isset($_GET['id']),
|
||||||
'postExists' => $news->postExists(isset($_GET['id']) ? $_GET['id'] : 0),
|
'postExists' => $news->postExists(isset($_GET['id']) ? $_GET['id'] : 0),
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -388,8 +388,8 @@ if (isset($_REQUEST['request-notifications']) && $_REQUEST['request-notification
|
||||||
sprintf($notifStrings[$action[1]][0], $user->username()),
|
sprintf($notifStrings[$action[1]][0], $user->username()),
|
||||||
$notifStrings[$action[1]][1],
|
$notifStrings[$action[1]][1],
|
||||||
60000,
|
60000,
|
||||||
'//' . Config::getConfig('url_main') . '/a/' . $user->id(),
|
'//' . Config::get('url_main') . '/a/' . $user->id(),
|
||||||
'//' . Config::getConfig('url_main') . '/u/' . $user->id(),
|
'//' . Config::get('url_main') . '/u/' . $user->id(),
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -487,7 +487,7 @@ if (isset($_REQUEST['request-notifications']) && $_REQUEST['request-notification
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set path variables
|
// Set path variables
|
||||||
$filepath = ROOT . Config::getConfig('user_uploads') . '/';
|
$filepath = ROOT . Config::get('user_uploads') . '/';
|
||||||
$filename = $filepath . $mode . '_' . $currentUser->id();
|
$filename = $filepath . $mode . '_' . $currentUser->id();
|
||||||
$currfile = isset($currentUser->userData()[$userDataKey])
|
$currfile = isset($currentUser->userData()[$userDataKey])
|
||||||
&& !empty($currentUser->userData()[$userDataKey]) ? $currentUser->userData()[$userDataKey] : null;
|
&& !empty($currentUser->userData()[$userDataKey]) ? $currentUser->userData()[$userDataKey] : null;
|
||||||
|
@ -576,8 +576,8 @@ if (isset($_REQUEST['request-notifications']) && $_REQUEST['request-notification
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the image is too large
|
// Check if the image is too large
|
||||||
if (($metadata[0] > Config::getConfig($mode . '_max_width')
|
if (($metadata[0] > Config::get($mode . '_max_width')
|
||||||
|| $metadata[1] > Config::getConfig($mode . '_max_height'))) {
|
|| $metadata[1] > Config::get($mode . '_max_height'))) {
|
||||||
// Set render data
|
// Set render data
|
||||||
$renderData['page'] = [
|
$renderData['page'] = [
|
||||||
|
|
||||||
|
@ -591,8 +591,8 @@ if (isset($_REQUEST['request-notifications']) && $_REQUEST['request-notification
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the image is too small
|
// Check if the image is too small
|
||||||
if (($metadata[0] < Config::getConfig($mode . '_min_width')
|
if (($metadata[0] < Config::get($mode . '_min_width')
|
||||||
|| $metadata[1] < Config::getConfig($mode . '_min_height'))) {
|
|| $metadata[1] < Config::get($mode . '_min_height'))) {
|
||||||
// Set render data
|
// Set render data
|
||||||
$renderData['page'] = [
|
$renderData['page'] = [
|
||||||
|
|
||||||
|
@ -606,7 +606,7 @@ if (isset($_REQUEST['request-notifications']) && $_REQUEST['request-notification
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the file is too large
|
// Check if the file is too large
|
||||||
if ((filesize($_FILES[$mode]['tmp_name']) > Config::getConfig($mode . '_max_fsize'))) {
|
if ((filesize($_FILES[$mode]['tmp_name']) > Config::get($mode . '_max_fsize'))) {
|
||||||
// Set render data
|
// Set render data
|
||||||
$renderData['page'] = [
|
$renderData['page'] = [
|
||||||
|
|
||||||
|
@ -1505,12 +1505,12 @@ if (Users::checkLogin()) {
|
||||||
case 'appearance.avatar':
|
case 'appearance.avatar':
|
||||||
case 'appearance.background':
|
case 'appearance.background':
|
||||||
$renderData[$mode] = [
|
$renderData[$mode] = [
|
||||||
'max_width' => Config::getConfig($mode . '_max_width'),
|
'max_width' => Config::get($mode . '_max_width'),
|
||||||
'max_height' => Config::getConfig($mode . '_max_height'),
|
'max_height' => Config::get($mode . '_max_height'),
|
||||||
'min_width' => Config::getConfig($mode . '_min_width'),
|
'min_width' => Config::get($mode . '_min_width'),
|
||||||
'min_height' => Config::getConfig($mode . '_min_height'),
|
'min_height' => Config::get($mode . '_min_height'),
|
||||||
'max_size' => Config::getConfig($mode . '_max_fsize'),
|
'max_size' => Config::get($mode . '_max_fsize'),
|
||||||
'max_size_view' => Main::getByteSymbol(Config::getConfig($mode . '_max_fsize')),
|
'max_size_view' => Main::getByteSymbol(Config::get($mode . '_max_fsize')),
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -44,15 +44,15 @@ if (isset($_REQUEST['mode'])
|
||||||
if (!isset($_POST['months'])
|
if (!isset($_POST['months'])
|
||||||
|| !is_numeric($_POST['months'])
|
|| !is_numeric($_POST['months'])
|
||||||
|| (int) $_POST['months'] < 1
|
|| (int) $_POST['months'] < 1
|
||||||
|| (int) $_POST['months'] > Config::getConfig('premium_amount_max')) {
|
|| (int) $_POST['months'] > Config::get('premium_amount_max')) {
|
||||||
header('Location: ' . $urls->format('SITE_PREMIUM') . '?fail=true');
|
header('Location: ' . $urls->format('SITE_PREMIUM') . '?fail=true');
|
||||||
} else {
|
} else {
|
||||||
// Calculate the total
|
// Calculate the total
|
||||||
$total = (float) Config::getConfig('premium_price_per_month') * (int) $_POST['months'];
|
$total = (float) Config::get('premium_price_per_month') * (int) $_POST['months'];
|
||||||
$total = number_format($total, 2, '.', '');
|
$total = number_format($total, 2, '.', '');
|
||||||
|
|
||||||
// Generate item name
|
// Generate item name
|
||||||
$itemName = Config::getConfig('sitename')
|
$itemName = Config::get('sitename')
|
||||||
. ' Premium - '
|
. ' Premium - '
|
||||||
. (string) $_POST['months']
|
. (string) $_POST['months']
|
||||||
. ' month'
|
. ' month'
|
||||||
|
@ -62,8 +62,8 @@ if (isset($_REQUEST['mode'])
|
||||||
if ($transaction = Payments::createTransaction(
|
if ($transaction = Payments::createTransaction(
|
||||||
$total,
|
$total,
|
||||||
$itemName,
|
$itemName,
|
||||||
Config::getConfig('sitename') . ' Premium Purchase',
|
Config::get('sitename') . ' Premium Purchase',
|
||||||
'http://' . Config::getConfig('url_main') . $urls->format('SITE_PREMIUM')
|
'http://' . Config::get('url_main') . $urls->format('SITE_PREMIUM')
|
||||||
)) {
|
)) {
|
||||||
// Store the amount of months in the global session array
|
// Store the amount of months in the global session array
|
||||||
$_SESSION['premiumMonths'] = (int) $_POST['months'];
|
$_SESSION['premiumMonths'] = (int) $_POST['months'];
|
||||||
|
@ -98,7 +98,7 @@ if (isset($_REQUEST['mode'])
|
||||||
Users::updatePremiumMeta($currentUser->id());
|
Users::updatePremiumMeta($currentUser->id());
|
||||||
Main::updatePremiumTracker(
|
Main::updatePremiumTracker(
|
||||||
$currentUser->id(),
|
$currentUser->id(),
|
||||||
((float) Config::getConfig('premium_price_per_month') * $_SESSION['premiumMonths']),
|
((float) Config::get('premium_price_per_month') * $_SESSION['premiumMonths']),
|
||||||
$currentUser->username()
|
$currentUser->username()
|
||||||
. ' bought premium for '
|
. ' bought premium for '
|
||||||
. $_SESSION['premiumMonths']
|
. $_SESSION['premiumMonths']
|
||||||
|
@ -156,9 +156,9 @@ if (isset($_GET['tracker'])) {
|
||||||
$renderData['page'] = [
|
$renderData['page'] = [
|
||||||
|
|
||||||
'fail' => isset($_GET['fail']),
|
'fail' => isset($_GET['fail']),
|
||||||
'price' => Config::getConfig('premium_price_per_month'),
|
'price' => Config::get('premium_price_per_month'),
|
||||||
'current' => $currentUser->isPremium(),
|
'current' => $currentUser->isPremium(),
|
||||||
'amount_max' => Config::getConfig('premium_amount_max'),
|
'amount_max' => Config::get('premium_amount_max'),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
77
sakura.php
77
sakura.php
|
@ -8,16 +8,15 @@
|
||||||
namespace Sakura;
|
namespace Sakura;
|
||||||
|
|
||||||
// Define Sakura version
|
// Define Sakura version
|
||||||
define('SAKURA_VERSION', '20151203');
|
define('SAKURA_VERSION', '20151204');
|
||||||
define('SAKURA_VLABEL', 'Eminence');
|
define('SAKURA_VLABEL', 'Eminence');
|
||||||
define('SAKURA_COLOUR', '#6C3082');
|
define('SAKURA_COLOUR', '#6C3082');
|
||||||
define('SAKURA_STABLE', false);
|
|
||||||
|
|
||||||
// Define Sakura Path
|
// Define Sakura Path
|
||||||
define('ROOT', __DIR__ . '/');
|
define('ROOT', __DIR__ . '/');
|
||||||
|
|
||||||
// Error Reporting: 0 for production and -1 for testing
|
// Turn error reporting on for the initial startup sequence
|
||||||
error_reporting(SAKURA_STABLE ? 0 : -1);
|
error_reporting(-1);
|
||||||
|
|
||||||
// Set internal encoding method
|
// Set internal encoding method
|
||||||
mb_internal_encoding('utf-8');
|
mb_internal_encoding('utf-8');
|
||||||
|
@ -69,13 +68,16 @@ set_error_handler(['Sakura\Main', 'errorHandler']);
|
||||||
// Initialise Main Class
|
// Initialise Main Class
|
||||||
Main::init(ROOT . 'config/config.ini');
|
Main::init(ROOT . 'config/config.ini');
|
||||||
|
|
||||||
|
// Change error reporting according to the dev configuration
|
||||||
|
error_reporting(Config::local('dev', 'enable') ? -1 : 0);
|
||||||
|
|
||||||
// Assign servers file to whois class
|
// Assign servers file to whois class
|
||||||
Whois::setServers(ROOT . Config::getLocalConfig('data', 'whoisservers'));
|
Whois::setServers(ROOT . Config::local('data', 'whoisservers'));
|
||||||
|
|
||||||
// Check if we the system has a cron service
|
// Check if we the system has a cron service
|
||||||
if (Config::getConfig('no_cron_service')) {
|
if (Config::get('no_cron_service')) {
|
||||||
// If not do an "asynchronous" call to the cron.php script
|
// If not do an "asynchronous" call to the cron.php script
|
||||||
if (Config::getConfig('no_cron_last') < (time() - Config::getConfig('no_cron_interval'))) {
|
if (Config::get('no_cron_last') < (time() - Config::get('no_cron_interval'))) {
|
||||||
// Check OS
|
// Check OS
|
||||||
if (substr(strtolower(PHP_OS), 0, 3) == 'win') {
|
if (substr(strtolower(PHP_OS), 0, 3) == 'win') {
|
||||||
pclose(popen('start /B ' . PHP_BINDIR . '\php.exe ' . addslashes(ROOT . 'cron.php'), 'r'));
|
pclose(popen('start /B ' . PHP_BINDIR . '\php.exe ' . addslashes(ROOT . 'cron.php'), 'r'));
|
||||||
|
@ -96,7 +98,7 @@ if (Config::getConfig('no_cron_service')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start output buffering
|
// Start output buffering
|
||||||
ob_start(Config::getConfig('use_gzip') ? 'ob_gzhandler' : null);
|
ob_start(Config::get('use_gzip') ? 'ob_gzhandler' : null);
|
||||||
|
|
||||||
// Auth check
|
// Auth check
|
||||||
$authCheck = Users::checkLogin();
|
$authCheck = Users::checkLogin();
|
||||||
|
@ -110,11 +112,11 @@ $urls = new Urls();
|
||||||
// Prepare the name of the template to load (outside of SAKURA_NO_TPL because it's used in imageserve.php)
|
// Prepare the name of the template to load (outside of SAKURA_NO_TPL because it's used in imageserve.php)
|
||||||
$templateName =
|
$templateName =
|
||||||
defined('SAKURA_MANAGE') ?
|
defined('SAKURA_MANAGE') ?
|
||||||
Config::getConfig('manage_style') :
|
Config::get('manage_style') :
|
||||||
(
|
(
|
||||||
isset($currentUser->optionFields()['useMisaki']) && $currentUser->optionFields()['useMisaki'] ?
|
isset($currentUser->optionFields()['useMisaki']) && $currentUser->optionFields()['useMisaki'] ?
|
||||||
'misaki' :
|
'misaki' :
|
||||||
Config::getConfig('site_style')
|
Config::get('site_style')
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!defined('SAKURA_NO_TPL')) {
|
if (!defined('SAKURA_NO_TPL')) {
|
||||||
|
@ -125,41 +127,44 @@ if (!defined('SAKURA_NO_TPL')) {
|
||||||
'version' => SAKURA_VERSION,
|
'version' => SAKURA_VERSION,
|
||||||
'label' => SAKURA_VLABEL,
|
'label' => SAKURA_VLABEL,
|
||||||
'colour' => SAKURA_COLOUR,
|
'colour' => SAKURA_COLOUR,
|
||||||
'stable' => SAKURA_STABLE,
|
],
|
||||||
|
|
||||||
|
'dev' => [
|
||||||
|
'enable' => Config::local('dev', 'enable'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'cookie' => [
|
'cookie' => [
|
||||||
'prefix' => Config::getConfig('cookie_prefix'),
|
'prefix' => Config::get('cookie_prefix'),
|
||||||
'domain' => Config::getConfig('cookie_domain'),
|
'domain' => Config::get('cookie_domain'),
|
||||||
'path' => Config::getConfig('cookie_path'),
|
'path' => Config::get('cookie_path'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'urlMain' => Config::getConfig('url_main'),
|
'urlMain' => Config::get('url_main'),
|
||||||
'urlApi' => Config::getConfig('url_api'),
|
'urlApi' => Config::get('url_api'),
|
||||||
|
|
||||||
'contentPath' => Config::getConfig('content_path'),
|
'contentPath' => Config::get('content_path'),
|
||||||
'resources' => Config::getConfig('content_path') . '/data/' . $templateName,
|
'resources' => Config::get('content_path') . '/data/' . $templateName,
|
||||||
|
|
||||||
'charset' => Config::getConfig('charset'),
|
'charset' => Config::get('charset'),
|
||||||
'siteName' => Config::getConfig('sitename'),
|
'siteName' => Config::get('sitename'),
|
||||||
'siteLogo' => Config::getConfig('sitelogo'),
|
'siteLogo' => Config::get('sitelogo'),
|
||||||
'siteDesc' => Config::getConfig('sitedesc'),
|
'siteDesc' => Config::get('sitedesc'),
|
||||||
'siteTags' => implode(", ", json_decode(Config::getConfig('sitetags'), true)),
|
'siteTags' => implode(", ", json_decode(Config::get('sitetags'), true)),
|
||||||
'dateFormat' => Config::getConfig('date_format'),
|
'dateFormat' => Config::get('date_format'),
|
||||||
'currentPage' => '//' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
|
'currentPage' => '//' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
|
||||||
'referrer' => (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null),
|
'referrer' => (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null),
|
||||||
'onlineTimeout' => Config::getConfig('max_online_time'),
|
'onlineTimeout' => Config::get('max_online_time'),
|
||||||
|
|
||||||
'recaptchaPublic' => Config::getConfig('recaptcha_public'),
|
'recaptchaPublic' => Config::get('recaptcha_public'),
|
||||||
'recaptchaEnabled' => Config::getConfig('recaptcha'),
|
'recaptchaEnabled' => Config::get('recaptcha'),
|
||||||
|
|
||||||
'disableRegistration' => Config::getConfig('disable_registration'),
|
'disableRegistration' => Config::get('disable_registration'),
|
||||||
'lockAuth' => Config::getConfig('lock_authentication'),
|
'lockAuth' => Config::get('lock_authentication'),
|
||||||
'requireRegCodes' => Config::getConfig('require_registration_code'),
|
'requireRegCodes' => Config::get('require_registration_code'),
|
||||||
'requireActivation' => Config::getConfig('require_activation'),
|
'requireActivation' => Config::get('require_activation'),
|
||||||
'minPwdEntropy' => Config::getConfig('min_entropy'),
|
'minPwdEntropy' => Config::get('min_entropy'),
|
||||||
'minUsernameLength' => Config::getConfig('username_min_length'),
|
'minUsernameLength' => Config::get('username_min_length'),
|
||||||
'maxUsernameLength' => Config::getConfig('username_max_length'),
|
'maxUsernameLength' => Config::get('username_max_length'),
|
||||||
],
|
],
|
||||||
'php' => [
|
'php' => [
|
||||||
'sessionid' => \session_id(),
|
'sessionid' => \session_id(),
|
||||||
|
@ -181,11 +186,11 @@ if (!defined('SAKURA_NO_TPL')) {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Site closing
|
// Site closing
|
||||||
if (Config::getConfig('site_closed')) {
|
if (Config::get('site_closed')) {
|
||||||
// Additional render data
|
// Additional render data
|
||||||
$renderData = array_merge($renderData, [
|
$renderData = array_merge($renderData, [
|
||||||
'page' => [
|
'page' => [
|
||||||
'message' => Config::getConfig('site_closed_reason'),
|
'message' => Config::get('site_closed_reason'),
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -239,7 +239,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="ftsections">
|
<div class="ftsections">
|
||||||
<div class="copycentre">{% if not sakura.versionInfo.stable %}<a href="https://sakura.flash.moe/#r{{ sakura.versionInfo.version }}" target="_blank">Sakura Revision {{ sakura.versionInfo.version }} Development</a>{% endif %} © 2013-2015 <a href="https://flash.moe/" target="_blank">Flashwave</a>, <a href="https://circlestorm.net/">et al</a>. </div>
|
<div class="copycentre">Powered by <a href="https://github.com/flashwave/sakura/" target="_blank">Sakura</a>{% if sakura.dev.enable %} <a href="https://sakura.flash.moe/#r{{ sakura.versionInfo.version }}" target="_blank">r{{ sakura.versionInfo.version }}</a>{% endif %} © 2013-2015 <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>
|
||||||
|
@ -267,7 +267,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if not sakura.versionInfo.stable and php.self == '/index.php' and stats %}
|
{% if sakura.dev.enable and php.self == '/index.php' and stats %}
|
||||||
<script type="text/javascript" src="https://sakura.flash.moe/?get={{ sakura.versionInfo.version|slice(0, 4) }}-{{ sakura.versionInfo.version|slice(4, 2) }}-{{ sakura.versionInfo.version|slice(6, 2) }}&variable=true"></script>
|
<script type="text/javascript" src="https://sakura.flash.moe/?get={{ sakura.versionInfo.version|slice(0, 4) }}-{{ sakura.versionInfo.version|slice(4, 2) }}-{{ sakura.versionInfo.version|slice(6, 2) }}&variable=true"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// Column colours for actions
|
// Column colours for actions
|
||||||
|
|
Reference in a new issue