From 32b7622791e21ad6a069d5b9b208ca53df478987 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sun, 18 Oct 2015 21:06:30 +0200 Subject: [PATCH] r20151018.2 Signed-off-by: Flashwave --- _sakura/components/Bans.php | 4 + _sakura/components/Comments.php | 4 + _sakura/components/Configuration.php | 8 +- _sakura/components/Database.php | 4 + _sakura/components/Forum.php | 4 + _sakura/components/Hashing.php | 8 +- _sakura/components/Main.php | 24 +-- _sakura/components/Manage.php | 4 + _sakura/components/News.php | 4 + _sakura/components/Payments.php | 10 +- _sakura/components/Permissions.php | 4 + _sakura/components/Rank.php | 4 + _sakura/components/Session.php | 9 +- _sakura/components/Templates.php | 4 + _sakura/components/Upload.php | 4 + _sakura/components/Urls.php | 4 + _sakura/components/User.php | 6 +- _sakura/components/Users.php | 20 ++- _sakura/components/Whois.php | 6 +- _sakura/components/database/mysql.php | 4 + _sakura/sakura.php | 2 +- _sakura/templates/misaki/global/master.tpl | 15 +- _sakura/templates/misaki/global/notfound.tpl | 2 +- _sakura/templates/yuuno/elements/captcha.tpl | 4 +- _sakura/templates/yuuno/forum/posting.tpl | 2 +- _sakura/templates/yuuno/forum/viewtopic.tpl | 2 +- _sakura/templates/yuuno/global/master.tpl | 8 +- _sakura/templates/yuuno/global/notfound.tpl | 2 +- _sakura/templates/yuuno/main/memberlist.tpl | 4 +- _sakura/templates/yuuno/main/profile.tpl | 2 +- .../yuuno/settings/appearance.userpage.tpl | 2 +- .../data/broomcloset_old/css/manage.css | 2 +- public/content/data/mio/css/feedback.css | 22 +-- public/content/data/mio/css/mio.css | 166 ++++++++---------- public/content/data/mio/css/mionetics.css | 148 +++++++--------- public/content/data/misaki/css/error.css | 2 +- public/content/data/misaki/css/misaki.css | 6 +- public/content/data/yuuno/css/error.css | 4 +- public/content/data/yuuno/css/yuuno.css | 26 ++- public/content/data/yuuno/js/ybabstat.js | 2 +- public/content/data/yuuno/js/yuuno.js | 8 +- public/members.php | 2 +- public/settings.php | 2 +- 43 files changed, 311 insertions(+), 263 deletions(-) diff --git a/_sakura/components/Bans.php b/_sakura/components/Bans.php index 231a0ed..53329c7 100755 --- a/_sakura/components/Bans.php +++ b/_sakura/components/Bans.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Bans + * @package Sakura + */ class Bans { // Check if a user is banned diff --git a/_sakura/components/Comments.php b/_sakura/components/Comments.php index 195c735..66ce880 100755 --- a/_sakura/components/Comments.php +++ b/_sakura/components/Comments.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Comments + * @package Sakura + */ class Comments { public $comments = []; // Array containing comments diff --git a/_sakura/components/Configuration.php b/_sakura/components/Configuration.php index 89d1294..0db5898 100755 --- a/_sakura/components/Configuration.php +++ b/_sakura/components/Configuration.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Configuration + * @package Sakura + */ class Configuration { // Configuration data @@ -49,7 +53,7 @@ class Configuration $_DATA = Database::fetch('config', true); // Create variable to temporarily store values in - $_DBCN = array(); + $_DBCN = []; // Properly sort the values foreach ($_DATA as $_CONF) { @@ -92,7 +96,7 @@ class Configuration if ($subkey) { // If we do we make sure that the parent key is an array if (!isset(self::$local[$key])) { - self::$local[$key] = array(); + self::$local[$key] = []; } // And then assign the value diff --git a/_sakura/components/Database.php b/_sakura/components/Database.php index 768d84e..a514921 100755 --- a/_sakura/components/Database.php +++ b/_sakura/components/Database.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Database + * @package Sakura + */ class Database { // Database container diff --git a/_sakura/components/Forum.php b/_sakura/components/Forum.php index 25142fc..c443817 100755 --- a/_sakura/components/Forum.php +++ b/_sakura/components/Forum.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Forum + * @package Sakura + */ class Forum { // Empty forum template diff --git a/_sakura/components/Hashing.php b/_sakura/components/Hashing.php index 49238d0..ae96b78 100755 --- a/_sakura/components/Hashing.php +++ b/_sakura/components/Hashing.php @@ -31,6 +31,10 @@ namespace Sakura; +/** + * Class Hashing + * @package Sakura + */ class Hashing { // These variables can be changed without break the existing hashes @@ -61,12 +65,12 @@ class Hashing ) ); - $passwordData = array( + $passwordData = [ self::$hashAlgorithm, self::$iterations, $salt, $hash, - ); + ]; return $passwordData; diff --git a/_sakura/components/Main.php b/_sakura/components/Main.php index 39cf952..b6e31d2 100755 --- a/_sakura/components/Main.php +++ b/_sakura/components/Main.php @@ -8,6 +8,10 @@ namespace Sakura; use Parsedown; use PHPMailer; +/** + * Class Main + * @package Sakura + */ class Main { // Constructor @@ -210,11 +214,11 @@ class Main h2 { margin: 0 -10px; } .container { border: 1px solid #CAA; margin: 10px auto; background: #FFF; box-shadow: 2px 2px 1em #888; max-width: 1024px; border-radius: 10px; } - .container .inner { padding: 0px 10px; } + .container .inner { padding: 0 10px; } .container .inner .error { background: #555; color: #EEE; border-left: 5px solid #C22; - padding: 4px 6px; text-shadow: 0px 1px 1px #888; white-space: pre-wrap; + padding: 4px 6px; text-shadow: 0 1px 1px #888; white-space: pre-wrap; word-wrap: break-word; margin: 12px 0; border-radius: 5px; box-shadow: inset 0 0 1em #333; } - .container .footer { border-top: 1px solid #CAA; font-size: x-small; padding: 0px 5px 1px; } + .container .footer { border-top: 1px solid #CAA; font-size: x-small; padding: 0 5px 1px; } a { color: #77E; text-decoration: none; } a:hover { text-decoration: underline; } a:active { color: #E77; } @@ -283,7 +287,7 @@ class Main $mail = new PHPMailer(); // Set to SMTP - $mail->IsSMTP(); + $mail->isSMTP(); // Set the SMTP server host $mail->Host = Configuration::getConfig('smtp_server'); @@ -304,14 +308,14 @@ class Main } // Add a reply-to header - $mail->AddReplyTo(Configuration::getConfig('smtp_replyto_mail'), Configuration::getConfig('smtp_replyto_name')); + $mail->addReplyTo(Configuration::getConfig('smtp_replyto_mail'), Configuration::getConfig('smtp_replyto_name')); // Set a from address as well - $mail->SetFrom(Configuration::getConfig('smtp_from_email'), Configuration::getConfig('smtp_from_name')); + $mail->setFrom(Configuration::getConfig('smtp_from_email'), Configuration::getConfig('smtp_from_name')); // Set the addressee foreach ($to as $email => $name) { - $mail->AddBCC($email, $name); + $mail->addBCC($email, $name); } // Subject line @@ -335,10 +339,10 @@ class Main $mail->AltBody = $body; // Send the message - $send = $mail->Send(); + $send = $mail->send(); // Clear the addressee list - $mail->ClearAddresses(); + $mail->clearAddresses(); // If we got an error return the error if (!$send) { @@ -695,7 +699,7 @@ class Main $logsDB = Database::fetch('logs', true, $conditions, ['id', true]); // Storage array - $logs = array(); + $logs = []; // Iterate over entries foreach ($logsDB as $log) { diff --git a/_sakura/components/Manage.php b/_sakura/components/Manage.php index 385978a..de3ccbb 100755 --- a/_sakura/components/Manage.php +++ b/_sakura/components/Manage.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Manage + * @package Sakura + */ class Manage { diff --git a/_sakura/components/News.php b/_sakura/components/News.php index 7fbae6c..0d17f19 100755 --- a/_sakura/components/News.php +++ b/_sakura/components/News.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class News + * @package Sakura + */ class News { private $posts = []; // Posts array diff --git a/_sakura/components/Payments.php b/_sakura/components/Payments.php index 0769dc7..efd8c26 100755 --- a/_sakura/components/Payments.php +++ b/_sakura/components/Payments.php @@ -15,6 +15,10 @@ use \PayPal\Api\PaymentExecution; use \PayPal\Api\RedirectUrls; use \PayPal\Api\Transaction; +/** + * Class Payments + * @package Sakura + */ class Payments { // Container for PayPal API @@ -32,7 +36,7 @@ class Payments Configuration::getConfig('paypal_secret') ) ); - } catch (Exception $e) { + } catch (\Exception $e) { return false; } @@ -107,7 +111,7 @@ class Payments // Try to create payment try { $payment->create(self::$paypal); - } catch (Exception $ex) { + } catch (\Exception $ex) { return false; } @@ -132,7 +136,7 @@ class Payments // Attempt to charge the fucker try { $payment->execute($execute, self::$paypal); - } catch (Exception $ex) { + } catch (\Exception $ex) { return false; } diff --git a/_sakura/components/Permissions.php b/_sakura/components/Permissions.php index 8b2d05b..cd0ca36 100755 --- a/_sakura/components/Permissions.php +++ b/_sakura/components/Permissions.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Permissions + * @package Sakura + */ class Permissions { // Fallback permission data diff --git a/_sakura/components/Rank.php b/_sakura/components/Rank.php index dcc3e13..e94795e 100755 --- a/_sakura/components/Rank.php +++ b/_sakura/components/Rank.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Rank + * @package Sakura + */ class Rank { // Rank data diff --git a/_sakura/components/Session.php b/_sakura/components/Session.php index 79786d7..f670ab4 100755 --- a/_sakura/components/Session.php +++ b/_sakura/components/Session.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Session + * @package Sakura + */ class Session { // Current user data @@ -91,8 +95,11 @@ class Session return 0; } + // IP Check + $ipCheck = Configuration::getConfig('session_check'); + // Origin checking - if ($ipCheck = Configuration::getConfig('session_check')) { + if ($ipCheck) { // Split both IPs up $sessionIP = explode('.', $session['user_ip']); $userIP = explode('.', Main::getRemoteIP()); diff --git a/_sakura/components/Templates.php b/_sakura/components/Templates.php index 422ecc4..89e6d89 100755 --- a/_sakura/components/Templates.php +++ b/_sakura/components/Templates.php @@ -9,6 +9,10 @@ use Twig_Environment; use Twig_Extension_StringLoader; use Twig_Loader_Filesystem; +/** + * Class Templates + * @package Sakura + */ class Templates { // Engine container, template folder name and options diff --git a/_sakura/components/Upload.php b/_sakura/components/Upload.php index 955f7f6..20a1302 100755 --- a/_sakura/components/Upload.php +++ b/_sakura/components/Upload.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Upload + * @package Sakura + */ class Upload { diff --git a/_sakura/components/Urls.php b/_sakura/components/Urls.php index 84c4789..938ce5b 100755 --- a/_sakura/components/Urls.php +++ b/_sakura/components/Urls.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Urls + * @package Sakura + */ class Urls { // Unformatted links [0] = no mod_rewrite, [1] = mod_rewrite diff --git a/_sakura/components/User.php b/_sakura/components/User.php index d52475c..2b01d77 100755 --- a/_sakura/components/User.php +++ b/_sakura/components/User.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class User + * @package Sakura + */ class User { // User data @@ -296,7 +300,7 @@ class User } // Assign field to output with value - $profile[$fieldName] = array(); + $profile[$fieldName] = []; $profile[$fieldName]['name'] = $field['field_name']; $profile[$fieldName]['value'] = $this->data['user_data']['profileFields'][$fieldName]; $profile[$fieldName]['islink'] = $field['field_link']; diff --git a/_sakura/components/Users.php b/_sakura/components/Users.php index 9ffc4d0..1100b83 100755 --- a/_sakura/components/Users.php +++ b/_sakura/components/Users.php @@ -5,6 +5,10 @@ namespace Sakura; +/** + * Class Users + * @package Sakura + */ class Users { @@ -202,14 +206,12 @@ class Users { // Check if user is logged in - if (!self::checkLogin()) { + if (!$check = self::checkLogin()) { return false; } - // Remove the active session from the database - if (!(new Session)->destroy()) { - return false; - } + // Destroy the active session + (new Session($check[0], $check[1]))->destroy(); // Unset User ID setcookie( @@ -922,7 +924,7 @@ class Users } // Assign field to output with value - $profile[$fieldName] = array(); + $profile[$fieldName] = []; $profile[$fieldName]['name'] = $field['name']; $profile[$fieldName]['value'] = $profileData[$fieldName]; $profile[$fieldName]['islink'] = $field['islink']; @@ -1161,7 +1163,7 @@ class Users } // Make output array - $rank = array(); + $rank = []; // Go over all users and check if they have the rank id foreach ($users as $user) { @@ -1246,7 +1248,7 @@ class Users { // Prepare conditions - $conditions = array(); + $conditions = []; $conditions['user_id'] = [($uid ? $uid : self::checkLogin()[0]), '=']; if ($timediff) { @@ -1327,7 +1329,7 @@ class Users ]); // Prepare a storage array - $store = array(); + $store = []; // Go over each message and check if they are for the current user foreach ($messages as $message) { diff --git a/_sakura/components/Whois.php b/_sakura/components/Whois.php index 3d3d355..66a0735 100755 --- a/_sakura/components/Whois.php +++ b/_sakura/components/Whois.php @@ -29,6 +29,10 @@ namespace Sakura; +/** + * Class Whois + * @package Sakura + */ class Whois { // Variables @@ -161,7 +165,7 @@ class Whois $servers = self::$servers['ip']; // Set variable to keep results in - $results = array(); + $results = []; // Query servers foreach ($servers as $server) { diff --git a/_sakura/components/database/mysql.php b/_sakura/components/database/mysql.php index a21cc8e..e2ebe4b 100755 --- a/_sakura/components/database/mysql.php +++ b/_sakura/components/database/mysql.php @@ -9,6 +9,10 @@ use PDO; use PDOException; use \Sakura\Configuration; +/** + * Class MySQL + * @package Sakura\DBWrapper + */ class MySQL { // Variable that will contain the SQL connection diff --git a/_sakura/sakura.php b/_sakura/sakura.php index 5a80c16..557b4b3 100755 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -54,7 +54,7 @@ foreach (glob(ROOT . '_sakura/components/database/*.php') as $driver) { } // Set Error handler -set_error_handler(array('Sakura\Main', 'errorHandler')); +set_error_handler(['Sakura\Main', 'errorHandler']); // Initialise Main Class Main::init(ROOT . '_sakura/config/config.ini'); diff --git a/_sakura/templates/misaki/global/master.tpl b/_sakura/templates/misaki/global/master.tpl index dc2470e..ffb5176 100755 --- a/_sakura/templates/misaki/global/master.tpl +++ b/_sakura/templates/misaki/global/master.tpl @@ -128,14 +128,15 @@ {% block content %}

{{ php.self }} is now printing!

{% endblock %} + - - diff --git a/_sakura/templates/yuuno/forum/viewtopic.tpl b/_sakura/templates/yuuno/forum/viewtopic.tpl index bf53f34..1c5ab24 100755 --- a/_sakura/templates/yuuno/forum/viewtopic.tpl +++ b/_sakura/templates/yuuno/forum/viewtopic.tpl @@ -12,7 +12,7 @@ {% if not post.user.checkPermission('SITE', 'DEACTIVATED') or post.user.checkPermission('SITE', 'RESTRICTED') %}{{ post.user.data.username }} - {{ post.user.data.username }} + {{ post.user.data.username }} {% else %} [deleted user] {% endif %} diff --git a/_sakura/templates/yuuno/global/master.tpl b/_sakura/templates/yuuno/global/master.tpl index 263ac51..5f3e493 100755 --- a/_sakura/templates/yuuno/global/master.tpl +++ b/_sakura/templates/yuuno/global/master.tpl @@ -213,15 +213,15 @@ {% endif %} {% if user.checkPermission('SITE', 'RESTRICTED') %} -
-

Your account is current in restricted mode!

+
+

Your account is currently in restricted mode!

A staff member has set your account to restricted mode most likely due to violation of the rules. While restricted you won't be able to use most public features of the site. If you think this is a mistake please get in touch with one of our staff members.
{% endif %} @@ -272,7 +272,7 @@ '#2AA', // Updated '#2AA', // Fixed '#A22', // Removed - '#62C', // Exported + '#62C' // Exported ]; window.addEventListener("load", function() { diff --git a/_sakura/templates/yuuno/global/notfound.tpl b/_sakura/templates/yuuno/global/notfound.tpl index 25dc144..3f0f46b 100755 --- a/_sakura/templates/yuuno/global/notfound.tpl +++ b/_sakura/templates/yuuno/global/notfound.tpl @@ -29,7 +29,7 @@ home page, and then look for links to the information you want.
  • - Click the Back + Click the Back button to try another link.
  • diff --git a/_sakura/templates/yuuno/main/memberlist.tpl b/_sakura/templates/yuuno/main/memberlist.tpl index d549b50..d3e2432 100755 --- a/_sakura/templates/yuuno/main/memberlist.tpl +++ b/_sakura/templates/yuuno/main/memberlist.tpl @@ -12,11 +12,11 @@ {% block content %}
    -

    {{ rankTitle }}

    +

    {{ rankTitle }}

    {{ rankDescription }}

    -