From 6a115001ba122c2084e28353e025f7c8c5f62335 Mon Sep 17 00:00:00 2001 From: rvelices Date: Thu, 12 Jan 2012 20:50:46 +0000 Subject: [PATCH] bug 2553 hide menubar/register on indentification page if gallery is locked or guest_access is false git-svn-id: http://piwigo.org/svn/trunk@12878 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/template/configuration.tpl | 2 +- identification.php | 12 ++++++++---- include/functions.inc.php | 17 ++++++++++------- language/en_UK/admin.lang.php | 1 - themes/default/template/about.tpl | 2 +- themes/default/template/comments.tpl | 2 +- themes/default/template/identification.tpl | 8 +++++--- themes/default/template/index.tpl | 2 +- themes/default/template/notification.tpl | 2 +- themes/default/template/picture.tpl | 2 +- themes/default/template/profile.tpl | 2 +- themes/default/template/search.tpl | 2 +- themes/default/template/tags.tpl | 2 +- themes/default/theme.css | 10 +++------- 14 files changed, 35 insertions(+), 31 deletions(-) diff --git a/admin/themes/default/template/configuration.tpl b/admin/themes/default/template/configuration.tpl index 982e20357..59ab62006 100644 --- a/admin/themes/default/template/configuration.tpl +++ b/admin/themes/default/template/configuration.tpl @@ -271,7 +271,7 @@ jQuery(document).ready(function () {
  • diff --git a/identification.php b/identification.php index 9a3128536..4a8e65e6b 100644 --- a/identification.php +++ b/identification.php @@ -2,7 +2,7 @@ // +-----------------------------------------------------------------------+ // | Piwigo - a PHP based photo gallery | // +-----------------------------------------------------------------------+ -// | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org | +// | Copyright(C) 2008-2012 Piwigo Team http://piwigo.org | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | // +-----------------------------------------------------------------------+ @@ -82,21 +82,25 @@ $template->set_filenames( array('identification'=>'identification.tpl') ); $template->assign( array( - 'U_LOST_PASSWORD' => get_root_url().'password.php', 'U_REDIRECT' => $redirect_to, 'F_LOGIN_ACTION' => get_root_url().'identification.php', 'authorize_remembering' => $conf['authorize_remembering'], )); -if ($conf['allow_user_registration']) +if (!$conf['gallery_locked'] && $conf['allow_user_registration']) { $template->assign('U_REGISTER', get_root_url().'register.php' ); } +if (!$conf['gallery_locked']) +{ + $template->assign('U_LOST_PASSWORD', get_root_url().'password.php' ); +} + // include menubar $themeconf = $template->get_template_vars('themeconf'); -if (!isset($themeconf['hide_menu_on']) OR !in_array('theIdentificationPage', $themeconf['hide_menu_on'])) +if (!$conf['gallery_locked'] && (!isset($themeconf['hide_menu_on']) OR !in_array('theIdentificationPage', $themeconf['hide_menu_on']))) { include( PHPWG_ROOT_PATH.'include/menubar.inc.php'); } diff --git a/include/functions.inc.php b/include/functions.inc.php index 85cf7c902..4647e8845 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -2,7 +2,7 @@ // +-----------------------------------------------------------------------+ // | Piwigo - a PHP based photo gallery | // +-----------------------------------------------------------------------+ -// | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org | +// | Copyright(C) 2008-2012 Piwigo Team http://piwigo.org | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | // +-----------------------------------------------------------------------+ @@ -1076,14 +1076,17 @@ SELECT param, value while ($row = pwg_db_fetch_assoc($result)) { - $conf[ $row['param'] ] = isset($row['value']) ? $row['value'] : ''; - - // If the field is true or false, the variable is transformed into a - // boolean value. - if ($conf[$row['param']] == 'true' or $conf[$row['param']] == 'false') + $val = isset($row['value']) ? $row['value'] : ''; + // If the field is true or false, the variable is transformed into a boolean value. + if ($val == 'true') { - $conf[ $row['param'] ] = get_boolean($conf[ $row['param'] ]); + $val = true; } + elseif ($val == 'false') + { + $val = false; + } + $conf[ $row['param'] ] = $val; } } diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php index 6917e1442..0412b5013 100644 --- a/language/en_UK/admin.lang.php +++ b/language/en_UK/admin.lang.php @@ -97,7 +97,6 @@ $lang['ACCESS_4'] = "Access to webmasters"; $lang['ACCESS_5'] = "No access"; $lang['Action'] = 'Action'; $lang['Actions'] = "Actions"; -$lang['Activate field "%s"'] = 'Activate field "%s"'; $lang['Activate icon "%s"'] = 'Activate icon "%s"'; $lang['Activate icon "new" next to albums and pictures'] = 'Activate icon "new" next to albums and pictures'; $lang['Activate Navigation Bar'] = 'Activate navigation bar'; diff --git a/themes/default/template/about.tpl b/themes/default/template/about.tpl index 407ca2839..f95713c13 100644 --- a/themes/default/template/about.tpl +++ b/themes/default/template/about.tpl @@ -1,5 +1,5 @@ {if isset($MENUBAR)}{$MENUBAR}{/if} -
    +