From 99cbeecb387c99c37b93c35f31036a3be5843af2 Mon Sep 17 00:00:00 2001 From: flashwave Date: Mon, 25 May 2015 18:18:56 +0000 Subject: [PATCH] holy shit --- README.md | 10 +- _sakura/changelog.json | 40 +- _sakura/components/Main.php | 2 +- _sakura/components/Users.php | 4 +- .../{cloudflare.hosts => cloudflare.ipv4} | 7 +- _sakura/config/cloudflare.ipv6 | 5 + _sakura/config/config.example.ini | 13 +- _sakura/config/config.example.php | 3 +- _sakura/sakura.php | 7 +- .../templates/yuuno/elements/indexPanel.tpl | 9 +- _sakura/templates/yuuno/global/header.tpl | 13 +- _sakura/templates/yuuno/main/authenticate.tpl | 12 +- content/data/yuuno/css/authpage.css | 77 + content/data/yuuno/css/base.css | 416 +++++ content/data/yuuno/css/donate.css | 65 + content/data/yuuno/css/footer.css | 53 + content/data/yuuno/css/forums.css | 78 + content/data/yuuno/css/header.css | 185 ++ content/data/yuuno/css/inputstyling.css | 74 + content/data/yuuno/css/keyframes.css | 71 + content/data/yuuno/css/markdown.css | 121 ++ content/data/yuuno/css/members.css | 103 ++ content/data/yuuno/css/messages.css | 41 + content/data/yuuno/css/news.css | 74 + content/data/yuuno/css/notifications.css | 99 ++ content/data/yuuno/css/profile.css | 49 + content/data/yuuno/css/settings.css | 91 + content/data/yuuno/css/yuuno.css | 1485 +---------------- content/data/yuuno/js/yuuno.js | 293 +++- 29 files changed, 1954 insertions(+), 1546 deletions(-) rename _sakura/config/{cloudflare.hosts => cloudflare.ipv4} (69%) create mode 100644 _sakura/config/cloudflare.ipv6 create mode 100644 content/data/yuuno/css/authpage.css create mode 100644 content/data/yuuno/css/base.css create mode 100644 content/data/yuuno/css/donate.css create mode 100644 content/data/yuuno/css/footer.css create mode 100644 content/data/yuuno/css/forums.css create mode 100644 content/data/yuuno/css/header.css create mode 100644 content/data/yuuno/css/inputstyling.css create mode 100644 content/data/yuuno/css/keyframes.css create mode 100644 content/data/yuuno/css/markdown.css create mode 100644 content/data/yuuno/css/members.css create mode 100644 content/data/yuuno/css/messages.css create mode 100644 content/data/yuuno/css/news.css create mode 100644 content/data/yuuno/css/notifications.css create mode 100644 content/data/yuuno/css/profile.css create mode 100644 content/data/yuuno/css/settings.css diff --git a/README.md b/README.md index efb2ccc..8b25856 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,4 @@ _A backend that doesn't suck_ -## What this will have - -- Code that doesn't suck dick. -- All the (good) features of the old backend -- Templating! -- PDO! -- Groups (different from ranks) - -Now with 100% more open source! +I'll write a more descriptive readme once it's in a stable state. diff --git a/_sakura/changelog.json b/_sakura/changelog.json index eb662b1..4233a8f 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -13,7 +13,8 @@ "20150509.1", "20150512", "20150523", - "20150524" + "20150524", + "20150525" ] @@ -1103,6 +1104,43 @@ "change": "Made the manage footer sticky to the bottom." } + ], + + "20150525": [ + + { + "type": "FIX", + "change": "Made the registration recaptcha refresh upon failure." + }, + { + "type": "ADD", + "change": "Added a JavaScript port of the password entropy function." + }, + { + "type": "FIX", + "change": "Made maximum and minimum username length configurable." + }, + { + "type": "UPD", + "change": "Split Yuuno CSS up in multiple files." + }, + { + "type": "UPD", + "change": "Changed the icons displayed on the side of the index when logged out." + }, + { + "type": "ADD", + "change": "Added JavaScript form checking to registration form." + }, + { + "type": "ADD", + "change": "Added smooth scroll to top thing." + }, + { + "type": "FIX", + "change": "Fixed subnet matching causing an error." + } + ] } diff --git a/_sakura/components/Main.php b/_sakura/components/Main.php index 422f5b7..72ce698 100644 --- a/_sakura/components/Main.php +++ b/_sakura/components/Main.php @@ -364,7 +364,7 @@ class Main { public static function checkCFIP($ip) { // Get CloudFlare Subnet list - $cfhosts = file_get_contents(Configuration::getLocalConfig('etc', 'cfhosts')); + $cfhosts = file_get_contents(Configuration::getLocalConfig('etc', 'cfipv'. (self::ipVersion($ip)))); // Replace \r\n with \n $cfhosts = str_replace("\r\n", "\n", $cfhosts); diff --git a/_sakura/components/Users.php b/_sakura/components/Users.php index bdfe71e..d6a6d85 100644 --- a/_sakura/components/Users.php +++ b/_sakura/components/Users.php @@ -211,11 +211,11 @@ class Users { return [0, 'USER_EXISTS']; // Username too short - if(strlen($username) < 3) + if(strlen($username) < Configuration::getConfig('username_min_length')) return [0, 'NAME_TOO_SHORT']; // Username too long - if(strlen($username) > 16) + if(strlen($username) > Configuration::getConfig('username_max_length')) return [0, 'NAME_TOO_LONG']; // Check if the given email address is formatted properly diff --git a/_sakura/config/cloudflare.hosts b/_sakura/config/cloudflare.ipv4 similarity index 69% rename from _sakura/config/cloudflare.hosts rename to _sakura/config/cloudflare.ipv4 index 15070b4..12fa8bb 100644 --- a/_sakura/config/cloudflare.hosts +++ b/_sakura/config/cloudflare.ipv4 @@ -11,9 +11,4 @@ 198.41.128.0/17 162.158.0.0/15 104.16.0.0/12 -172.64.0.0/13 -2400:cb00::/32 -2606:4700::/32 -2803:f800::/32 -2405:b500::/32 -2405:8100::/32 \ No newline at end of file +172.64.0.0/13 \ No newline at end of file diff --git a/_sakura/config/cloudflare.ipv6 b/_sakura/config/cloudflare.ipv6 new file mode 100644 index 0000000..b23db83 --- /dev/null +++ b/_sakura/config/cloudflare.ipv6 @@ -0,0 +1,5 @@ +2400:cb00::/32 +2606:4700::/32 +2803:f800::/32 +2405:b500::/32 +2405:8100::/32 \ No newline at end of file diff --git a/_sakura/config/config.example.ini b/_sakura/config/config.example.ini index e5cc81a..e8914a9 100644 --- a/_sakura/config/config.example.ini +++ b/_sakura/config/config.example.ini @@ -42,20 +42,17 @@ api = api.yourdomain.com ; Content location content = content.yourdomain.com -; Management panel location -manage = manage.yourdomain.com - -; Forum location -forum = forum.yourdomain.com - ; Chat location chat = chat.yourdomain.com ; Data files relative to the _sakura directory [data] -; File containing CloudFlare CIDRs -cfhosts = config/cloudflare.hosts +; File containing CloudFlare IPv4 CIDRs +cfipv4 = config/cloudflare.ipv4 + +; File containing CloudFlare IPv6 CIDRs +cfipv6 = config/cloudflare.ipv6 ; JSON file containing WHOIS servers whoisservers = config/whois.json diff --git a/_sakura/config/config.example.php b/_sakura/config/config.example.php index 6101736..1cb5fda 100644 --- a/_sakura/config/config.example.php +++ b/_sakura/config/config.example.php @@ -24,7 +24,8 @@ $sakuraConf['urls']['forum'] = 'forum.flashii.net'; // Forum url // Errata $sakuraConf['etc'] = array(); -$sakuraConf['etc']['cfhosts'] = ROOT .'_sakura/config/cloudflare.hosts'; // Cloudflare IP subnets file +$sakuraConf['etc']['cfipv4'] = ROOT .'_sakura/config/cloudflare.ipv4'; // Cloudflare IPv4 subnets file +$sakuraConf['etc']['cfipv6'] = ROOT .'_sakura/config/cloudflare.ipv6'; // Cloudflare IPv6 subnets file $sakuraConf['etc']['whoisservers'] = ROOT .'_sakura/config/whois.json'; // JSON with Whois servers $sakuraConf['etc']['iso3166'] = ROOT .'_sakura/config/iso3166.json'; // JSON with country codes diff --git a/_sakura/sakura.php b/_sakura/sakura.php index e967825..366115b 100644 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -8,7 +8,7 @@ namespace Sakura; // Define Sakura version -define('SAKURA_VERSION', '20150524'); +define('SAKURA_VERSION', '20150525'); define('SAKURA_VLABEL', 'Eminence'); define('SAKURA_VTYPE', 'Development'); define('SAKURA_COLOUR', '#6C3082'); @@ -75,7 +75,10 @@ $renderData = array( 'sitetags' => implode(", ", json_decode(Configuration::getConfig('sitetags'), true)), 'cookieprefix' => Configuration::getConfig('cookie_prefix'), 'cookiedomain' => Configuration::getConfig('cookie_domain'), - 'cookiepath' => Configuration::getConfig('cookie_path') + 'cookiepath' => Configuration::getConfig('cookie_path'), + 'minpwdentropy' => Configuration::getConfig('min_entropy'), + 'minusernamelength' => Configuration::getConfig('username_min_length'), + 'maxusernamelength' => Configuration::getConfig('username_max_length') ], 'php' => [ 'sessionid' => \session_id(), diff --git a/_sakura/templates/yuuno/elements/indexPanel.tpl b/_sakura/templates/yuuno/elements/indexPanel.tpl index 031bf9a..f193685 100644 --- a/_sakura/templates/yuuno/elements/indexPanel.tpl +++ b/_sakura/templates/yuuno/elements/indexPanel.tpl @@ -11,11 +11,16 @@ {% if sakura.lockauth %}
Whoops!
You caught the site at the wrong moment! Right now registration and logging in is disabled for unspecified reasons. Sorry for the inconvenience but please try again later! + {% else %}
Welcome!
Welcome to Flashii! This is a site for a bunch of friends to hang out, nothing special. Anyone is pretty much welcome to register so why not have a go? - Register! - Login + {% endif %} {% endif %}
Stats
diff --git a/_sakura/templates/yuuno/global/header.tpl b/_sakura/templates/yuuno/global/header.tpl index e395709..8fad3d7 100644 --- a/_sakura/templates/yuuno/global/header.tpl +++ b/_sakura/templates/yuuno/global/header.tpl @@ -13,7 +13,6 @@ - {% if page.style %}