mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
fixes #2345 create piwigo standard pages
create new theme standard pages with tpl, css, js and images update backend to handle pages add config use_standard_pages on update set config to false, on install set config to true add standard pages to no be ingored in git
This commit is contained in:
+40
-5
@@ -29,20 +29,20 @@ if (isset($_POST['submit']))
|
||||
if (!verify_ephemeral_key(@$_POST['key']))
|
||||
{
|
||||
set_status_header(403);
|
||||
$page['errors'][] = l10n('Invalid/expired form key');
|
||||
$page['errors']['register_page_error'][] = l10n('Invalid/expired form key');
|
||||
}
|
||||
|
||||
if(empty($_POST['password']))
|
||||
{
|
||||
$page['errors'][] = l10n('Password is missing. Please enter the password.');
|
||||
$page['errors']['register_form_error'] = l10n('Password is missing. Please enter the password.');
|
||||
}
|
||||
else if(empty($_POST['password_conf']))
|
||||
{
|
||||
$page['errors'][] = l10n('Password confirmation is missing. Please confirm the chosen password.');
|
||||
$page['errors']['register_form_error'] = l10n('Password confirmation is missing. Please confirm the chosen password.');
|
||||
}
|
||||
else if ($_POST['password'] != $_POST['password_conf'])
|
||||
{
|
||||
$page['errors'][] = l10n('The passwords do not match');
|
||||
$page['errors']['register_form_error'] = l10n('The passwords do not match');
|
||||
}
|
||||
|
||||
register_user(
|
||||
@@ -92,7 +92,7 @@ $template->assign(array(
|
||||
'F_LOGIN' => $login,
|
||||
'F_EMAIL' => $email,
|
||||
'obligatory_user_mail_address' => $conf['obligatory_user_mail_address'],
|
||||
));
|
||||
));
|
||||
|
||||
// include menubar
|
||||
$themeconf = $template->get_template_vars('themeconf');
|
||||
@@ -101,6 +101,41 @@ if (!isset($themeconf['hide_menu_on']) OR !in_array('theRegisterPage', $themecon
|
||||
include( PHPWG_ROOT_PATH.'include/menubar.inc.php');
|
||||
}
|
||||
|
||||
//Load language if cookie is set from login/register/password pages
|
||||
if (isset($_COOKIE['lang']) and $user['language'] != $_COOKIE['lang'])
|
||||
{
|
||||
if (!array_key_exists($_COOKIE['lang'], get_languages()))
|
||||
{
|
||||
fatal_error('[Hacking attempt] the input parameter "'.$_COOKIE['lang'].'" is not valid');
|
||||
}
|
||||
|
||||
$user['language'] = $_COOKIE['lang'];
|
||||
load_language('common.lang', '', array('language'=>$user['language']));
|
||||
}
|
||||
|
||||
//Get list of languages
|
||||
foreach (get_languages() as $language_code => $language_name)
|
||||
{
|
||||
$language_options[$language_code] = $language_name;
|
||||
}
|
||||
|
||||
$template->assign(array(
|
||||
'language_options' => $language_options,
|
||||
'current_language' => $user['language'],
|
||||
));
|
||||
|
||||
//Get link to doc
|
||||
if ('fr' == substr($user['language'], 0, 2))
|
||||
{
|
||||
$help_link = "https://doc-fr.piwigo.org/les-utilisateurs/se-connecter-a-piwigo";
|
||||
}
|
||||
else
|
||||
{
|
||||
$help_link = "https://doc.piwigo.org/managing-users/log-in-to-piwigo";
|
||||
}
|
||||
|
||||
$template->assign('HELP_LINK', $help_link);
|
||||
|
||||
include(PHPWG_ROOT_PATH.'include/page_header.php');
|
||||
trigger_notify('loc_end_register');
|
||||
flush_page_messages();
|
||||
|
||||
Reference in New Issue
Block a user