From 4929663437bb773bcb08cb8137cd78a5c578c91f Mon Sep 17 00:00:00 2001 From: Max Pozdeev Date: Tue, 8 Sep 2020 14:50:06 +0300 Subject: [PATCH] remove unnecessary need_auth() --- src/ajax.php | 3 +-- src/export.php | 1 - src/init.php | 2 +- src/settings.php | 2 +- src/setup.php | 2 +- src/themes/default/index.php | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ajax.php b/src/ajax.php index c6eb572..e81a055 100644 --- a/src/ajax.php +++ b/src/ajax.php @@ -15,7 +15,7 @@ $db = DBConnection::instance(); if(isset($_GET['loadLists'])) { - if (need_auth() && !is_logged()) $sqlWhere = 'WHERE published=1'; + if (!is_logged()) $sqlWhere = 'WHERE published=1'; else $sqlWhere = ''; $t = array(); $t['total'] = 0; @@ -571,7 +571,6 @@ function prepareTaskRow($r) function check_read_access($listId = null) { $db = DBConnection::instance(); - if(Config::get('password') == '') return true; if(is_logged()) return true; if($listId !== null) { diff --git a/src/export.php b/src/export.php index 2c360f9..0a07ed0 100644 --- a/src/export.php +++ b/src/export.php @@ -38,7 +38,6 @@ else printCSV($listData, $data); function have_write_access() { - if(Config::get('password') == '') return true; if(is_logged()) return true; return false; } diff --git a/src/init.php b/src/init.php index 59df7bb..729998a 100644 --- a/src/init.php +++ b/src/init.php @@ -94,7 +94,7 @@ function is_logged() function is_readonly() { - if (need_auth() && !is_logged()) return true; + if ( !is_logged() ) return true; return false; } diff --git a/src/settings.php b/src/settings.php index 739bcac..e07f25a 100644 --- a/src/settings.php +++ b/src/settings.php @@ -10,7 +10,7 @@ require_once('./init.php'); $lang = Lang::instance(); -if (need_auth() && !is_logged()) +if ( !is_logged() ) { die("Access denied!
Disable password protection or Log in."); } diff --git a/src/setup.php b/src/setup.php index 47156d2..2f85ec5 100644 --- a/src/setup.php +++ b/src/setup.php @@ -27,7 +27,7 @@ if(!isset($config['db'])) if($config['db'] != '') { require_once('./init.php'); - if (need_auth() && !is_logged()) + if ( !is_logged() ) { die("Access denied!
Disable password protection or Log in."); } diff --git a/src/themes/default/index.php b/src/themes/default/index.php index 95ada7c..62dbf3e 100644 --- a/src/themes/default/index.php +++ b/src/themes/default/index.php @@ -30,7 +30,7 @@ $().ready(function(){ mttUrl: "", db: mytinytodoStorageAjax, needAuth: , - isLogged: , + isLogged: , showdate: , singletab: , duedatepickerformat: "",