Skip to content

Firefly III: a personal finances manager

Various code cleanup.

James Cole654b9d202216
diff --git a/.sandstorm/setup.sh b/.sandstorm/setup.sh
index 6fe9839169..1d3129e6af 100755
--- a/.sandstorm/setup.sh
+++ b/.sandstorm/setup.sh
@@ -19,6 +19,8 @@ sed -i 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/g' /etc/locale.gen
dpkg-reconfigure --frontend=noninteractive locales
+
+
# actually add repository
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E9C74FEEA2098A6E
add-apt-repository "deb http://packages.dotdeb.org jessie all"
@@ -37,6 +39,10 @@ service mysql stop
systemctl disable nginx
systemctl disable php7.1-fpm
systemctl disable mysql
+
+# make php.ini display errors:
+sed -i 's/display_errors = Off/display_errors = On/g' /etc/php/7.1/fpm/php.ini
+
# patch /etc/php/7.1/fpm/pool.d/www.conf to not change uid/gid to www-data
sed --in-place='' \
--expression='s/^listen.owner = www-data/;listen.owner = www-data/' \
@@ -72,3 +78,5 @@ cat <<EOF > /etc/mysql/conf.d/sandstorm.cnf
# Set the main data file to grow by 1MB at a time, rather than 8MB at a time.
innodb_autoextend_increment = 1
EOF
+
+
diff --git a/app/Http/Middleware/StartFireflySession.php b/app/Http/Middleware/StartFireflySession.php
index ed432ad1b7..e354451512 100644
--- a/app/Http/Middleware/StartFireflySession.php
+++ b/app/Http/Middleware/StartFireflySession.php
@@ -48,20 +48,20 @@ class StartFireflySession extends StartSession
// return parent::handle($request, $next); // defer to the right stuff
// }
-// /**
-// * Store the current URL for the request if necessary.
-// *
-// * @param \Illuminate\Http\Request $request
-// * @param \Illuminate\Contracts\Session\Session $session
-// *
-// * @return void
-// */
-// protected function storeCurrentUrl(Request $request, $session)
-// {
-// $uri = $request->fullUrl();
-// $strpos = strpos($uri, 'jscript');
-// if ($request->method() === 'GET' && $request->route() && !$request->ajax() && $strpos === false) {
-// $session->setPreviousUrl($uri);
-// }
-// }
+ /**
+ * Store the current URL for the request if necessary.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Illuminate\Contracts\Session\Session $session
+ *
+ * @return void
+ */
+ protected function storeCurrentUrl(Request $request, $session)
+ {
+ $uri = $request->fullUrl();
+ $strpos = strpos($uri, 'jscript');
+ if ($request->method() === 'GET' && $request->route() && !$request->ajax() && $strpos === false) {
+ $session->setPreviousUrl($uri);
+ }
+ }
}
\ No newline at end of file
diff --git a/public/js/ff/firefly.js b/public/js/ff/firefly.js
index 4f10b9418c..5b45995fd1 100644
--- a/public/js/ff/firefly.js
+++ b/public/js/ff/firefly.js
@@ -65,7 +65,8 @@ $(function () {
$.post(dateRangeMeta.uri, {
start: start.format('YYYY-MM-DD'),
end: end.format('YYYY-MM-DD'),
- label: label
+ label: label,
+ _token: token
}).done(function () {
window.location.reload(true);
}).fail(function () {
diff --git a/public/js/ff/index.js b/public/js/ff/index.js
index fcfb57f14f..60b906cc0d 100644
--- a/public/js/ff/index.js
+++ b/public/js/ff/index.js
@@ -102,26 +102,4 @@ function getBalanceBox() {
$('#box-balance-in').html(data.income);
$('#box-balance-out').html(data.expense);
});
-}
-
-
-function getBoxAmounts() {
- "use strict";
- var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
- for (var x in boxes) {
- if (!boxes.hasOwnProperty(x)) {
- continue;
- }
- var box = boxes[x];
- $.getJSON('json/box/' + box).done(putData).fail(failData);
- }
-}
-
-function putData(data) {
- "use strict";
- $('#box-' + data.box).html(data.amount);
-}
-
-function failData() {
- "use strict";
}
\ No newline at end of file