Commit Graph
100 Commits
Author SHA1 Message Date
Linty 33024bcc8d fixes #2555 toggle password links by user status
Show copy/send password links by default but hide them for users with status 'generic'. Adds a change handler in fill_user_edit_properties to call toggle_send_copy_password when the status select changes, and implements toggle_send_copy_password(status) to show/hide #copy_password_link and #send_password_link accordingly.
2026-04-29 16:20:37 +02:00
Linty 9196732341 fixes #2478 add created_on tooltip and responsive tooltip styles
JS: add mouseenter handler to toggle a tooltip-flip class for elements with data-tooltip so tooltips flip when they would overflow the right edge; set data-tooltip on API creation timestamp. CSS: constrain tooltip max width to 250px (or viewport margin), allow multiline content (max-content/word-wrap), and position flipped tooltips from the right. These changes prevent tooltip overflow on narrow viewports and improve readability.
2026-04-29 15:15:34 +02:00
Linty c9af737962 fixes #2544 improve AddUser UI layout
Hide AddUser error block on close and make the AddUser popin scrollable with layout fixes. Also refine two French translations (password and login key).
2026-03-26 10:10:20 +01:00
Linty b19beee0aa fixes #796 handle ampersand escaping for API URLs
When generating URLs for the web service (IN_WS), ensure the argument separator is a raw '&' instead of the HTML entity '&'. add_url_params now switches the separator to '&' if IN_WS is defined and '&' was requested. Removed a redundant str_replace call in ws_std_get_urls since get_action_url/add_url_params now produce the correct separator. This prevents double-escaped ampersands.
2026-03-23 12:26:20 +01:00
Linty 8fe5a57799 fixes #2539 always set pwg_token for API key requests
Simplify pwg_token setup during PWG_API_KEY_REQUEST by unconditionally assigning get_pwg_token() to both $_POST['pwg_token'] and $_GET['pwg_token']. Removes prior isset() checks so the token is always present for API key requests; be aware this will overwrite any existing pwg_token values in request arrays.
2026-03-13 18:18:21 +01:00
Linty b26ca3e08a fixes #2522 use privacy-preserving verification message
Replace the explicit "An email has been sent with a verification code" message with a privacy-preserving wording: "If your account exists, a verification code has been sent to your email address." This avoids account enumeration. Updated language entries in en_UK and fr_FR, the server-side message in password.php, and the password reset template.
2026-02-12 17:25:50 +01:00
Linty 91088bbec9 fixes #2490 add merge_tags notification trigger
A trigger_notify call for 'merge_tags' was added before deleting tags in the tag merge process. This allows plugins or extensions to react to tag merges.
2025-12-22 16:22:14 +01:00
Linty 2526d4a911 fixes #2488 improve handling of derivative config
Refactors how derivative and disabled_derivatives config values are loaded from the database, supporting both parameters and using a new safe_unserialize function. Updates ImageStdParams to use the global config and ensures proper serialization/deserialization of disabled type maps, with improved save logic to avoid unnecessary writes.
2025-12-22 16:17:13 +01:00
Linty 3da45eabac fixes #2460 switch api auth header to X-PIWIGO-API
Replaces usage of the Authorization header with X-PIWIGO-API for API key authentication. This improves consistency and may address issues with standard Authorization header handling.
2025-12-01 18:12:31 +01:00
Linty 32d3ea93f8 fixes #2458 add polyfill for str_starts_with function
Introduces a compatibility implementation of str_starts_with for environments where it is not available. Updates common.inc.php to include the polyfill if the function does not exist.
2025-12-01 12:43:46 +01:00
Linty f016802443 issue #2355 set default value for 'connected_with' session key
Adds a check to initialize $_SESSION['connected_with'] to 'pwg_ui' if it is not already set. This ensures the session variable is always defined before proceeding with cache deletion.
2025-11-24 16:40:27 +01:00
Linty 175b469a7e fix typo in activation link notification message
Corrected the English translation for the activation link notification by removing an unnecessary comma in the message.
2025-11-20 17:28:36 +01:00
Linty 31d8f4516c fixes #2450 add user agent in activities performed with api key
Updated user activity display to show when a user is connected via API key, including an icon and updated tooltip. Modified backend to set a 'connected_with' flag in activity details when API key authentication is used.
2025-11-18 15:48:42 +01:00
Linty e0a2a0ba2b fixes #2449 enhance password reset flow with verification and lockout
Added email notification for successful password reset, improved verification code handling, and implemented account lockout after too many failed attempts. Introduced new language strings for user feedback and security messages. Refactored password reset logic to better handle guest/generic users and API key recommendations.
2025-11-17 21:43:14 +01:00
Linty 409d89af4c fixes #2448 update user status label
Changed the "user_status_normal" label from "User" to "Basic" in English and from "Visiteur" to "Basique" in French to improve clarity and consistency in user status naming.
2025-11-17 14:42:22 +01:00
Linty 56a48aa76b fixes #2442 remove "Customize" and related strings from language files
Deleted the "Customize" and "customize the appareance of the gallery" translation strings from all language files. Added a new string for "edit user preferences" in en_UK and fr_FR. This streamlines user preference terminology and removes redundant or outdated translation keys.
2025-11-14 19:44:47 +01:00
Linty c6e4a3f0a5 fixes #2441 add password fields for generic users in user creation
Introduces password and password confirmation fields when creating a user with 'generic' status. The password fields are shown or hidden based on the selected user status, and validation is added to ensure passwords are entered and match. Also adds a button to generate random passwords for new generic users.
2025-11-14 17:45:06 +01:00
Linty c43c3696e0 issue #2440 clear fake user cache on successful login
Added a call to clear_fake_user_cache() in pwg_login to ensure the fake user cache is reset after a successful login. Also introduced the clear_fake_user_cache() function for this purpose.
2025-11-13 15:44:00 +01:00
Linty 0f494baa0c fixes #2440 enhance login security and user activity display
Improves login security by:
- implementing constant-time authentication to reduce timing attacks
- refactoring user lookup into find_user_by_username_or_email() for username or email login
- introducing a fake user to keep password verification time consistent
- adding a finalize_login hook so plugins can control the authentication flow (2FA, rate limiting, etc.)

Also updates user activity JS to:
- better display action details
- properly handle user lists (login/logout with multiple users)
2025-11-13 14:05:35 +01:00
Linty c257866d71 fixes #2436 refactor async upload authentication
Replaces direct login check with ws_session_login for 'pwg.images.uploadAsync' and updates error handling to return the login response. Also updates the web service method definition to make username and password optional and clarifies admin credential requirements in the documentation.
2025-11-13 13:04:22 +01:00
Linty 8fb8f9f8f1 fixes #2430 use configurable user_fields in sql query
Replaced hardcoded 'username' and 'id' fields in the user query with configurable fields from $conf['user_fields'] to improve flexibility and compatibility with custom user schemas.
2025-11-02 13:48:40 +01:00
Linty 443e86aec2 fixes #2428 change language keys for api_key
Replaces 'Public key' references with 'ID' and updates related copy messages in English and French language files and profile template. Also changes key icon to 'icon-user-secret' for better clarity and consistency in the API key generation UI.
2025-10-31 17:08:38 +01:00
Linty 615867a857 fixes #2427 add styles for infos banner
Introduced .infos-message class with specific background, text color, and border styles for both light and dark themes in standard pages.
2025-10-31 14:47:51 +01:00
Linty 696236e76b fixes #2426 move authorization section into test section
Moved API key authentication input from a separate card to the test form section for improved clarity. Updated related CSS for better layout and consistency, and adjusted descriptions to highlight API key usage in Piwigo 16.
2025-10-29 13:00:24 +01:00
Linty d600b019a6 enable qrcode generation for totp secrets
Uncommented and activated QR code generation in getQrCode(), allowing TOTP secrets to be encoded as base64 PNG images for easier setup in authenticator apps.
2025-10-29 12:23:54 +01:00
Linty 99bb370b98 fixes #2425 unescape API key name before returning
Added a call to stripslashes for the 'apikey_name' field to ensure it is unescaped before being returned. This improves display consistency for API key names containing escaped characters.
2025-10-29 12:03:43 +01:00
Linty d6a1cf0466 fixes #2424 remove connection by header from API key validation
Simplifies the API key validation in auth_key_login by removing the requirement for connection_by_header. Now, API keys matching the pattern are accepted regardless of the connection source.
2025-10-29 11:49:19 +01:00
Linty 9ac99be1de fixes GHSA-9986-w7jf-33f6 and fixes GHSA-9986-w7jf-33f6
* Introduces a verification code step before generating password reset links.
* New configuration "password_reset_code_duration".
* Adds Base32, TOTP and PHPQRCode classes .
* New section is required in password.tpl: code verification won't work on themes not updated yet.
* 5 new language strings were added.
2025-10-17 15:38:21 +02:00
Linty 58a9447e01 fixes #2413 tag edit/duplicate now use raw_name as editable value 2025-09-26 13:39:28 +02:00
Linty fcb465f039 fixes #1948 replace cssmin by minify
- switched from cssmin to matthiasmullie/minify for CSS minification.
- the minify lib requires the path-converter lib (from the same author), which has been added as well (in include/minify/path-converter).

This change is necessary because cssmin is not compatible with PHP 8.4
2025-09-23 16:28:29 +02:00
Linty 18bb865a23 fixes #2411 disable 3xl and 4xl by default
- Add 3XL and 4XL sizes to defaults but keep them disabled by default
- Update admin restore default derivatives resets sizes and clears cache
- Update migration 177 => updates existing installs: set 3XL/4XL as disabled
2025-09-19 18:49:05 +02:00
Linty 8682a9bedc issue #2411 cap JPEG quality at 75 for 3XL/4XL derivatives 2025-09-19 18:42:08 +02:00
Linty 1be0527523 issue #2405 update smarty
and made Piwigo compatible with smarty 5.x
2025-09-17 12:05:48 +02:00
Linty 46837567cb issue #2225 fix text color in darkmode 2025-09-16 14:06:19 +02:00
Linty 77c1fdd138 fixes #2225 redesign quick search help popin 2025-09-11 16:54:52 +02:00
Linty 3a10a06b6b issue #2404 update piwigo structure sql 2025-09-08 14:56:43 +02:00
Linty 5221527e04 fixes #2407 allow clicking on section header to expand/collapse
and hide “Show/Hide expired keys” when the user has no expired keys
2025-09-08 14:55:41 +02:00
Linty dbec498287 fixes #2404 notify users of impending API key expiration
Adds logic to detect when an API key is about to expire and sends a notification email to the user if the key expires within 7 days and no recent notification was sent. Introduces a new 'last_notified_on' column to the user_auth_keys table to track notification timing.
2025-09-04 17:21:53 +02:00
Linty c078cffb8b fixes #263 add i18n support to date formatting with IntlDateFormatter
Introduced a new format_date function that uses IntlDateFormatter for proper internationalization when available, falling back to the legacy implementation otherwise. The previous format_date function was renamed to format_date_legacy.
2025-09-04 14:10:12 +02:00
Linty 171e31bea4 issue #2397 keep language selection in the template loading function 2025-08-29 18:33:48 +02:00
Linty 5a9ac7a950 fixes #2397 update language selection handling in profile
Change how user language selection is managed and displayed in the profile page. The selected language is now updated in the user profile (in db) and template variable names have been standardized for consistency.
2025-08-29 18:18:06 +02:00
Linty 613dd410e5 issue #2364 fix guest author name and language key
Added support for bulk comment validation and deletion with updated confirmation messages and translations. Improved modal dialog behavior, including keyboard accessibility and button visibility. Updated CSS for consistent button styling across themes. Fixed author name display for guest comments.
2025-08-26 16:38:11 +02:00
Linty 57042cc475 fixes #2364 redesign admin comments management
Replaces legacy PHP comment management with a new interface for listing, filtering, selecting, validating, and deleting user comments. Updates templates and CSS for a modern, interactive experience, adds advanced filters, selection mode, and modal comment viewing. Removes obsolete server-side logic from comments.php and introduces new api methods for comment actions.
2025-08-26 14:35:31 +02:00
Linty 93cc0e72a8 update toaster template class and fix toast timeout 2025-08-26 14:30:24 +02:00
Linty 61961bd172 issue #2386 reset pagination on date filter change 2025-08-12 16:49:54 +02:00
Linty 4e04ee0f22 issue #2386 fix activity link in admin group list 2025-08-11 15:23:12 +02:00
Linty 2502a44832 issue #2355 hide api keys warning block by default 2025-08-11 10:57:12 +02:00
Linty 5f0dc8548f issue #2355 update piwigo structure sql
and fix api key bug after first install
2025-07-22 18:26:01 +02:00
Linty d613149dfd fixes #2389 filter user activity by object and fix csv export 2025-07-07 10:25:00 +02:00
Linty e28360fc5b fixes #2388 hide update actions for dev mode extensions 2025-07-07 09:53:48 +02:00
Linty eec9a919a5 issue #2355 enforce ui context for API key management
...and improve profile JS. Replaces can_manage_api_key() with connected_with_pwg_ui() to ensure API key management is only allowed from UI logins, and sets 'connected_with' in session during auto-login. Refactors profile.js to respect canUpdatePreferences and canUpdatePassword, moves user state initialization to template, and improves preference reset/default logic. Also adjusts script loading and minor UI details in profile.tpl.
2025-07-07 08:58:27 +02:00
Linty 5e2251dff8 fixes #2383 add custom ellipsis to show end of long album names 2025-07-02 15:42:29 +02:00
Linty ae740ba3af fixes #2355 implement API key management system
- Added API key get, creation, editing, and revocation methods.

- Updated the profile template to include API key management features.

- Updated the database schema to support the new API key system, including additional fields for key management.

- Added client-side JavaScript functionality to handle API key operations and display responses.

- Update tools/htm.ws with the new way to authenticate.

- Restriction of certain api methods when used with an api key

- Backward compatibility with older apps
2025-06-09 20:35:57 +02:00
Linty 2624be1c90 issue #2355 update gallery fontello
add hash and skull icon
2025-06-09 19:34:23 +02:00
Linty 9bcc2cfa02 fixes #2354 add profile standard page 2025-05-05 21:40:59 +02:00
Linty 7f850c2938 issue #2354 update pwg.users.setInfo
and add pwg.users.setMyInfo method
2025-05-05 20:24:05 +02:00
Linty 6c609e5da6 issue #2354 move css content into theme.css 2025-05-05 20:20:39 +02:00
Linty e9b2d64dcf issue #2354 update css 2025-05-05 20:19:07 +02:00
Linty 3b951a0e37 issue #2354 rename common css and js files
reorganisation of common files before adding the standard profile page
2025-04-16 14:26:37 +02:00
Linty 8eae7bafa9 fixes #2340 ensure default group is assigned when adding a new user 2025-03-05 18:00:59 +01:00
Linty 4efcd98036 fixes #2339 prevent backend validation errors...
...by adding frontend checks for albums and tags
2025-03-05 17:22:40 +01:00
Linty c4e23c642f fixes #2337 set correct per_page to avoid excessive requests
...and remove pagination-per-page trigger
2025-03-04 11:08:26 +01:00
Linty 6489dceadf fixes #2329 sequentialize pwg.images.setInfo calls 2025-02-28 10:57:40 +01:00
Linty cc675b712b fixes #2327 standardize password masking length in emails 2025-02-24 13:48:38 +01:00
Linty 8747128289 fixes #2326 move the input to avoid side effects 2025-02-24 10:19:20 +01:00
Linty a0ea91695b fixes #2323 switch language before generating the link 2025-02-14 12:07:11 +01:00
Linty aaec652a66 fixes #2317 adjust users initials in compact and tile view 2025-01-29 10:29:33 +01:00
Linty 1eb083bc63 fixes #2316 improve album selector validation and keyboard interaction
also add an error in the global batch manager when we perform an album association but without choosing an album
2025-01-27 16:08:32 +01:00
Linty e985ba5183 fixes #2315 adjust password page for first login 2025-01-27 15:08:50 +01:00
Linty 8f75afd625 fixes #2314 hide the error message when writing or closing the modal 2025-01-22 14:56:56 +01:00
Linty 64064b5974 fixes #2310 check whether there is a textarea when pressing enter 2025-01-09 10:33:09 +01:00
Linty 8f721fcb8b fixes #2303 replace the password in clear text with asterisks 2025-01-06 16:21:41 +01:00
Linty 627aa045ed fixes #2296 include the correct class file depending on the version of php 2024-12-20 10:45:36 +01:00
Linty 0645372570 fixes #2287 add a new language key 2024-12-19 16:40:38 +01:00
Linty 047a447585 issue #2294 compatibility with PHP 8.4+ for session handling
PHP7+ to PHP 9 compatibility
2024-12-17 12:16:11 +01:00
Linty 5182e69dcd fixes #2286 trigger the click action on pressing enter
...and if the value of applyAction is not equal to -1
2024-12-06 12:02:46 +01:00
Linty 9e9fb327f0 fixes #2290 add user's language prefix to the PEM link 2024-12-05 15:04:50 +01:00
Linty bd9571cb72 fixes #2289 increase modal size and change messages margin 2024-12-05 12:42:10 +01:00
Linty bb8f3d5715 fixes #2287 switch language before sending the email 2024-12-04 15:07:06 +01:00
Linty e2fbf45cd8 fixes #2288 display the correct mail after changed it 2024-12-04 14:54:56 +01:00
Linty 1525f9ced2 fixes #2283 reduce font-size for initials
...and add no wrap for username
2024-11-25 11:27:32 +01:00
Linty 24293ef7c8 issue #2234 continue colour updates for dark mode 2024-11-25 11:08:39 +01:00
Linty 465e6eced4 fixes #2281 rewording set and reset mail content 2024-11-25 11:06:43 +01:00
Linty 6e45a8f426 fixes #2281 use template for reset/activation mail
and change is_first_connection to has_already_logged_in for better naming
2024-11-20 21:06:02 +01:00
Linty f6a3d0749f fixes #2281 rename function for better clarity
first_connexion to is_first_connection
2024-11-20 18:09:02 +01:00
Linty 34296598d4 fixes #2281 add two default conf for reset and activation link
When a password activation or reset link is generated, the link expiry time is now defined in two conf: $conf[’password_reset_duration‘] with a default time of one hour and $conf[’password_activation_duration‘] with a default time of 72 hours.
2024-11-20 17:09:26 +01:00
Linty 431cb4b7b4 fixes #1152 unset last_visit columns from default_user 2024-11-19 17:17:01 +01:00
Linty 0cee869971 fixes #2275 wrap the category name in another span
...with a plaintext style
2024-11-12 14:44:42 +01:00
Linty 25b919390e fixes #2274 load node when moving album in another one 2024-11-12 11:16:26 +01:00
Linty bc0a4bb107 fixes #2237 added a temporary parameter to pwg.images.setInfo
it's also adapted in the batch manager unit js file
2024-11-05 18:20:42 +01:00
Linty 95e85f264e fixes #2253 use only bulk_manager_filter category for album selection
I've also adapted the tpl and js files
2024-10-31 12:13:52 +01:00
Linty 78769be780 fixes #2259 order by activity_id instead of occured_on 2024-10-30 10:43:50 +01:00
Linty 99a3592eae fixes #2258 add invalidate_user_cache in ws_images_deleteOrphans method 2024-10-30 10:27:11 +01:00
Linty 65dce73ef8 fixes #2254 adjust placement of int casting
...for SVG width and height values
2024-10-25 14:30:24 +02:00
Linty 29b1c32fbc fixes #2252 add null check for parent_node
...before accessing properties
2024-10-25 11:43:47 +02:00
Linty 75da48dadd fixes #2252 hide pencil icon during upload
...to prevent opening the album selector
2024-10-24 17:06:44 +02:00
Linty 3a9e5f7dff fixes #2251 add en_UK and fr_FR translation 2024-10-24 16:00:58 +02:00
Linty e53d7332de fixes #2250 add tooltip on main user icon 2024-10-24 16:00:09 +02:00
Linty 4f07c75b89 fixes #2247 load child nodes and open the node
...before adding a new one
2024-10-24 15:10:55 +02:00
Linty 1d087ebefe fixes #2158 refactor user data assignment
...with spread operator for cleaner code. This change also allows for compatibility with additional fields that may be returned by the API, such as those added by plugins, ensuring all elements are captured without explicitly defining each one.
2024-10-16 15:18:05 +02:00