mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
remove unnecessary need_auth()
This commit is contained in:
parent
bd698949a5
commit
4929663437
6 changed files with 5 additions and 7 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ function is_logged()
|
|||
|
||||
function is_readonly()
|
||||
{
|
||||
if (need_auth() && !is_logged()) return true;
|
||||
if ( !is_logged() ) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ require_once('./init.php');
|
|||
|
||||
$lang = Lang::instance();
|
||||
|
||||
if (need_auth() && !is_logged())
|
||||
if ( !is_logged() )
|
||||
{
|
||||
die("Access denied!<br/> Disable password protection or Log in.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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!<br> Disable password protection or Log in.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ $().ready(function(){
|
|||
mttUrl: "<?php mttinfo('mtt_url'); ?>",
|
||||
db: mytinytodoStorageAjax,
|
||||
needAuth: <?php echo need_auth() ? "true" : "false"; ?>,
|
||||
isLogged: <?php echo (need_auth() && is_logged()) ? "true" : "false"; ?>,
|
||||
isLogged: <?php echo is_logged() ? "true" : "false"; ?>,
|
||||
showdate: <?php echo (Config::get('showdate') && !Config::get('mobile')) ? "true" : "false"; ?>,
|
||||
singletab: <?php echo (isset($_GET['singletab']) || Config::get('mobile')) ? "true" : "false"; ?>,
|
||||
duedatepickerformat: "<?php echo htmlspecialchars(Config::get('dateformat2')); ?>",
|
||||
|
|
|
|||
Loading…
Reference in a new issue