aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2016-03-08 10:48:00 +0100
committerplegall <plg@piwigo.org>2016-03-08 10:48:00 +0100
commitf9fecd0be09ea6da405f1ab2a09e09bc51312dd4 (patch)
tree681f9b4cbbed109beb41ca4babf0662dc814f8c4
parentf5d0f09a20da71d51ed4d85da2d2c12698b11b6b (diff)
parentd80d853a23119bd21c20ad92024cba5dce47e7d4 (diff)
Merge branch 'master' into translation
-rw-r--r--admin/history.php2
-rw-r--r--admin/include/functions.php19
-rw-r--r--admin/include/functions_metadata.php22
-rw-r--r--admin/include/functions_upload.inc.php2
-rw-r--r--admin/include/photos_add_direct_prepare.inc.php26
-rw-r--r--admin/maintenance.php40
-rw-r--r--admin/themes/default/template/photos_add_direct.tpl5
-rw-r--r--admin/themes/default/template/user_list.tpl4
-rw-r--r--admin/user_list.php12
-rw-r--r--include/config_default.inc.php14
-rw-r--r--include/constants.php2
-rw-r--r--include/functions.inc.php13
-rw-r--r--include/functions_search.inc.php47
-rw-r--r--include/functions_session.inc.php16
-rw-r--r--include/functions_user.inc.php25
-rw-r--r--include/ws_functions.inc.php4
-rw-r--r--include/ws_functions/pwg.categories.php42
-rw-r--r--include/ws_functions/pwg.users.php26
-rw-r--r--install.php8
-rw-r--r--install/upgrade_2.6.0.php2
-rw-r--r--install/upgrade_2.7.0.php126
-rw-r--r--language/af_ZA/common.lang.php2
-rw-r--r--language/ar_EG/common.lang.php2
-rw-r--r--language/ar_MA/common.lang.php2
-rw-r--r--language/ar_SA/common.lang.php2
-rw-r--r--language/az_AZ/common.lang.php2
-rw-r--r--language/bg_BG/common.lang.php2
-rw-r--r--language/bn_IN/common.lang.php2
-rw-r--r--language/br_FR/common.lang.php2
-rw-r--r--language/ca_ES/common.lang.php2
-rw-r--r--language/cs_CZ/common.lang.php2
-rw-r--r--language/da_DK/common.lang.php2
-rw-r--r--language/de_DE/common.lang.php2
-rw-r--r--language/dv_MV/common.lang.php2
-rw-r--r--language/el_GR/common.lang.php2
-rw-r--r--language/en_GB/common.lang.php2
-rw-r--r--language/en_UK/common.lang.php2
-rw-r--r--language/en_US/common.lang.php2
-rw-r--r--language/eo_EO/common.lang.php2
-rw-r--r--language/es_AR/common.lang.php2
-rw-r--r--language/es_ES/common.lang.php2
-rw-r--r--language/es_MX/common.lang.php2
-rw-r--r--language/et_EE/common.lang.php2
-rw-r--r--language/eu_ES/common.lang.php2
-rw-r--r--language/fa_IR/common.lang.php2
-rw-r--r--language/fi_FI/common.lang.php2
-rw-r--r--language/fr_CA/common.lang.php2
-rw-r--r--language/fr_FR/common.lang.php2
-rw-r--r--language/ga_IE/common.lang.php2
-rw-r--r--language/gl_ES/common.lang.php2
-rw-r--r--language/gu_IN/common.lang.php2
-rw-r--r--language/he_IL/common.lang.php2
-rw-r--r--language/hr_HR/common.lang.php2
-rw-r--r--language/hu_HU/common.lang.php2
-rw-r--r--language/id_ID/common.lang.php2
-rw-r--r--language/is_IS/common.lang.php2
-rw-r--r--language/it_IT/common.lang.php2
-rw-r--r--language/ja_JP/common.lang.php2
-rw-r--r--language/ka_GE/common.lang.php2
-rw-r--r--language/km_KH/common.lang.php2
-rw-r--r--language/kn_IN/common.lang.php2
-rw-r--r--language/ko_KR/common.lang.php2
-rw-r--r--language/kok_IN/common.lang.php2
-rw-r--r--language/lb_LU/common.lang.php2
-rw-r--r--language/lt_LT/common.lang.php2
-rw-r--r--language/lv_LV/common.lang.php2
-rw-r--r--language/mk_MK/common.lang.php2
-rw-r--r--language/mn_MN/common.lang.php2
-rw-r--r--language/ms_MY/common.lang.php2
-rw-r--r--language/nb_NO/common.lang.php2
-rw-r--r--language/nl_NL/common.lang.php2
-rw-r--r--language/nn_NO/common.lang.php2
-rw-r--r--language/pl_PL/common.lang.php2
-rw-r--r--language/pt_BR/common.lang.php2
-rw-r--r--language/pt_PT/common.lang.php2
-rw-r--r--language/ro_RO/common.lang.php2
-rw-r--r--language/ru_RU/common.lang.php2
-rw-r--r--language/sh_RS/common.lang.php2
-rw-r--r--language/sk_SK/common.lang.php2
-rw-r--r--language/sl_SI/common.lang.php2
-rw-r--r--language/sr_RS/common.lang.php2
-rw-r--r--language/sv_SE/common.lang.php2
-rw-r--r--language/ta_IN/common.lang.php2
-rw-r--r--language/th_TH/common.lang.php2
-rw-r--r--language/tr_TR/common.lang.php2
-rw-r--r--language/uk_UA/common.lang.php2
-rw-r--r--language/vi_VN/common.lang.php2
-rw-r--r--language/wo_SN/common.lang.php2
-rw-r--r--language/zh_CN/common.lang.php2
-rw-r--r--language/zh_HK/common.lang.php2
-rw-r--r--language/zh_TW/common.lang.php2
-rw-r--r--password.php2
-rw-r--r--profile.php2
-rw-r--r--search.php5
-rw-r--r--themes/Sylvia/themeconf.inc.php2
-rw-r--r--themes/clear/themeconf.inc.php2
-rw-r--r--themes/dark/themeconf.inc.php2
-rw-r--r--themes/default/js/plugins/piecon.js189
-rw-r--r--themes/default/js/plugins/piecon.min.js1
-rw-r--r--themes/default/template/navigation_bar.tpl16
-rw-r--r--themes/default/template/search.tpl3
-rw-r--r--themes/default/watermarks/copyright.pngbin5725 -> 9424 bytes
-rw-r--r--themes/elegant/themeconf.inc.php2
-rw-r--r--themes/smartpocket/themeconf.inc.php2
-rwxr-xr-xtools/pwg_rel_create.sh74
-rw-r--r--tools/replace_version.pl39
-rw-r--r--upgrade.php11
-rw-r--r--ws.php6
108 files changed, 812 insertions, 143 deletions
diff --git a/admin/history.php b/admin/history.php
index c2d3ecb9a..40648e4f6 100644
--- a/admin/history.php
+++ b/admin/history.php
@@ -50,7 +50,7 @@ else
$page['start'] = 0;
}
-$types = array('none', 'picture', 'high', 'other');
+$types = array_merge(array('none'), get_enums(HISTORY_TABLE, 'image_type'));
$display_thumbnails = array('no_display_thumbnail' => l10n('No display'),
'display_thumbnail_classic' => l10n('Classic display'),
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 4d3ccebe6..9a827d1d6 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -405,11 +405,7 @@ DELETE FROM '.$table.'
}
// purge of sessions
- $query = '
-DELETE FROM '.SESSIONS_TABLE.'
- WHERE data LIKE \'pwg_uid|i:'.(int)$user_id.';%\'
-;';
- pwg_query($query);
+ delete_user_sessions($user_id);
// destruction of the user
$query = '
@@ -2080,6 +2076,8 @@ function cat_admin_access($category_id)
*/
function fetchRemote($src, &$dest, $get_data=array(), $post_data=array(), $user_agent='Piwigo', $step=0)
{
+ global $conf;
+
// Try to retrieve data from local file?
if (!url_is_remote($src))
{
@@ -2115,6 +2113,17 @@ function fetchRemote($src, &$dest, $get_data=array(), $post_data=array(), $user_
if (function_exists('curl_init') && function_exists('curl_exec'))
{
$ch = @curl_init();
+
+ if (isset($conf['use_proxy']) && $conf['use_proxy'])
+ {
+ @curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 0);
+ @curl_setopt($ch, CURLOPT_PROXY, $conf['proxy_server']);
+ if (isset($conf['proxy_auth']) && !empty($conf['proxy_auth']))
+ {
+ @curl_setopt($ch, CURLOPT_PROXYUSERPWD, $conf['proxy_auth']);
+ }
+ }
+
@curl_setopt($ch, CURLOPT_URL, $src);
@curl_setopt($ch, CURLOPT_HEADER, 1);
@curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php
index 1b5b5bb73..01b453816 100644
--- a/admin/include/functions_metadata.php
+++ b/admin/include/functions_metadata.php
@@ -173,8 +173,24 @@ function get_sync_metadata($infos)
$infos['filesize'] = floor($fs/1024);
+ $is_tiff = false;
+
if (isset($infos['representative_ext']))
{
+ if ($image_size = @getimagesize($file))
+ {
+ $type = $image_size[2];
+
+ if (IMAGETYPE_TIFF_MM == $type or IMAGETYPE_TIFF_II == $type)
+ {
+ // in case of TIFF files, we want to use the original file and not
+ // the representative for EXIF/IPTC, but we need the representative
+ // for width/height (to compute the multiple size dimensions)
+ $is_tiff = true;
+ }
+
+ }
+
$file = original_to_representative($file, $infos['representative_ext']);
}
@@ -184,6 +200,12 @@ function get_sync_metadata($infos)
$infos['height'] = $image_size[1];
}
+ if ($is_tiff)
+ {
+ // back to original file
+ $file = PHPWG_ROOT_PATH.$infos['path'];
+ }
+
if ($conf['use_exif'])
{
$exif = get_sync_exif_data($file);
diff --git a/admin/include/functions_upload.inc.php b/admin/include/functions_upload.inc.php
index 17e78a200..900612fdd 100644
--- a/admin/include/functions_upload.inc.php
+++ b/admin/include/functions_upload.inc.php
@@ -535,7 +535,7 @@ function upload_file_video($representative_ext, $file_path)
$ffmpeg_video_exts = array( // extensions tested with FFmpeg
'wmv','mov','mkv','mp4','mpg','flv','asf','xvid','divx','mpeg',
- 'avi','rm',
+ 'avi','rm', 'm4v', 'ogg', 'ogv', 'webm', 'webmv',
);
if (!in_array(strtolower(get_extension($file_path)), $ffmpeg_video_exts))
diff --git a/admin/include/photos_add_direct_prepare.inc.php b/admin/include/photos_add_direct_prepare.inc.php
index 4d852fee4..a795247e3 100644
--- a/admin/include/photos_add_direct_prepare.inc.php
+++ b/admin/include/photos_add_direct_prepare.inc.php
@@ -25,25 +25,9 @@
// | Photo selection |
// +-----------------------------------------------------------------------+
-$upload_max_filesize = min(
- get_ini_size('upload_max_filesize'),
- get_ini_size('post_max_size')
- );
-
-if ($upload_max_filesize == get_ini_size('upload_max_filesize'))
-{
- $upload_max_filesize_shorthand = get_ini_size('upload_max_filesize', false);
-}
-else
-{
- $upload_max_filesize_shorthand = get_ini_size('post_max_filesize', false);
-}
-
$template->assign(
array(
'F_ADD_ACTION'=> PHOTOS_ADD_BASE_URL,
- 'upload_max_filesize' => $upload_max_filesize,
- 'upload_max_filesize_shorthand' => $upload_max_filesize_shorthand,
'chunk_size' => $conf['upload_form_chunk_size'],
)
);
@@ -222,6 +206,16 @@ if (!isset($_SESSION['upload_hide_warnings']))
get_ini_size('post_max_size', false)
);
}
+
+ if (get_ini_size('upload_max_filesize') < $conf['upload_form_chunk_size']*1024)
+ {
+ $setup_warnings[] = sprintf(
+ 'Piwigo setting upload_form_chunk_size (%ukB) should be smaller than PHP configuration setting upload_max_filesize (%ukB)',
+ $conf['upload_form_chunk_size'],
+ ceil(get_ini_size('upload_max_filesize') / 1024)
+ );
+ }
+
$template->assign(
array(
'setup_warnings' => $setup_warnings,
diff --git a/admin/maintenance.php b/admin/maintenance.php
index 9befd5032..3728d6094 100644
--- a/admin/maintenance.php
+++ b/admin/maintenance.php
@@ -109,6 +109,46 @@ DELETE
case 'sessions' :
{
pwg_session_gc();
+
+ // delete all sessions associated to invalid user ids (it should never happen)
+ $query = '
+SELECT
+ id,
+ data
+ FROM '.SESSIONS_TABLE.'
+;';
+ $sessions = query2array($query);
+
+ $query = '
+SELECT
+ '.$conf['user_fields']['id'].' AS id
+ FROM '.USERS_TABLE.'
+;';
+ $all_user_ids = query2array($query, 'id', null);
+
+ $sessions_to_delete = array();
+
+ foreach ($sessions as $session)
+ {
+ if (preg_match('/pwg_uid\|i:(\d+);/', $session['data'], $matches))
+ {
+ if (!isset($all_user_ids[ $matches[1] ]))
+ {
+ $sessions_to_delete[] = $session['id'];
+ }
+ }
+ }
+
+ if (count($sessions_to_delete) > 0)
+ {
+ $query = '
+DELETE
+ FROM '.SESSIONS_TABLE.'
+ WHERE id IN (\''.implode("','", $sessions_to_delete).'\')
+;';
+ pwg_query($query);
+ }
+
break;
}
case 'feeds' :
diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl
index 71663fc20..e9ea85473 100644
--- a/admin/themes/default/template/photos_add_direct.tpl
+++ b/admin/themes/default/template/photos_add_direct.tpl
@@ -21,7 +21,7 @@
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
-{combine_script id='piecon' load='footer' path='themes/default/js/plugins/piecon.min.js'}
+{combine_script id='piecon' load='footer' path='themes/default/js/plugins/piecon.js'}
{footer_script}
{* <!-- CATEGORIES --> *}
@@ -282,10 +282,9 @@ jQuery(document).ready(function(){
<p class="uploadInfo">{'The picture dimensions will be reduced to %dx%d pixels.'|@translate:$original_resize_maxwidth:$original_resize_maxheight}</p>
{/if}
- <p id="uploadWarningsSummary">{$upload_max_filesize_shorthand}B. {$upload_file_types}. {if isset($max_upload_resolution)}{$max_upload_resolution}Mpx{/if} <a class="icon-info-circled-1 showInfo" title="{'Learn more'|@translate}"></a></p>
+ <p id="uploadWarningsSummary">{$upload_file_types}. {if isset($max_upload_resolution)}{$max_upload_resolution}Mpx{/if} <a class="icon-info-circled-1 showInfo" title="{'Learn more'|@translate}"></a></p>
<p id="uploadWarnings">
- {'Maximum file size: %sB.'|@translate:$upload_max_filesize_shorthand}
{'Allowed file types: %s.'|@translate:$upload_file_types}
{if isset($max_upload_resolution)}
{'Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).'|@translate:$max_upload_resolution:$max_upload_width:$max_upload_height}
diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl
index 54b8b936e..dedf59cf6 100644
--- a/admin/themes/default/template/user_list.tpl
+++ b/admin/themes/default/template/user_list.tpl
@@ -28,6 +28,7 @@ var selection = [{$selection}];
var pwg_token = "{$PWG_TOKEN}";
var protectedUsers = [{$protected_users}];
+var passwordProtectedUsers = [{$password_protected_users}];
var guestUser = {$guest_user};
var truefalse = {
@@ -247,6 +248,7 @@ jQuery(document).ready(function() {
user.isGuest = (parseInt(userId) == guestUser);
user.isProtected = (protectedUsers.indexOf(parseInt(userId)) != -1);
+ user.isPasswordProtected = (passwordProtectedUsers.indexOf(parseInt(userId)) != -1);
user.registeredOn_string = sprintf(
registeredOn_pattern,
@@ -1051,7 +1053,7 @@ span.infos, span.errors {background-image:none; padding:2px 5px; margin:0;border
<script type="text/template" class="userDetails">
<form>
<div class="userActions">
-<% if (!user.isGuest) { %>
+<% if (!user.isPasswordProtected) { %>
<span class="changePasswordDone infos" style="display:none">&#x2714; {'Password updated'|translate}</span>
<span class="changePassword" style="display:none">{'New password'|translate} <input type="text"> <a href="#" class="buttonLike updatePassword"><img src="themes/default/images/ajax-loader-small.gif" style="margin-bottom:-1px;margin-left:1px;display:none;"><span class="text">{'Submit'|translate}</span></a> <a href="#" class="cancel">{'Cancel'|translate}</a></span>
<a class="icon-key changePasswordOpen" href="#">{'Change password'|translate}</a>
diff --git a/admin/user_list.php b/admin/user_list.php
index 183f771f7..6a7a0a2e8 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -100,6 +100,8 @@ $protected_users = array(
$conf['webmaster_id'],
);
+$password_protected_users = array($conf['guest_id']);
+
// an admin can't delete other admin/webmaster
if ('admin' == $user['status'])
{
@@ -109,7 +111,12 @@ SELECT
FROM '.USER_INFOS_TABLE.'
WHERE status IN (\'webmaster\', \'admin\')
;';
- $protected_users = array_merge($protected_users, query2array($query, null, 'user_id'));
+ $admin_ids = query2array($query, null, 'user_id');
+
+ $protected_users = array_merge($protected_users, $admin_ids);
+
+ // we add all admin+webmaster users BUT the user herself
+ $password_protected_users = array_merge($password_protected_users, array_diff($admin_ids, array($user['id'])));
}
$template->assign(
@@ -123,6 +130,7 @@ $template->assign(
'language_selected' => get_default_language(),
'association_options' => $groups,
'protected_users' => implode(',', array_unique($protected_users)),
+ 'password_protected_users' => implode(',', array_unique($password_protected_users)),
'guest_user' => $conf['guest_id'],
)
);
@@ -135,7 +143,7 @@ foreach (get_enums(USER_INFOS_TABLE, 'status') as $status)
$pref_status_options = $label_of_status;
-// a simple "admin" can set/remove statuses webmaster/admin
+// a simple "admin" can't set/remove statuses webmaster/admin
if ('admin' == $user['status'])
{
unset($pref_status_options['webmaster']);
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index f38942d15..f66dab486 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -832,4 +832,18 @@ $conf['log_level'] = 'DEBUG';
// Keep logs file during X days
$conf['log_archive_days'] = 30;
+
+// +-----------------------------------------------------------------------+
+// | Proxy Settings |
+// +-----------------------------------------------------------------------+
+
+// If piwigo needs a http-proxy to connect to the internet, set this to true
+$conf['use_proxy'] = false;
+
+// Connection string of the proxy
+$conf['proxy_server'] = 'proxy.domain.org:port';
+
+// If the http-proxy requires authentication, set username and password here
+// e.g. username:password
+$conf['proxy_auth'] = '';
?>
diff --git a/include/constants.php b/include/constants.php
index 8363f0d69..ab7c067c3 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
// Default settings
-define('PHPWG_VERSION', '2.8.0RC1');
+define('PHPWG_VERSION', '2.8.0RC2');
define('PHPWG_DEFAULT_LANGUAGE', 'en_UK');
define('PHPWG_DEFAULT_TEMPLATE', 'elegant');
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 0f26fde77..018747817 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -434,6 +434,17 @@ function pwg_log($image_id = null, $image_type = null, $format_id = null)
$tags_string = implode(',', $page['tag_ids']);
}
+ $ip = $_SERVER['REMOTE_ADDR'];
+ // In case of "too long" ipv6 address, we take only the 15 first chars.
+ //
+ // It would be "cleaner" to increase length of history.IP to 50 chars, but
+ // the alter table is very long on such a big table. We should plan this
+ // for a future version, once history table is kept "smaller".
+ if (strpos($ip,':') !== false and strlen($ip) > 15)
+ {
+ $ip = substr($ip, 0, 15);
+ }
+
$query = '
INSERT INTO '.HISTORY_TABLE.'
(
@@ -454,7 +465,7 @@ INSERT INTO '.HISTORY_TABLE.'
CURRENT_DATE,
CURRENT_TIME,
'.$user['id'].',
- \''.$_SERVER['REMOTE_ADDR'].'\',
+ \''.$ip.'\',
'.(isset($page['section']) ? "'".$page['section']."'" : 'NULL').',
'.(isset($page['category']['id']) ? $page['category']['id'] : 'NULL').',
'.(isset($image_id) ? $image_id : 'NULL').',
diff --git a/include/functions_search.inc.php b/include/functions_search.inc.php
index 69c57faa7..d8df4eea8 100644
--- a/include/functions_search.inc.php
+++ b/include/functions_search.inc.php
@@ -90,7 +90,7 @@ function get_sql_search_clause($search)
}
}
- if (isset($search['fields']['allwords']))
+ if (isset($search['fields']['allwords']) and count($search['fields']['allwords']['fields']) > 0)
{
$fields = array('file', 'name', 'comment');
@@ -98,7 +98,7 @@ function get_sql_search_clause($search)
{
$fields = array_intersect($fields, $search['fields']['allwords']['fields']);
}
-
+
// in the OR mode, request bust be :
// ((field1 LIKE '%word1%' OR field2 LIKE '%word1%')
// OR (field1 LIKE '%word2%' OR field2 LIKE '%word2%'))
@@ -199,7 +199,10 @@ function get_sql_search_clause($search)
*/
function get_regular_search_results($search, $images_where='')
{
- global $conf;
+ global $conf, $logger;
+
+ $logger->debug(__FUNCTION__, 'search', $search);
+
$forbidden = get_sql_condition_FandF(
array
(
@@ -213,12 +216,35 @@ function get_regular_search_results($search, $images_where='')
$items = array();
$tag_items = array();
+ if (isset($search['fields']['search_in_tags']))
+ {
+ $word_clauses = array();
+ foreach ($search['fields']['allwords']['words'] as $word)
+ {
+ $word_clauses[] = "name LIKE '%".$word."%'";
+ }
+
+ $query = '
+SELECT
+ id
+ FROM '.TAGS_TABLE.'
+ WHERE '.implode(' OR ', $word_clauses).'
+;';
+ $tag_ids = query2array($query, null, 'id');
+
+ $search_in_tags_items = get_image_ids_for_tags($tag_ids, 'OR');
+
+ $logger->debug(__FUNCTION__.' '.count($search_in_tags_items).' items in $search_in_tags_items');
+ }
+
if (isset($search['fields']['tags']))
{
$tag_items = get_image_ids_for_tags(
$search['fields']['tags']['words'],
$search['fields']['tags']['mode']
);
+
+ $logger->debug(__FUNCTION__.' '.count($tag_items).' items in $tag_items');
}
$search_clause = get_sql_search_clause($search);
@@ -237,6 +263,18 @@ SELECT DISTINCT(id)
$query .= $forbidden.'
'.$conf['order_by'];
$items = array_from_query($query, 'id');
+
+ $logger->debug(__FUNCTION__.' '.count($items).' items in $items');
+ }
+
+ if (isset($search_in_tags_items))
+ {
+ $items = array_unique(
+ array_merge(
+ $items,
+ $search_in_tags_items
+ )
+ );
}
if ( !empty($tag_items) )
@@ -244,7 +282,7 @@ SELECT DISTINCT(id)
switch ($search['mode'])
{
case 'AND':
- if (empty($search_clause))
+ if (empty($search_clause) and !isset($search_in_tags_items))
{
$items = $tag_items;
}
@@ -254,7 +292,6 @@ SELECT DISTINCT(id)
}
break;
case 'OR':
- $before_count = count($items);
$items = array_unique(
array_merge(
$items,
diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php
index 9c12e26c1..fe43bc570 100644
--- a/include/functions_session.inc.php
+++ b/include/functions_session.inc.php
@@ -260,4 +260,20 @@ function pwg_unset_session_var($var)
return true;
}
+/**
+ * delete all sessions for a given user (certainly deleted)
+ *
+ * @since 2.8
+ * @param int $user_id
+ * @return null
+ */
+function delete_user_sessions($user_id)
+{
+ $query = '
+DELETE
+ FROM '.SESSIONS_TABLE.'
+ WHERE data LIKE \'%pwg_uid|i:'.(int)$user_id.';%\'
+;';
+ pwg_query($query);
+}
?>
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index ac85d1b47..de8f87c7f 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -945,10 +945,13 @@ function log_user($user_id, $remember_me)
{ // make sure we clean any remember me ...
setcookie($conf['remember_me_name'], '', 0, cookie_path(),ini_get('session.cookie_domain'));
}
- if ( session_id()!="" and (version_compare(PHP_VERSION, '7') <= 0 or version_compare(PHP_VERSION, '7.0.3') >= 0))
+ if ( session_id()!="" )
{ // we regenerate the session for security reasons
// see http://www.acros.si/papers/session_fixation.pdf
- session_regenerate_id(true);
+ if (version_compare(PHP_VERSION, '7') <= 0)
+ {
+ session_regenerate_id(true);
+ }
}
else
{
@@ -1593,4 +1596,22 @@ SELECT
return create_user_auth_key($user_id, $user_status);
}
}
+
+/**
+ * Deactivates authentication keys
+ *
+ * @since 2.8
+ * @param int $user_id
+ * @return null
+ */
+function deactivate_user_auth_keys($user_id)
+{
+ $query = '
+UPDATE '.USER_AUTH_KEYS_TABLE.'
+ SET expired_on = NOW()
+ WHERE user_id = '.$user_id.'
+ AND expired_on > NOW()
+;';
+ pwg_query($query);
+}
?>
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index c36efec69..8834ac834 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -193,7 +193,7 @@ function ws_std_get_image_xml_attributes()
function ws_std_get_category_xml_attributes()
{
return array(
- 'id', 'url', 'nb_images', 'total_nb_images', 'nb_categories', 'date_last', 'max_date_last',
+ 'id', 'url', 'nb_images', 'total_nb_images', 'nb_categories', 'date_last', 'max_date_last', 'status',
);
}
@@ -235,4 +235,4 @@ function categories_flatlist_to_tree($categories)
return $tree;
}
-?> \ No newline at end of file
+?>
diff --git a/include/ws_functions/pwg.categories.php b/include/ws_functions/pwg.categories.php
index 5bafaf5da..502c8f18d 100644
--- a/include/ws_functions/pwg.categories.php
+++ b/include/ws_functions/pwg.categories.php
@@ -181,6 +181,11 @@ function ws_categories_getList($params, &$service)
{
global $user, $conf;
+ if (!in_array($params['thumbnail_size'], array_keys(ImageStdParams::get_defined_type_map())))
+ {
+ return new PwgError(WS_ERR_INVALID_PARAM, "Invalid thumbnail_size");
+ }
+
$where = array('1=1');
$join_type = 'INNER';
$join_user = $user['id'];
@@ -226,7 +231,7 @@ function ws_categories_getList($params, &$service)
$query = '
SELECT
- id, name, comment, permalink,
+ id, name, comment, permalink, status,
uppercats, global_rank, id_uppercat,
nb_images, count_images AS total_nb_images,
representative_picture_id, user_representative_picture_id, count_images, count_categories,
@@ -366,7 +371,7 @@ SELECT id, path, representative_ext, level
{
if ($row['level'] <= $user['level'])
{
- $thumbnail_src_of[$row['id']] = DerivativeImage::thumb_url($row);
+ $thumbnail_src_of[$row['id']] = DerivativeImage::url($params['thumbnail_size'], $row);
}
else
{
@@ -411,7 +416,7 @@ SELECT id, path, representative_ext
while ($row = pwg_db_fetch_assoc($result))
{
- $thumbnail_src_of[ $row['id'] ] = DerivativeImage::thumb_url($row);
+ $thumbnail_src_of[ $row['id'] ] = DerivativeImage::url($params['thumbnail_size'], $row);
}
}
}
@@ -489,7 +494,7 @@ SELECT category_id, COUNT(*) AS counter
$nb_images_of = query2array($query, 'category_id', 'counter');
$query = '
-SELECT id, name, comment, uppercats, global_rank, dir
+SELECT id, name, comment, uppercats, global_rank, dir, status
FROM '. CATEGORIES_TABLE .'
;';
$result = pwg_query($query);
@@ -529,7 +534,7 @@ SELECT id, name, comment, uppercats, global_rank, dir
'categories' => new PwgNamedArray(
$cats,
'category',
- array('id', 'nb_images', 'name', 'uppercats', 'global_rank')
+ array('id', 'nb_images', 'name', 'uppercats', 'global_rank', 'status')
)
);
}
@@ -586,6 +591,33 @@ function ws_categories_add($params, &$service)
*/
function ws_categories_setInfo($params, &$service)
{
+ // does the category really exist?
+ $query = '
+SELECT *
+ FROM '.CATEGORIES_TABLE.'
+ WHERE id = '.$params['category_id'].'
+;';
+ $categories = query2array($query);
+ if (count($categories) == 0)
+ {
+ return new PwgError(404, 'category_id not found');
+ }
+
+ $category = $categories[0];
+
+ if (!empty($params['status']))
+ {
+ if (!in_array($params['status'], array('private','public')))
+ {
+ return new PwgError(WS_ERR_INVALID_PARAM, "Invalid status, only public/private");
+ }
+
+ if ($params['status'] != $category['status'])
+ {
+ set_cat_status(array($params['category_id']), $params['status']);
+ }
+ }
+
$update = array(
'id' => $params['category_id'],
);
diff --git a/include/ws_functions/pwg.users.php b/include/ws_functions/pwg.users.php
index d878bcb31..eaa96c9c1 100644
--- a/include/ws_functions/pwg.users.php
+++ b/include/ws_functions/pwg.users.php
@@ -426,6 +426,27 @@ function ws_users_setInfo($params, &$service)
if (!empty($params['password']))
{
+ if (!is_webmaster())
+ {
+ $password_protected_users = array($conf['guest_id']);
+
+ $query = '
+SELECT
+ user_id
+ FROM '.USER_INFOS_TABLE.'
+ WHERE status IN (\'webmaster\', \'admin\')
+;';
+ $admin_ids = query2array($query, null, 'user_id');
+
+ // we add all admin+webmaster users BUT the user herself
+ $password_protected_users = array_merge($password_protected_users, array_diff($admin_ids, array($user['id'])));
+
+ if (in_array($params['user_id'][0], $password_protected_users))
+ {
+ return new PwgError(403, 'Only webmasters can change password of other "webmaster/admin" users');
+ }
+ }
+
$updates[ $conf['user_fields']['password'] ] = $conf['password_hash']($params['password']);
}
}
@@ -531,6 +552,11 @@ SELECT
array($conf['user_fields']['id'] => $params['user_id'][0])
);
+ if (isset($updates[ $conf['user_fields']['password'] ]))
+ {
+ deactivate_user_auth_keys($params['user_id'][0]);
+ }
+
if (isset($update_status) and count($params['user_id_for_status']) > 0)
{
$query = '
diff --git a/install.php b/install.php
index 579b1a431..475cf70f0 100644
--- a/install.php
+++ b/install.php
@@ -348,8 +348,12 @@ INSERT INTO '.$prefixeTable.'config (param,value,comment)
pwg_query($query);
conf_update_param('piwigo_db_version', get_branch_from_version(PHPWG_VERSION));
- conf_update_param('gallery_title', l10n('Just another Piwigo gallery'));
- conf_update_param('page_banner', '<h1>%gallery_title%</h1>'."\n\n<p>".l10n('Welcome to my photo gallery').'</p>');
+ conf_update_param('gallery_title', pwg_db_real_escape_string(l10n('Just another Piwigo gallery')));
+
+ conf_update_param(
+ 'page_banner',
+ '<h1>%gallery_title%</h1>'."\n\n<p>".pwg_db_real_escape_string(l10n('Welcome to my photo gallery')).'</p>'
+ );
// fill languages table
foreach ($languages->fs_languages as $language_code => $fs_language)
diff --git a/install/upgrade_2.6.0.php b/install/upgrade_2.6.0.php
index 7c6451e66..28ed3f151 100644
--- a/install/upgrade_2.6.0.php
+++ b/install/upgrade_2.6.0.php
@@ -122,5 +122,5 @@ echo '</pre>';
ob_end_clean();
// now we upgrade from 2.7.0
-// include_once(PHPWG_ROOT_PATH.'install/upgrade_2.7.0.php');
+include_once(PHPWG_ROOT_PATH.'install/upgrade_2.7.0.php');
?>
diff --git a/install/upgrade_2.7.0.php b/install/upgrade_2.7.0.php
new file mode 100644
index 000000000..128accdb8
--- /dev/null
+++ b/install/upgrade_2.7.0.php
@@ -0,0 +1,126 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2016 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 |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die ('This page cannot be loaded directly, load upgrade.php');
+}
+else
+{
+ if (!defined('PHPWG_IN_UPGRADE') or !PHPWG_IN_UPGRADE)
+ {
+ die ('Hacking attempt!');
+ }
+}
+
+// +-----------------------------------------------------------------------+
+// | Fill upgrade table without applying upgrade |
+// +-----------------------------------------------------------------------+
+
+// retrieve already applied upgrades
+$query = '
+SELECT id
+ FROM '.PREFIX_TABLE.'upgrade
+;';
+$applied = array_from_query($query, 'id');
+
+// retrieve existing upgrades
+$existing = get_available_upgrade_ids();
+
+// which upgrades need to be applied?
+$to_apply = array_diff($existing, $applied);
+$inserts = array();
+foreach ($to_apply as $upgrade_id)
+{
+ if ($upgrade_id >= 145) // TODO change on each release
+ {
+ break;
+ }
+
+ array_push(
+ $inserts,
+ array(
+ 'id' => $upgrade_id,
+ 'applied' => CURRENT_DATE,
+ 'description' => '[migration from 2.7.0 to '.PHPWG_VERSION.'] not applied', // TODO change on each release
+ )
+ );
+}
+
+if (!empty($inserts))
+{
+ mass_inserts(
+ '`'.UPGRADE_TABLE.'`',
+ array_keys($inserts[0]),
+ $inserts
+ );
+}
+
+// +-----------------------------------------------------------------------+
+// | Perform upgrades |
+// +-----------------------------------------------------------------------+
+
+ob_start();
+echo '<pre>';
+
+for ($upgrade_id = 145; $upgrade_id <= 148; $upgrade_id++) // TODO change on each release
+{
+ if (!file_exists(UPGRADES_PATH.'/'.$upgrade_id.'-database.php'))
+ {
+ continue;
+ }
+
+ // maybe the upgrade task has already been applied in a previous and
+ // incomplete upgrade
+ if (in_array($upgrade_id, $applied))
+ {
+ continue;
+ }
+
+ unset($upgrade_description);
+
+ echo "\n\n";
+ echo '=== upgrade '.$upgrade_id."\n";
+
+ // include & execute upgrade script. Each upgrade script must contain
+ // $upgrade_description variable which describe briefly what the upgrade
+ // script does.
+ $up_start = get_moment();
+ include(UPGRADES_PATH.'/'.$upgrade_id.'-database.php');
+
+ // notify upgrade (TODO change on each release)
+ $query = '
+INSERT INTO `'.PREFIX_TABLE.'upgrade`
+ (id, applied, description)
+ VALUES
+ (\''.$upgrade_id.'\', NOW(), \'[migration from 2.7.0 to '.PHPWG_VERSION.', '.get_elapsed_time($up_start, get_moment()).'] '.$upgrade_description.'\')
+;';
+ pwg_query($query);
+}
+
+echo '</pre>';
+ob_end_clean();
+
+// now we upgrade from 2.8.0
+// include_once(PHPWG_ROOT_PATH.'install/upgrade_2.8.0.php');
+?>
diff --git a/language/af_ZA/common.lang.php b/language/af_ZA/common.lang.php
index 8977ed96f..4bf8545f6 100644
--- a/language/af_ZA/common.lang.php
+++ b/language/af_ZA/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Afrikaans [ZA]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=572
Author: Marius Loots and Mignon Smit
Author URI: http://piwigo.org
diff --git a/language/ar_EG/common.lang.php b/language/ar_EG/common.lang.php
index 6a85f30e9..1228cd606 100644
--- a/language/ar_EG/common.lang.php
+++ b/language/ar_EG/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: العربية (مصر) [EG]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=779
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ar_MA/common.lang.php b/language/ar_MA/common.lang.php
index 9cc6fb59d..f86f74bf7 100644
--- a/language/ar_MA/common.lang.php
+++ b/language/ar_MA/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: العربية [MA]
-Version: 2.5.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ar_SA/common.lang.php b/language/ar_SA/common.lang.php
index ea83cf5e4..468eff50e 100644
--- a/language/ar_SA/common.lang.php
+++ b/language/ar_SA/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: العربية [AR]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=412
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/az_AZ/common.lang.php b/language/az_AZ/common.lang.php
index 3519a5bc4..7a8e8842c 100644
--- a/language/az_AZ/common.lang.php
+++ b/language/az_AZ/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Azərbaycanca [AZ]
-Version: 2.5.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=618
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/bg_BG/common.lang.php b/language/bg_BG/common.lang.php
index 0515d231c..d51a6e72c 100644
--- a/language/bg_BG/common.lang.php
+++ b/language/bg_BG/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Български [BG]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=510
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/bn_IN/common.lang.php b/language/bn_IN/common.lang.php
index 932559c39..106c930c3 100644
--- a/language/bn_IN/common.lang.php
+++ b/language/bn_IN/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: বাংলা[IN]
-Version: 2.5.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=657
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/br_FR/common.lang.php b/language/br_FR/common.lang.php
index 6ca757aae..113df6c90 100644
--- a/language/br_FR/common.lang.php
+++ b/language/br_FR/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Brezhoneg [FR]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=698
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ca_ES/common.lang.php b/language/ca_ES/common.lang.php
index 3208795cc..151ef2763 100644
--- a/language/ca_ES/common.lang.php
+++ b/language/ca_ES/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Català [CA]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=413
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/cs_CZ/common.lang.php b/language/cs_CZ/common.lang.php
index e9401c463..f36aa8e3f 100644
--- a/language/cs_CZ/common.lang.php
+++ b/language/cs_CZ/common.lang.php
@@ -25,7 +25,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Česky [CZ]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=414
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/da_DK/common.lang.php b/language/da_DK/common.lang.php
index 26fbd8082..7f1f6bf9b 100644
--- a/language/da_DK/common.lang.php
+++ b/language/da_DK/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Dansk [DK]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=415
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/de_DE/common.lang.php b/language/de_DE/common.lang.php
index bb7e01274..e66fac988 100644
--- a/language/de_DE/common.lang.php
+++ b/language/de_DE/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Deutsch [DE]
-Version: 2.7.2
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=416
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/dv_MV/common.lang.php b/language/dv_MV/common.lang.php
index 4228c9538..34da705b1 100644
--- a/language/dv_MV/common.lang.php
+++ b/language/dv_MV/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Dhivehi [MV]
-Version: 2.5.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=570
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/el_GR/common.lang.php b/language/el_GR/common.lang.php
index ffd33aaae..f0f21d388 100644
--- a/language/el_GR/common.lang.php
+++ b/language/el_GR/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Ελληνικά [GR]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=508
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/en_GB/common.lang.php b/language/en_GB/common.lang.php
index 72fcf8c1c..809320747 100644
--- a/language/en_GB/common.lang.php
+++ b/language/en_GB/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: English [GB]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=716
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/en_UK/common.lang.php b/language/en_UK/common.lang.php
index bf61456ed..51ce58551 100644
--- a/language/en_UK/common.lang.php
+++ b/language/en_UK/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: English [UK]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=417
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/en_US/common.lang.php b/language/en_US/common.lang.php
index d56f47288..da1490eab 100644
--- a/language/en_US/common.lang.php
+++ b/language/en_US/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: English [US]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=717
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/eo_EO/common.lang.php b/language/eo_EO/common.lang.php
index f50dd739c..c3e9e8289 100644
--- a/language/eo_EO/common.lang.php
+++ b/language/eo_EO/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Esperanto [EO]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=596
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/es_AR/common.lang.php b/language/es_AR/common.lang.php
index c8b158017..1289cffa9 100644
--- a/language/es_AR/common.lang.php
+++ b/language/es_AR/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Argentina [AR]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=418
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/es_ES/common.lang.php b/language/es_ES/common.lang.php
index f0b352230..2d560b04c 100644
--- a/language/es_ES/common.lang.php
+++ b/language/es_ES/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Español [ES]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=169
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/es_MX/common.lang.php b/language/es_MX/common.lang.php
index f89603cec..26c8975f0 100644
--- a/language/es_MX/common.lang.php
+++ b/language/es_MX/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: México [MX]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=726
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/et_EE/common.lang.php b/language/et_EE/common.lang.php
index 75fd4304c..7dcb8701f 100644
--- a/language/et_EE/common.lang.php
+++ b/language/et_EE/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Estonian [EE]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=569
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/eu_ES/common.lang.php b/language/eu_ES/common.lang.php
index f66dd12aa..e18944a9a 100644
--- a/language/eu_ES/common.lang.php
+++ b/language/eu_ES/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Euskara [ES]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=725
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/fa_IR/common.lang.php b/language/fa_IR/common.lang.php
index dc97be666..724ee63e4 100644
--- a/language/fa_IR/common.lang.php
+++ b/language/fa_IR/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: پارسی [IR]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=419
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/fi_FI/common.lang.php b/language/fi_FI/common.lang.php
index bf2597fcf..ff07555ed 100644
--- a/language/fi_FI/common.lang.php
+++ b/language/fi_FI/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Finnish [FI]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=686
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/fr_CA/common.lang.php b/language/fr_CA/common.lang.php
index e0b249629..2afd68705 100644
--- a/language/fr_CA/common.lang.php
+++ b/language/fr_CA/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Français [QC]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=420
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/fr_FR/common.lang.php b/language/fr_FR/common.lang.php
index 5eac3c004..c70dbf183 100644
--- a/language/fr_FR/common.lang.php
+++ b/language/fr_FR/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Français [FR]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=421
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ga_IE/common.lang.php b/language/ga_IE/common.lang.php
index 07dff0a94..c08cd8dcf 100644
--- a/language/ga_IE/common.lang.php
+++ b/language/ga_IE/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Gaeilge [IE]
-Version: 2.5.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=708
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/gl_ES/common.lang.php b/language/gl_ES/common.lang.php
index 52c6fb4ad..5bc4d34bf 100644
--- a/language/gl_ES/common.lang.php
+++ b/language/gl_ES/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Galego [ES]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=681
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/gu_IN/common.lang.php b/language/gu_IN/common.lang.php
index 2128092ae..17f8fb827 100644
--- a/language/gu_IN/common.lang.php
+++ b/language/gu_IN/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: ગુજરાતી[IN]
-Version: 2.6.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=767
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/he_IL/common.lang.php b/language/he_IL/common.lang.php
index e08f1d0f4..d06b1ff96 100644
--- a/language/he_IL/common.lang.php
+++ b/language/he_IL/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: עברית [IL]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=457
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/hr_HR/common.lang.php b/language/hr_HR/common.lang.php
index 4d9b44284..eeb1ea7c4 100644
--- a/language/hr_HR/common.lang.php
+++ b/language/hr_HR/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Hrvatski [HR]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=422
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/hu_HU/common.lang.php b/language/hu_HU/common.lang.php
index 2f3f1cefa..a190cd562 100644
--- a/language/hu_HU/common.lang.php
+++ b/language/hu_HU/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Magyar [HU]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=423
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/id_ID/common.lang.php b/language/id_ID/common.lang.php
index 146700818..1357a3680 100644
--- a/language/id_ID/common.lang.php
+++ b/language/id_ID/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Bahasa Indonesia [ID]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=707
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/is_IS/common.lang.php b/language/is_IS/common.lang.php
index c6ab35b35..600d9935b 100644
--- a/language/is_IS/common.lang.php
+++ b/language/is_IS/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Íslenska [IS]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=518
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/it_IT/common.lang.php b/language/it_IT/common.lang.php
index 27b925446..c53280f19 100644
--- a/language/it_IT/common.lang.php
+++ b/language/it_IT/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Italiano [IT]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=424
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ja_JP/common.lang.php b/language/ja_JP/common.lang.php
index 07a80b59f..a6f337736 100644
--- a/language/ja_JP/common.lang.php
+++ b/language/ja_JP/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: 日本語 [JP]
-Version: 2.7.2
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=425
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ka_GE/common.lang.php b/language/ka_GE/common.lang.php
index a985463f1..5953c4f3d 100644
--- a/language/ka_GE/common.lang.php
+++ b/language/ka_GE/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: ქართული [GE]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=426
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/km_KH/common.lang.php b/language/km_KH/common.lang.php
index 17f83fb4d..9c02f1730 100644
--- a/language/km_KH/common.lang.php
+++ b/language/km_KH/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: ខ្មែរ [KH]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=579
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/kn_IN/common.lang.php b/language/kn_IN/common.lang.php
index b1df5d309..e55ccfc1e 100644
--- a/language/kn_IN/common.lang.php
+++ b/language/kn_IN/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: ಕನ್ನಡ [IN]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=693
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ko_KR/common.lang.php b/language/ko_KR/common.lang.php
index c9bfecef8..2e046c562 100644
--- a/language/ko_KR/common.lang.php
+++ b/language/ko_KR/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: 한국어 [KR]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=509
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/kok_IN/common.lang.php b/language/kok_IN/common.lang.php
index 5af54c701..75a7355ad 100644
--- a/language/kok_IN/common.lang.php
+++ b/language/kok_IN/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: कोंकणी [IN]
-Version: 2.5.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=660
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/lb_LU/common.lang.php b/language/lb_LU/common.lang.php
index 7a6706847..8c49e8440 100644
--- a/language/lb_LU/common.lang.php
+++ b/language/lb_LU/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Lëtzebuergesch [LU]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=715
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/lt_LT/common.lang.php b/language/lt_LT/common.lang.php
index 260065328..eba3e2309 100644
--- a/language/lt_LT/common.lang.php
+++ b/language/lt_LT/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Lietuviu [LT]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=648
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/lv_LV/common.lang.php b/language/lv_LV/common.lang.php
index e8dd8aa9b..198642361 100644
--- a/language/lv_LV/common.lang.php
+++ b/language/lv_LV/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Latviešu [LV]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=427
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/mk_MK/common.lang.php b/language/mk_MK/common.lang.php
index e87c6915a..5a6c567ab 100644
--- a/language/mk_MK/common.lang.php
+++ b/language/mk_MK/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Македонски [MK]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=428
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/mn_MN/common.lang.php b/language/mn_MN/common.lang.php
index 92965b6f9..a39c45fdd 100644
--- a/language/mn_MN/common.lang.php
+++ b/language/mn_MN/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Монгол [MN]
-Version: 2.7.2
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=696
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ms_MY/common.lang.php b/language/ms_MY/common.lang.php
index c3e58966e..084b3aaca 100644
--- a/language/ms_MY/common.lang.php
+++ b/language/ms_MY/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Malay [MY]
-Version: 2.5.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=645
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/nb_NO/common.lang.php b/language/nb_NO/common.lang.php
index 5a0a83d85..89124bc79 100644
--- a/language/nb_NO/common.lang.php
+++ b/language/nb_NO/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Norsk bokmål [NO]
-Version: 2.7.2
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=483
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/nl_NL/common.lang.php b/language/nl_NL/common.lang.php
index 91a52db1f..69d4d0185 100644
--- a/language/nl_NL/common.lang.php
+++ b/language/nl_NL/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Nederlands [NL]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=429
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/nn_NO/common.lang.php b/language/nn_NO/common.lang.php
index 0e89045fc..6b4fb273f 100644
--- a/language/nn_NO/common.lang.php
+++ b/language/nn_NO/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Norwegian nynorsk [NO]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=689
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/pl_PL/common.lang.php b/language/pl_PL/common.lang.php
index dea124331..8b70c852d 100644
--- a/language/pl_PL/common.lang.php
+++ b/language/pl_PL/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Polski [PL]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=430
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/pt_BR/common.lang.php b/language/pt_BR/common.lang.php
index b3f8e8f0c..babbb2730 100644
--- a/language/pt_BR/common.lang.php
+++ b/language/pt_BR/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Brasil [BR]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=431
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/pt_PT/common.lang.php b/language/pt_PT/common.lang.php
index 64cc7cd96..cdf4b7dfe 100644
--- a/language/pt_PT/common.lang.php
+++ b/language/pt_PT/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Português [PT]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=432
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ro_RO/common.lang.php b/language/ro_RO/common.lang.php
index 7ac3daee3..6fcccf17e 100644
--- a/language/ro_RO/common.lang.php
+++ b/language/ro_RO/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Română [RO]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=433
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ru_RU/common.lang.php b/language/ru_RU/common.lang.php
index d8542e849..6e01c1e11 100644
--- a/language/ru_RU/common.lang.php
+++ b/language/ru_RU/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Русский [RU]
-Version: 2.7.2
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=434
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/sh_RS/common.lang.php b/language/sh_RS/common.lang.php
index 06251a901..8806aacaa 100644
--- a/language/sh_RS/common.lang.php
+++ b/language/sh_RS/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Srpski [SR]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=435
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/sk_SK/common.lang.php b/language/sk_SK/common.lang.php
index 6ab79e670..9f9823677 100644
--- a/language/sk_SK/common.lang.php
+++ b/language/sk_SK/common.lang.php
@@ -25,7 +25,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Slovensky [SK]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=452
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/sl_SI/common.lang.php b/language/sl_SI/common.lang.php
index 55ffd1d14..a4f98bce4 100644
--- a/language/sl_SI/common.lang.php
+++ b/language/sl_SI/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Slovenšcina [SI]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=453
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/sr_RS/common.lang.php b/language/sr_RS/common.lang.php
index 5ad73fa56..44cd789ee 100644
--- a/language/sr_RS/common.lang.php
+++ b/language/sr_RS/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Српски [SR]
-Version: 2.7.2
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=458
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/sv_SE/common.lang.php b/language/sv_SE/common.lang.php
index 4f289b5f4..9e5223d0d 100644
--- a/language/sv_SE/common.lang.php
+++ b/language/sv_SE/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Svenska [SE]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=451
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/ta_IN/common.lang.php b/language/ta_IN/common.lang.php
index effdb9a86..94b8e81d1 100644
--- a/language/ta_IN/common.lang.php
+++ b/language/ta_IN/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: தமிழ் [IN]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=638
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/th_TH/common.lang.php b/language/th_TH/common.lang.php
index 0f6393344..4bda30edd 100644
--- a/language/th_TH/common.lang.php
+++ b/language/th_TH/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: ภาษาไทย [TH]
-Version: 2.7.1
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=519
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/tr_TR/common.lang.php b/language/tr_TR/common.lang.php
index f6bb4a816..06be3e1d8 100644
--- a/language/tr_TR/common.lang.php
+++ b/language/tr_TR/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Türkçe [TR]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=436
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/uk_UA/common.lang.php b/language/uk_UA/common.lang.php
index 0d7b16994..72a7e2e36 100644
--- a/language/uk_UA/common.lang.php
+++ b/language/uk_UA/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Українська [UA]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=523
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/vi_VN/common.lang.php b/language/vi_VN/common.lang.php
index b3aa1396c..aa3ccbb1e 100644
--- a/language/vi_VN/common.lang.php
+++ b/language/vi_VN/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Tiếng Việt [VN]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=437
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/wo_SN/common.lang.php b/language/wo_SN/common.lang.php
index 2da46e8da..2e7b38550 100644
--- a/language/wo_SN/common.lang.php
+++ b/language/wo_SN/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: Wolof [SN]
-Version: 2.6.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=737
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/zh_CN/common.lang.php b/language/zh_CN/common.lang.php
index 21325e81f..6e8a0b5ec 100644
--- a/language/zh_CN/common.lang.php
+++ b/language/zh_CN/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: 简体中文 [CN]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=438
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/zh_HK/common.lang.php b/language/zh_HK/common.lang.php
index 168a53c59..9f5ae9cf5 100644
--- a/language/zh_HK/common.lang.php
+++ b/language/zh_HK/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: 中文 (香港) [HK]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=614
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/language/zh_TW/common.lang.php b/language/zh_TW/common.lang.php
index 87e4e38ea..a6b143c0c 100644
--- a/language/zh_TW/common.lang.php
+++ b/language/zh_TW/common.lang.php
@@ -22,7 +22,7 @@
// +-----------------------------------------------------------------------+
/*
Language Name: 中文 (繁體) [TW]
-Version: 2.7.0
+Version: auto
Language URI: http://piwigo.org/ext/extension_view.php?eid=524
Author: Piwigo team
Author URI: http://piwigo.org
diff --git a/password.php b/password.php
index 4e03079a7..5a96ea1bc 100644
--- a/password.php
+++ b/password.php
@@ -260,6 +260,8 @@ function reset_password()
array('user_id' => $user_id)
);
+ deactivate_user_auth_keys($user_id);
+
$page['infos'][] = l10n('Your password has been reset');
$page['infos'][] = '<a href="'.get_root_url().'identification.php">'.l10n('Login').'</a>';
diff --git a/profile.php b/profile.php
index b143cbf54..3f60fde1b 100644
--- a/profile.php
+++ b/profile.php
@@ -207,6 +207,8 @@ function save_profile_from_post($userdata, &$errors)
$fields[] = $conf['user_fields']['password'];
// password is hashed with function $conf['password_hash']
$data{$conf['user_fields']['password']} = $conf['password_hash']($_POST['use_new_pwd']);
+
+ deactivate_user_auth_keys($userdata['id']);
}
// username is updated only if allowed
diff --git a/search.php b/search.php
index 9d33c7b3c..f8f0a1949 100644
--- a/search.php
+++ b/search.php
@@ -72,6 +72,11 @@ if (isset($_POST['submit']))
'mode' => $_POST['mode'],
'fields' => $_POST['fields'],
);
+
+ if (isset($_POST['search_in_tags']))
+ {
+ $search['fields']['search_in_tags'] = true;
+ }
}
if (isset($_POST['tags']))
diff --git a/themes/Sylvia/themeconf.inc.php b/themes/Sylvia/themeconf.inc.php
index 0ca6ae4b3..8c007f620 100644
--- a/themes/Sylvia/themeconf.inc.php
+++ b/themes/Sylvia/themeconf.inc.php
@@ -1,7 +1,7 @@
<?php
/*
Theme Name: Sylvia
-Version: 2.7.0
+Version: auto
Description: Dark background, flora and pink decorations.
Theme URI: http://piwigo.org/ext/extension_view.php?eid=368
Author: Piwigo team
diff --git a/themes/clear/themeconf.inc.php b/themes/clear/themeconf.inc.php
index c10d3cf35..7603b1e41 100644
--- a/themes/clear/themeconf.inc.php
+++ b/themes/clear/themeconf.inc.php
@@ -1,7 +1,7 @@
<?php
/*
Theme Name: clear
-Version: 2.7.0
+Version: auto
Description: White background, soft gray.
Theme URI: http://piwigo.org/ext/extension_view.php?eid=9
Author: Piwigo team
diff --git a/themes/dark/themeconf.inc.php b/themes/dark/themeconf.inc.php
index 6da1d7c36..7e692996c 100644
--- a/themes/dark/themeconf.inc.php
+++ b/themes/dark/themeconf.inc.php
@@ -1,7 +1,7 @@
<?php
/*
Theme Name: dark
-Version: 2.7.0
+Version: auto
Description: Dark background, grayscale.
Theme URI: http://piwigo.org/ext/extension_view.php?eid=369
Author: Piwigo team
diff --git a/themes/default/js/plugins/piecon.js b/themes/default/js/plugins/piecon.js
new file mode 100644
index 000000000..f606706ac
--- /dev/null
+++ b/themes/default/js/plugins/piecon.js
@@ -0,0 +1,189 @@
+//
+// piecon.js
+//
+// https://github.com/lipka/piecon
+//
+// Copyright (c) 2015 Lukas Lipka <lukaslipka@gmail.com>. All rights reserved.
+//
+
+(function(){
+ var Piecon = {};
+
+ var currentFavicon = null;
+ var originalFavicon = null;
+ var originalTitle = null;
+ var canvas = null;
+ var options = {};
+ var defaults = {
+ color: '#ff0084',
+ background: '#bbb',
+ shadow: '#fff',
+ fallback: false
+ };
+
+ var isRetina = window.devicePixelRatio > 1;
+
+ var ua = (function () {
+ var agent = navigator.userAgent.toLowerCase();
+ return function (browser) {
+ return agent.indexOf(browser) !== -1;
+ };
+ }());
+
+ var browser = {
+ ie: ua('msie'),
+ chrome: ua('chrome'),
+ webkit: ua('chrome') || ua('safari'),
+ safari: ua('safari') && !ua('chrome'),
+ mozilla: ua('mozilla') && !ua('chrome') && !ua('safari')
+ };
+
+ var getFaviconTag = function() {
+ var links = document.getElementsByTagName('link');
+
+ for (var i = 0, l = links.length; i < l; i++) {
+ if (links[i].getAttribute('rel') === 'icon' || links[i].getAttribute('rel') === 'shortcut icon') {
+ return links[i];
+ }
+ }
+
+ return false;
+ };
+
+ var removeFaviconTag = function() {
+ var links = Array.prototype.slice.call(document.getElementsByTagName('link'), 0);
+ var head = document.getElementsByTagName('head')[0];
+
+ for (var i = 0, l = links.length; i < l; i++) {
+ if (links[i].getAttribute('rel') === 'icon' || links[i].getAttribute('rel') === 'shortcut icon') {
+ head.removeChild(links[i]);
+ }
+ }
+ };
+
+ var setFaviconTag = function(url) {
+ removeFaviconTag();
+
+ var link = document.createElement('link');
+ link.type = 'image/x-icon';
+ link.rel = 'icon';
+ link.href = url;
+
+ document.getElementsByTagName('head')[0].appendChild(link);
+ };
+
+ var getCanvas = function () {
+ if (!canvas) {
+ canvas = document.createElement("canvas");
+ if (isRetina) {
+ canvas.width = 32;
+ canvas.height = 32;
+ } else {
+ canvas.width = 16;
+ canvas.height = 16;
+ }
+ }
+
+ return canvas;
+ };
+
+ var drawFavicon = function(percentage) {
+ var canvas = getCanvas();
+ var context = canvas.getContext("2d");
+
+ percentage = percentage || 0;
+
+ if (context) {
+ context.clearRect(0, 0, canvas.width, canvas.height);
+
+ // Draw shadow
+ context.beginPath();
+ context.moveTo(canvas.width / 2, canvas.height / 2);
+ context.arc(canvas.width / 2, canvas.height / 2, Math.min(canvas.width / 2, canvas.height / 2), 0, Math.PI * 2, false);
+ context.fillStyle = options.shadow;
+ context.fill();
+
+ // Draw background
+ context.beginPath();
+ context.moveTo(canvas.width / 2, canvas.height / 2);
+ context.arc(canvas.width / 2, canvas.height / 2, Math.min(canvas.width / 2, canvas.height / 2) - 2, 0, Math.PI * 2, false);
+ context.fillStyle = options.background;
+ context.fill();
+
+ // Draw pie
+ if (percentage > 0) {
+ context.beginPath();
+ context.moveTo(canvas.width / 2, canvas.height / 2);
+ context.arc(canvas.width / 2, canvas.height / 2, Math.min(canvas.width / 2, canvas.height / 2) - 2, (-0.5) * Math.PI, (-0.5 + 2 * percentage / 100) * Math.PI, false);
+ context.lineTo(canvas.width / 2, canvas.height / 2);
+ context.fillStyle = options.color;
+ context.fill();
+ }
+
+ setFaviconTag(canvas.toDataURL());
+ }
+ };
+
+ var updateTitle = function(percentage) {
+ if (percentage > 0) {
+ document.title = '(' + percentage + '%) ' + originalTitle;
+ } else {
+ document.title = originalTitle;
+ }
+ };
+
+ Piecon.setOptions = function(custom) {
+ options = {};
+
+ for (var key in defaults){
+ options[key] = custom.hasOwnProperty(key) ? custom[key] : defaults[key];
+ }
+
+ return this;
+ };
+
+ Piecon.setProgress = function(percentage) {
+ if (!originalTitle) {
+ originalTitle = document.title;
+ }
+
+ if (!originalFavicon || !currentFavicon) {
+ var tag = getFaviconTag();
+ originalFavicon = currentFavicon = tag ? tag.getAttribute('href') : '/favicon.ico';
+ }
+
+ if (!isNaN(parseFloat(percentage)) && isFinite(percentage)) {
+ if (!getCanvas().getContext || browser.ie || browser.safari || options.fallback === true) {
+ // Fallback to updating the browser title if unsupported
+ return updateTitle(percentage);
+ } else if (options.fallback === 'force') {
+ updateTitle(percentage);
+ }
+
+ return drawFavicon(percentage);
+ }
+
+ return false;
+ };
+
+ Piecon.reset = function() {
+ if (originalTitle) {
+ document.title = originalTitle;
+ }
+
+ if (originalFavicon) {
+ currentFavicon = originalFavicon;
+ setFaviconTag(currentFavicon);
+ }
+ };
+
+ Piecon.setOptions(defaults);
+
+ if(typeof define === 'function' && define.amd) {
+ define(Piecon);
+ } else if (typeof module !== 'undefined') {
+ module.exports = Piecon;
+ } else {
+ window.Piecon = Piecon;
+ }
+})();
diff --git a/themes/default/js/plugins/piecon.min.js b/themes/default/js/plugins/piecon.min.js
deleted file mode 100644
index bc2aa1adf..000000000
--- a/themes/default/js/plugins/piecon.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(){var a={},b=null,c=null,d=null,e=null,f={},g={color:"#ff0084",background:"#bbb",shadow:"#fff",fallback:!1},h=window.devicePixelRatio>1,i=function(){var a=navigator.userAgent.toLowerCase();return function(b){return-1!==a.indexOf(b)}}(),j={ie:i("msie"),chrome:i("chrome"),webkit:i("chrome")||i("safari"),safari:i("safari")&&!i("chrome"),mozilla:i("mozilla")&&!i("chrome")&&!i("safari")},k=function(){for(var a=document.getElementsByTagName("link"),b=0,c=a.length;c>b;b++)if("icon"===a[b].getAttribute("rel")||"shortcut icon"===a[b].getAttribute("rel"))return a[b];return!1},l=function(){for(var a=document.getElementsByTagName("link"),b=document.getElementsByTagName("head")[0],c=0,d=a.length;d>c;c++)("icon"===a[c].getAttribute("rel")||"shortcut icon"===a[c].getAttribute("rel"))&&b.removeChild(a[c])},m=function(a){l();var b=document.createElement("link");b.type="image/x-icon",b.rel="icon",b.href=a,document.getElementsByTagName("head")[0].appendChild(b)},n=function(){return e||(e=document.createElement("canvas"),h?(e.width=32,e.height=32):(e.width=16,e.height=16)),e},o=function(a){var b=n(),c=b.getContext("2d");a=a||0,c&&(c.clearRect(0,0,b.width,b.height),c.beginPath(),c.moveTo(b.width/2,b.height/2),c.arc(b.width/2,b.height/2,Math.min(b.width/2,b.height/2),0,2*Math.PI,!1),c.fillStyle=f.shadow,c.fill(),c.beginPath(),c.moveTo(b.width/2,b.height/2),c.arc(b.width/2,b.height/2,Math.min(b.width/2,b.height/2)-2,0,2*Math.PI,!1),c.fillStyle=f.background,c.fill(),a>0&&(c.beginPath(),c.moveTo(b.width/2,b.height/2),c.arc(b.width/2,b.height/2,Math.min(b.width/2,b.height/2)-2,-.5*Math.PI,(-.5+2*a/100)*Math.PI,!1),c.lineTo(b.width/2,b.height/2),c.fillStyle=f.color,c.fill()),m(b.toDataURL()))},p=function(a){document.title=a>0?"("+a+"%) "+d:d};a.setOptions=function(a){f={};for(var b in g)f[b]=a.hasOwnProperty(b)?a[b]:g[b];return this},a.setProgress=function(a){if(d||(d=document.title),!c||!b){var e=k();c=b=e?e.getAttribute("href"):"/favicon.ico"}return!isNaN(parseFloat(a))&&isFinite(a)?!n().getContext||j.ie||j.safari||f.fallback===!0?p(a):("force"===f.fallback&&p(a),o(a)):!1},a.reset=function(){d&&(document.title=d),c&&(b=c,m(b))},a.setOptions(g),window.Piecon=a}();
diff --git a/themes/default/template/navigation_bar.tpl b/themes/default/template/navigation_bar.tpl
index 82c66bd15..0e1e0fea7 100644
--- a/themes/default/template/navigation_bar.tpl
+++ b/themes/default/template/navigation_bar.tpl
@@ -1,10 +1,10 @@
<div class="navigationBar">
{if isset($navbar.URL_FIRST)}
- <a href="{$navbar.URL_FIRST}" rel="first">{'First'|@translate}</a> |
- <a href="{$navbar.URL_PREV}" rel="prev">{'Previous'|@translate}</a> |
+ <span class="navFirstLast"><a href="{$navbar.URL_FIRST}" rel="first">{'First'|@translate}</a> |</span>
+ <span class="navPrevNext"><a href="{$navbar.URL_PREV}" rel="prev">{'Previous'|@translate}</a> |</span>
{else}
- {'First'|@translate} |
- {'Previous'|@translate} |
+ <span class="navFirstLast">{'First'|@translate} |</span>
+ <span class="navPrevNext">{'Previous'|@translate} |</span>
{/if}
{assign var='prev_page' value=0}
@@ -19,10 +19,10 @@
{/foreach}
{if isset($navbar.URL_NEXT)}
- | <a href="{$navbar.URL_NEXT}" rel="next">{'Next'|@translate}</a>
- | <a href="{$navbar.URL_LAST}" rel="last">{'Last'|@translate}</a>
+ <span class="navPrevNext">| <a href="{$navbar.URL_NEXT}" rel="next">{'Next'|@translate}</a></span>
+ <span class="navFirstLast">| <a href="{$navbar.URL_LAST}" rel="last">{'Last'|@translate}</a></span>
{else}
- | {'Next'|@translate}
- | {'Last'|@translate}
+ <span class="navPrevNext">| {'Next'|@translate}</span>
+ <span class="navFirstLast">| {'Last'|@translate}</span>
{/if}
</div>
diff --git a/themes/default/template/search.tpl b/themes/default/template/search.tpl
index 1a12e9832..4129746bd 100644
--- a/themes/default/template/search.tpl
+++ b/themes/default/template/search.tpl
@@ -47,6 +47,9 @@ jQuery(document).ready(function() {
<label><input type="checkbox" name="fields[]" value="name" checked="checked"> {'Photo title'|translate}</label>
<label><input type="checkbox" name="fields[]" value="comment" checked="checked"> {'Photo description'|translate}</label>
<label><input type="checkbox" name="fields[]" value="file" checked="checked"> {'File name'|translate}</label>
+{if isset($TAGS)}
+ <label><input type="checkbox" name="search_in_tags" value="tags"> {'Tags'|translate}</label>
+{/if}
</p>
</fieldset>
diff --git a/themes/default/watermarks/copyright.png b/themes/default/watermarks/copyright.png
index 0784d48b9..f8c2e4022 100644
--- a/themes/default/watermarks/copyright.png
+++ b/themes/default/watermarks/copyright.png
Binary files differ
diff --git a/themes/elegant/themeconf.inc.php b/themes/elegant/themeconf.inc.php
index fc6a52295..5ff8842eb 100644
--- a/themes/elegant/themeconf.inc.php
+++ b/themes/elegant/themeconf.inc.php
@@ -1,7 +1,7 @@
<?php
/*
Theme Name: elegant
-Version: 2.7.2
+Version: auto
Description: Dark background, grayscale.
Theme URI: http://piwigo.org/ext/extension_view.php?eid=685
Author: Piwigo team
diff --git a/themes/smartpocket/themeconf.inc.php b/themes/smartpocket/themeconf.inc.php
index 419e7a68b..b39e738f8 100644
--- a/themes/smartpocket/themeconf.inc.php
+++ b/themes/smartpocket/themeconf.inc.php
@@ -1,7 +1,7 @@
<?php
/*
Theme Name: Smart Pocket
-Version: 2.7.2
+Version: auto
Description: Mobile theme.
Theme URI: http://piwigo.org/ext/extension_view.php?eid=599
Author: P@t
diff --git a/tools/pwg_rel_create.sh b/tools/pwg_rel_create.sh
index f891d55e1..c3cf7d0ce 100755
--- a/tools/pwg_rel_create.sh
+++ b/tools/pwg_rel_create.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+scriptdir=$(dirname $(readlink -e $0))
+
# +--------------------------------------------------------------------------+
# | pwg_rel_create.sh |
# +--------------------------------------------------------------------------+
@@ -38,22 +40,78 @@ then
git checkout $2
fi
+# remove Git metadata
+rm -rf /tmp/$version/piwigo/.git
+
+# +--------------------------------------------------------------------------+
+# | plugins |
+# +--------------------------------------------------------------------------+
+
cd plugins
-git clone https://github.com/Piwigo/TakeATour.git
-git clone https://github.com/Piwigo/AdminTools.git
-git clone https://github.com/Piwigo/LocalFilesEditor.git
-git clone https://github.com/Piwigo/LanguageSwitch.git
-rm -rf /tmp/$version/piwigo/.git
-rm -rf /tmp/$version/piwigo/plugins/*/.git
+for plugin in TakeATour AdminTools LocalFilesEditor LanguageSwitch
+do
+ cd /tmp/$version/piwigo/plugins
+
+ plugin_dir=$plugin
+ if [ $plugin = "LanguageSwitch" ]
+ then
+ plugin_dir=language_switch
+ fi
+
+ # clone repo
+ git clone https://github.com/Piwigo/${plugin}.git $plugin_dir
+ cd /tmp/$version/piwigo/plugins/$plugin_dir
+
+ # change version
+ perl $scriptdir/replace_version.pl --file=main.inc.php --version=$version
+
+ # register metadata in dedicated file
+ echo https://github.com/Piwigo/${plugin}.git > pem_metadata.txt
+ git log -n 1 --pretty=format:"%H %ad" --date=iso8601 >> pem_metadata.txt
+
+ # remove Git metadata
+ rm -rf .git
+done
+
+# +--------------------------------------------------------------------------+
+# | themes |
+# +--------------------------------------------------------------------------+
+
+cd /tmp/$version/piwigo/themes
+for themefile in $(ls */themeconf.inc.php)
+do
+ # change version
+ perl $scriptdir/replace_version.pl --file=$themefile --version=$version
+done
+
+# +--------------------------------------------------------------------------+
+# | languages |
+# +--------------------------------------------------------------------------+
+
+cd /tmp/$version/piwigo/language
+for languagefile in $(ls */common.lang.php)
+do
+ # change version
+ perl $scriptdir/replace_version.pl --file=$languagefile --version=$version
+done
+# +--------------------------------------------------------------------------+
+# | data directories + zip 1 |
+# +--------------------------------------------------------------------------+
+
+# create "data" directories
cd /tmp/$version
mkdir piwigo/upload
mkdir piwigo/_data
touch piwigo/_data/dummy.txt
-zip -r $name-nochmod.zip piwigo
+zip -q -r $name-nochmod.zip piwigo
+
+# +--------------------------------------------------------------------------+
+# | permissions + zip 2 |
+# +--------------------------------------------------------------------------+
chmod -R a+w piwigo/local
chmod a+w piwigo/_data
@@ -61,6 +119,6 @@ chmod a+w piwigo/upload
chmod a+w piwigo/plugins
chmod a+w piwigo/themes
-zip -r $name.zip piwigo
+zip -q -r $name.zip piwigo
echo cd /tmp/$version
diff --git a/tools/replace_version.pl b/tools/replace_version.pl
new file mode 100644
index 000000000..845948d81
--- /dev/null
+++ b/tools/replace_version.pl
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+####
+# Usage
+#
+# perl replace_version.pl --file=/path/to/file.php --version=2.8.0
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+use File::Basename;
+
+my %opt = ();
+GetOptions(
+ \%opt,
+ qw/
+ file=s
+ version=s
+ /
+);
+
+if (not -e $opt{file}) {
+ die "file missing ".$opt{file};
+}
+
+my $new_content = '';
+open(my $ifh, '<'.$opt{file}) or die 'Houston, problem with "'.$opt{file}.'" for reading';
+while (<$ifh>) {
+ if (/^Version:/) {
+ $_ = 'Version: '.$opt{version}.''."\n";
+ }
+ $new_content.= $_;
+}
+close($ifh);
+
+open(my $ofh, '>'.$opt{file}) or die 'Houston, problem with "'.$opt{file}.'" for writing';
+print {$ofh} $new_content;
+close($ofh);
diff --git a/upgrade.php b/upgrade.php
index e67d8fa0f..11b745b6d 100644
--- a/upgrade.php
+++ b/upgrade.php
@@ -342,6 +342,10 @@ else if (!in_array('nb_available_tags', $columns_of[PREFIX_TABLE.'user_cache']))
{
$current_release = '2.5.0';
}
+else if (!in_array('activation_key_expire', $columns_of[PREFIX_TABLE.'user_infos']))
+{
+ $current_release = '2.6.0';
+}
else
{
// retrieve already applied upgrades
@@ -351,9 +355,9 @@ SELECT id
;';
$applied_upgrades = array_from_query($query, 'id');
- if (!in_array(144, $applied_upgrades))
+ if (!in_array(148, $applied_upgrades))
{
- $current_release = '2.6.0';
+ $current_release = '2.7.0';
}
else
{
@@ -476,7 +480,8 @@ REPLACE INTO '.PLUGINS_TABLE.'
$template->assign(
array(
- 'button_label' => l10n('2_7_0_descrp'), // TODO avoid to update it on each release
+ // 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_link' => 'admin.php?submited_tour_path=tours/'.$version_.'&amp;pwg_token='.get_pwg_token(),
)
);
diff --git a/ws.php b/ws.php
index 66e6a707d..6a2bd211d 100644
--- a/ws.php
+++ b/ws.php
@@ -193,6 +193,10 @@ function ws_addDefaultMethods( $arr )
'type'=>WS_TYPE_BOOL),
'fullname' => array('default'=>false,
'type'=>WS_TYPE_BOOL),
+ 'thumbnail_size' => array(
+ 'default' => IMG_THUMB,
+ 'info' => 'square, thumb, 2small, xsmall, small, medium, large, xlarge, xxlarge'
+ ),
),
'Returns a list of categories.',
$ws_functions_root . 'pwg.categories.php'
@@ -688,6 +692,8 @@ function ws_addDefaultMethods( $arr )
'category_id' => array('type'=>WS_TYPE_ID),
'name' => array('default'=>null),
'comment' => array('default'=>null),
+ 'status' => array('default'=>null,
+ 'info'=>'public, private'),
),
'Changes properties of an album.',
$ws_functions_root . 'pwg.categories.php',