diff options
-rw-r--r-- | admin/include/configuration_watermark_process.inc.php | 35 | ||||
-rw-r--r-- | admin/themes/default/template/permalinks.tpl | 9 | ||||
-rw-r--r-- | identification.php | 6 | ||||
-rw-r--r-- | install/config.sql | 2 | ||||
-rw-r--r-- | language/en_UK/common.lang.php | 3 | ||||
-rw-r--r-- | language/en_UK/upgrade.lang.php | 3 | ||||
-rw-r--r-- | language/fr_FR/common.lang.php | 5 | ||||
-rw-r--r-- | language/fr_FR/upgrade.lang.php | 3 | ||||
-rw-r--r-- | upgrade.php | 12 |
9 files changed, 54 insertions, 24 deletions
diff --git a/admin/include/configuration_watermark_process.inc.php b/admin/include/configuration_watermark_process.inc.php index bc1451791..0e07380a7 100644 --- a/admin/include/configuration_watermark_process.inc.php +++ b/admin/include/configuration_watermark_process.inc.php @@ -26,6 +26,21 @@ if( !defined("PHPWG_ROOT_PATH") ) die ("Hacking attempt!"); } +function get_watermark_filename($list, $candidate, $step = 0) +{ + global $change_name; + $change_name = $candidate; + if ($step != 0) + { + $change_name .= '-'.$step; + } + if (in_array($change_name, $list)) + { + return get_watermark_filename($list, $candidate, $step+1); + } + return $change_name.'.png'; +} + $errors = array(); $pwatermark = $_POST['w']; @@ -45,8 +60,22 @@ if (isset($_FILES['watermarkImage']) and !empty($_FILES['watermarkImage']['tmp_n $upload_dir = PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'watermarks'; if (mkgetdir($upload_dir, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR)) { - $new_name = get_filename_wo_extension($_FILES['watermarkImage']['name']).'.png'; - $file_path = $upload_dir.'/'.$new_name; + // file name may include exotic chars like single quote, we need a safe name + $new_name = str2url(get_filename_wo_extension($_FILES['watermarkImage']['name'])); + + // we need existing watermarks to avoid overwritting one + $watermark_files = array(); + if ( ($glob=glob(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'watermarks/*.png')) !== false) + { + foreach ($glob as $file) + { + $watermark_files[] = get_filename_wo_extension( + substr($file, strlen(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'watermarks/')) + ); + } + } + + $file_path = $upload_dir.'/'.get_watermark_filename($watermark_files, $new_name); if (move_uploaded_file($_FILES['watermarkImage']['tmp_name'], $file_path)) { @@ -183,4 +212,4 @@ else $template->assign('watermark', $pwatermark); $template->assign('ferrors', $errors); } -?>
\ No newline at end of file +?> diff --git a/admin/themes/default/template/permalinks.tpl b/admin/themes/default/template/permalinks.tpl index 8ec0f3a6d..15857e3ea 100644 --- a/admin/themes/default/template/permalinks.tpl +++ b/admin/themes/default/template/permalinks.tpl @@ -20,6 +20,13 @@ form fieldset p.actionButtons {margin-bottom:0} </style> {/literal} +{html_style} +[name="permalink"] { + width : 100%; + max-width : 600px; +} +{/html_style} + <div class="titrePage"> <h2>{'Permalinks'|@translate}</h2> </div> @@ -96,4 +103,4 @@ form fieldset p.actionButtons {margin-bottom:0} </tr> {/foreach} </table> -</fieldset>
\ No newline at end of file +</fieldset> diff --git a/identification.php b/identification.php index be22eb571..3e5ab1560 100644 --- a/identification.php +++ b/identification.php @@ -50,7 +50,7 @@ if (isset($_POST['login'])) $page['errors'][] = l10n('Cookies are blocked or not supported by your browser. You must enable cookies to connect.'); } else - { + { if ($conf['insensitive_case_logon'] == true) { $_POST['username'] = search_case_username($_POST['username']); @@ -58,14 +58,14 @@ if (isset($_POST['login'])) $redirect_to = isset($_POST['redirect']) ? urldecode($_POST['redirect']) : ''; $remember_me = isset($_POST['remember_me']) and $_POST['remember_me']==1; - + if ( try_log_user($_POST['username'], $_POST['password'], $remember_me) ) { redirect(empty($redirect_to) ? get_gallery_home_url() : $redirect_to); } else { - $page['errors'][] = l10n('Invalid password!'); + $page['errors'][] = l10n('Invalid username or password!'); } } } diff --git a/install/config.sql b/install/config.sql index d247b93c0..b1f8e17fe 100644 --- a/install/config.sql +++ b/install/config.sql @@ -15,7 +15,7 @@ INSERT INTO piwigo_config (param,value,comment) VALUES ('email_admin_on_comment_ INSERT INTO piwigo_config (param,value,comment) VALUES ('email_admin_on_comment_deletion','false','Send an email to the administrators when a comment is deleted'); INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_locked','false','Lock your gallery temporary for non admin users'); INSERT INTO piwigo_config (param,value,comment) VALUES ('gallery_title','','Title at top of each page and for RSS feed'); -INSERT INTO piwigo_config (param,value,comment) VALUES ('rate','true','Rating pictures feature is enabled'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('rate','false','Rating pictures feature is enabled'); INSERT INTO piwigo_config (param,value,comment) VALUES ('rate_anonymous','true','Rating pictures feature is also enabled for visitors'); INSERT INTO piwigo_config (param,value,comment) VALUES ('page_banner','','html displayed on the top each page of your gallery'); INSERT INTO piwigo_config (param,value,comment) VALUES ('history_admin','false','keep a history of administrator visits on your website'); diff --git a/language/en_UK/common.lang.php b/language/en_UK/common.lang.php index 51ce58551..282a289b1 100644 --- a/language/en_UK/common.lang.php +++ b/language/en_UK/common.lang.php @@ -426,4 +426,5 @@ $lang['Album name, A → Z'] = 'Album name, A → Z'; $lang['Album name, Z → A'] = 'Album name, Z → A'; $lang['Link: %s'] = 'Link: %s'; $lang['Your authentication key is no longer valid.'] = 'Your authentication key is no longer valid.'; -?>
\ No newline at end of file +$lang['Invalid username or password!'] = 'Invalid username or password!'; +?> diff --git a/language/en_UK/upgrade.lang.php b/language/en_UK/upgrade.lang.php index f279fe618..221336482 100644 --- a/language/en_UK/upgrade.lang.php +++ b/language/en_UK/upgrade.lang.php @@ -40,4 +40,5 @@ $lang['User permissions and group permissions have been erased'] = "Users and gr $lang['Only thumbnails prefix and webmaster mail address have been saved from previous configuration'] = "Only thumbnails prefix and webmaster mail address have been saved from previous configuration"; $lang['In <i>%s</i>, before <b>?></b>, insert:'] = 'In <i>%s</i>, before <b>?></b>, insert:'; $lang['As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:'] = 'As a precaution, the following themes have been deactivated. You must check for upgradable themes before reactivating them:'; -?>
\ No newline at end of file +$lang['Discover what\'s new in Piwigo %s'] = 'Discover what\'s new in Piwigo %s'; +?> diff --git a/language/fr_FR/common.lang.php b/language/fr_FR/common.lang.php index c70dbf183..bf890246e 100644 --- a/language/fr_FR/common.lang.php +++ b/language/fr_FR/common.lang.php @@ -268,7 +268,7 @@ $lang['Quick connect'] = 'Connexion rapide'; $lang['Quick search'] = 'Recherche rapide'; $lang['Random photos'] = 'Photos au hasard'; $lang['Rank'] = 'Rang'; -$lang['Rate this photo'] = 'Votez pour cette photo'; +$lang['Rate this photo'] = 'Notez cette photo'; $lang['Rating score'] = 'Score'; $lang['Recent albums'] = 'Albums récents'; $lang['Recent period must be a positive integer value'] = 'La période de nouveautés doit être un entier positif'; @@ -425,4 +425,5 @@ $lang['Photo description'] = 'Description de la photo'; $lang['Album name, A → Z'] = 'Nom de l\'album, A → Z'; $lang['Album name, Z → A'] = 'Nom de l\'album, Z → A'; $lang['Link: %s'] = 'Lien: %s'; -$lang['Your authentication key is no longer valid.'] = 'Votre clef d\'identification n\'est plus valide.';
\ No newline at end of file +$lang['Your authentication key is no longer valid.'] = 'Votre clef d\'identification n\'est plus valide.'; +$lang['Invalid username or password!'] = 'Nom d\'utilisateur ou mot de passe invalide !'; diff --git a/language/fr_FR/upgrade.lang.php b/language/fr_FR/upgrade.lang.php index 6c2d6b556..f831a65dc 100644 --- a/language/fr_FR/upgrade.lang.php +++ b/language/fr_FR/upgrade.lang.php @@ -41,4 +41,5 @@ $lang['User permissions and group permissions have been erased'] = "Les permissi $lang['Only thumbnails prefix and webmaster mail address have been saved from previous configuration'] = "Seuls le préfixe des miniatures et l'adresse email du webmestre ont étés conservés de la précédente configuration"; $lang['In <i>%s</i>, before <b>?></b>, insert:'] = 'Dans le fichier <i>%s</i>, avant <b>?></b>, insérez:'; $lang['As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:'] = 'Par précaution, les thèmes suivants ont été désactivés. Vérifiez s\'il existe des mises à jour avant de les réactiver:'; -?>
\ No newline at end of file +$lang['Discover what\'s new in Piwigo %s'] = 'Quoi de neuf dans cette version %s ?'; +?> diff --git a/upgrade.php b/upgrade.php index 11b745b6d..6d7c12638 100644 --- a/upgrade.php +++ b/upgrade.php @@ -466,22 +466,12 @@ REPLACE INTO '.PLUGINS_TABLE.' if (file_exists(PHPWG_PLUGINS_PATH .'TakeATour/tours/'.$version_.'/config.inc.php')) { - load_language( - 'plugin.lang', - PHPWG_PLUGINS_PATH.'TakeATour/', - array( - 'language' => $language, - 'force_fallback'=>'en_UK', - ) - ); - // we need the secret key for get_pwg_token() load_conf_from_db(); $template->assign( array( - // TODO find a better way to do that, with a core string in English - 'button_label' => str_replace('2.7', get_branch_from_version(PHPWG_VERSION), l10n('2_7_0_descrp')), + 'button_label' => l10n('Discover what\'s new in Piwigo %s', get_branch_from_version(PHPWG_VERSION)), 'button_link' => 'admin.php?submited_tour_path=tours/'.$version_.'&pwg_token='.get_pwg_token(), ) ); |