From 249630593cf1a2dc4f897a5f653aebf1fba840bb Mon Sep 17 00:00:00 2001 From: Daniel Lo Nigro Date: Thu, 5 Oct 2017 22:13:15 +1100 Subject: [PATCH] Sync repo with current state of code on prod (circa 2011) --- .gitignore | 5 +++++ application/bootstrap.php | 6 +++--- application/cache/.gitkeep | 0 application/classes/controller/account.php | 3 ++- application/classes/controller/url.php | 6 ++++++ application/classes/validate.php | 11 +++++++++++ application/logs/.gitkeep | 0 application/views/includes/url/shorten.php | 12 +++++++++++- application/views/template.php | 2 +- favicons/.gitkeep | 0 index.php | 4 +++- robots.txt | 0 12 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 .gitignore create mode 100644 application/cache/.gitkeep create mode 100644 application/classes/validate.php create mode 100644 application/logs/.gitkeep create mode 100644 favicons/.gitkeep create mode 100644 robots.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b507420 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +application/logs/ +favicons/ +forum/ +old/ +application/cache/ diff --git a/application/bootstrap.php b/application/bootstrap.php index f607299..f596a1f 100644 --- a/application/bootstrap.php +++ b/application/bootstrap.php @@ -40,7 +40,7 @@ ini_set('unserialize_callback_func', 'spl_autoload_call'); /** * Set the production status based on domain */ -define('IN_PRODUCTION', !in_array($_SERVER['HTTP_HOST'], array('dev.zurl.ws:82', 'customzurltest.local', 'customzurltest2.local'))); +define('IN_PRODUCTION', $_SERVER['HTTP_HOST'] != 'dev.zurl.ws:82'); //-- Configuration and initialization ----------------------------------------- @@ -59,9 +59,9 @@ define('IN_PRODUCTION', !in_array($_SERVER['HTTP_HOST'], array('dev.zurl.ws:82', */ Kohana::init(array ( - 'base_url' => 'http://dev.zurl.ws:82/', + 'base_url' => 'http://zurl.ws/', 'index_file' => '', - 'profiling' => !IN_PRODUCTION, + 'profile' => !IN_PRODUCTION, 'caching' => IN_PRODUCTION, )); diff --git a/application/cache/.gitkeep b/application/cache/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/application/classes/controller/account.php b/application/classes/controller/account.php index 59212ad..1727750 100644 --- a/application/classes/controller/account.php +++ b/application/classes/controller/account.php @@ -69,6 +69,7 @@ class Controller_Account extends Controller_Template $page->errors = array(); $page->values = array('username' => '', 'email' => ''); + /* Shutdown Registration Temporarily // Did the user post the form? if ($_POST) { @@ -103,7 +104,7 @@ class Controller_Account extends Controller_Template // Let's grab the errors $page->errors = $user->validate()->errors('register'); $page->values = $user->validate(); - } + }*/ } public function action_check_username() diff --git a/application/classes/controller/url.php b/application/classes/controller/url.php index f529dc2..2518930 100644 --- a/application/classes/controller/url.php +++ b/application/classes/controller/url.php @@ -12,6 +12,10 @@ class Controller_Url extends Controller_Template public function action_index() { + if ($_SERVER['HTTP_HOST'] === 'dl.vc') + { + $this->request->redirect('http://dan.cx/'); + } // Wrong domain? Redirect to the correct one. if (!in_array($_SERVER['HTTP_HOST'], array('zurl.ws', 'www.zurl.ws', 'dev.zurl.ws', 'dev.zurl.ws:82', 'staging.zurl.ws', 'pre.zurl.ws'))) $this->request->redirect('http://zurl.ws' . $_SERVER['REQUEST_URI']); @@ -345,6 +349,8 @@ Number of complaints: ' . $url->complaints; */ private static function exceeded_rate_limit() { + return true; // Temporary, to prevent spam + if (!Session::instance()->get('passed_captcha', false)) return true; diff --git a/application/classes/validate.php b/application/classes/validate.php new file mode 100644 index 0000000..ea68a4a --- /dev/null +++ b/application/classes/validate.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/application/logs/.gitkeep b/application/logs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/application/views/includes/url/shorten.php b/application/views/includes/url/shorten.php index 18dfb1a..e4cf2b6 100644 --- a/application/views/includes/url/shorten.php +++ b/application/views/includes/url/shorten.php @@ -3,7 +3,16 @@ defined('SYSPATH') or die('No direct script access.'); Form::show_errors($errors); ?> - 'shorten')); ?> + + 'shorten')); ?> + + +Due to spam, users are now required to create an account to use zURL. Sorry for the inconvenience. + + +


@@ -57,4 +66,5 @@ Form::show_errors($errors);

+ diff --git a/application/views/template.php b/application/views/template.php index d86da9e..13068f3 100644 --- a/application/views/template.php +++ b/application/views/template.php @@ -2,7 +2,7 @@ - + diff --git a/favicons/.gitkeep b/favicons/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/index.php b/index.php index 9e877a5..8da312e 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,7 @@ = 5.3, it is recommended to disable * deprecated notices. Disable with: E_ALL & ~E_DEPRECATED */ -error_reporting(E_ALL | E_STRICT); +error_reporting(E_ALL & ~E_DEPRECATED); /** * End of standard configuration! Changing any of the code below should only be diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..e69de29