From 74e5d80e899562b6505ce7c4865041448b22470d Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 13 Dec 2006 01:05:38 +0000 Subject: - feature 599: option to forbid user registration - 1 language cleanup - added page_forbidden function (sends 403) git-svn-id: http://piwigo.org/svn/trunk@1652 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/configuration.php | 3 ++- identification.php | 9 ++++++--- include/functions_html.inc.php | 17 +++++++++++++++++ include/menubar.inc.php | 6 +++++- install/config.sql | 1 + language/en_UK.iso-8859-1/admin.lang.php | 2 +- language/fr_FR.iso-8859-1/admin.lang.php | 2 +- register.php | 6 ++++++ template/yoga/admin/configuration.tpl | 7 +++++++ template/yoga/admin/picture_modify.tpl | 4 ++-- template/yoga/default-layout.css | 1 + template/yoga/identification.tpl | 8 ++++++-- template/yoga/menubar.tpl | 4 +++- 13 files changed, 58 insertions(+), 12 deletions(-) diff --git a/admin/configuration.php b/admin/configuration.php index 50c001820..1f15b7a1d 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -52,7 +52,8 @@ $general_checkboxes = array( 'history_admin', 'history_guest', 'login_history', - 'email_admin_on_new_user' + 'email_admin_on_new_user', + 'allow_user_registration', ); $comments_checkboxes = array( diff --git a/identification.php b/identification.php index 7a444dd51..86a5ba5a6 100644 --- a/identification.php +++ b/identification.php @@ -57,8 +57,7 @@ SELECT '.$conf['user_fields']['id'].' AS id, if ($row['password'] == $conf['pass_convert']($_POST['password'])) { $remember_me = false; - if ($conf['authorize_remembering'] - and isset($_POST['remember_me']) + if (isset($_POST['remember_me']) and $_POST['remember_me'] == 1) { $remember_me = true; @@ -85,7 +84,6 @@ $template->set_filenames( array('identification'=>'identification.tpl') ); $template->assign_vars( array( - 'U_REGISTER' => PHPWG_ROOT_PATH.'register.php', 'U_LOST_PASSWORD' => PHPWG_ROOT_PATH.'password.php', 'U_HOME' => make_index_url(), @@ -98,6 +96,11 @@ if ($conf['authorize_remembering']) { $template->assign_block_vars('remember_me',array()); } +if ($conf['allow_user_registration']) +{ + $template->assign_block_vars('register',array()); +} + //-------------------------------------------------------------- errors display if ( sizeof( $errors ) != 0 ) { diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index f3ad7f700..39f738f3f 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -613,6 +613,23 @@ function access_denied() } } +/** + * exits the current script with 403 code + * @param string msg a message to display + * @param string alternate_url redirect to this url + */ +function page_forbidden($msg, $alternate_url=null) +{ + set_status_header(403); + if ($alternate_url==null) + $alternate_url = make_index_url(); + redirect_html( $alternate_url, + '
+

Forbidden


' +.$msg.'
', + 5 ); +} + /** * exits the current script with 404 code when a page cannot be found * @param string msg a message to display diff --git a/include/menubar.inc.php b/include/menubar.inc.php index c360b2600..c149b3553 100755 --- a/include/menubar.inc.php +++ b/include/menubar.inc.php @@ -206,7 +206,6 @@ $template->assign_block_vars( if ($user['is_the_guest']) { - $template->assign_block_vars('register', array()); $template->assign_block_vars('login', array()); $template->assign_block_vars('quickconnect', array()); @@ -214,6 +213,11 @@ if ($user['is_the_guest']) { $template->assign_block_vars('quickconnect.remember_me', array()); } + if ($conf['allow_user_registration']) + { + $template->assign_block_vars('register', array()); + $template->assign_block_vars('quickconnect.register', array()); + } } else { diff --git a/install/config.sql b/install/config.sql index e68887ac9..150acb124 100644 --- a/install/config.sql +++ b/install/config.sql @@ -22,6 +22,7 @@ INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('page_banner',' +
  • + +
  • +
  • diff --git a/template/yoga/admin/picture_modify.tpl b/template/yoga/admin/picture_modify.tpl index c10e7744e..28981589f 100644 --- a/template/yoga/admin/picture_modify.tpl +++ b/template/yoga/admin/picture_modify.tpl @@ -23,7 +23,7 @@ - {lang:Registration date} + {lang:Post date} {REGISTRATION_DATE} @@ -103,7 +103,7 @@ {TAG_SELECTION} - + {lang:Description} diff --git a/template/yoga/default-layout.css b/template/yoga/default-layout.css index afe4cf525..d246e32b8 100644 --- a/template/yoga/default-layout.css +++ b/template/yoga/default-layout.css @@ -181,6 +181,7 @@ FORM.properties LI, FORM#update UL { margin-bottom: 0.5em; padding: 0; line-height: 1.8em; + clear: left; } FORM.properties SPAN.property { diff --git a/template/yoga/identification.tpl b/template/yoga/identification.tpl index 7c8f6e0c3..6f364da23 100644 --- a/template/yoga/identification.tpl +++ b/template/yoga/identification.tpl @@ -4,7 +4,9 @@
    • {lang:Forgot your password?}
    • +
    • {lang:register}
    • +
    • {lang:home}

    {lang:Identification}

    @@ -60,8 +62,10 @@ document.login_form.username.focus(); //-->

    - {lang:Register} - {lang:Forgot your password?} + + {lang:Register} + + {lang:Forgot your password?}

    diff --git a/template/yoga/menubar.tpl b/template/yoga/menubar.tpl index dd3b72390..eafec20a6 100644 --- a/template/yoga/menubar.tpl +++ b/template/yoga/menubar.tpl @@ -79,7 +79,7 @@
    -- cgit v1.2.3