aboutsummaryrefslogtreecommitdiff
path: root/app/Models/UserDAO.php
AgeCommit message (Collapse)Author
2024-12-27PHPStan 2.0 (#7131)Gravatar Alexandre Alapetite
* PHPStan 2.0 fix https://github.com/FreshRSS/FreshRSS/issues/6989 https://github.com/phpstan/phpstan/releases/tag/2.0.0 https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md * More * More * Done * fix i18n CLI * Restore a PHPStan Next test For work towards PHPStan Level 10 * 4 more on Level 10 * fix getTagsForEntry * API at Level 10 * More Level 10 * Finish Minz at Level 10 * Finish CLI at Level 10 * Finish Controllers at Level 10 * More Level 10 * More * Pass bleedingEdge * Clean PHPStan options and add TODOs * Level 10 for main config * More * Consitency array vs. list * Sanitize themes get_infos * Simplify TagDAO->getTagsForEntries() * Finish reportAnyTypeWideningInVarTag * Prepare checkBenevolentUnionTypes and checkImplicitMixed * Fixes * Refix * Another fix * Casing of __METHOD__ constant
2024-08-16Fix HTTP cache of user queries (#6718)Gravatar Alexandre Alapetite
fix https://github.com/FreshRSS/FreshRSS/issues/6717
2024-04-21Windows: release SQLite (#6285)Gravatar Alexandre Alapetite
* Windows: release SQLite fix https://github.com/FreshRSS/FreshRSS/issues/6275 * Do not use sharedPdo for deleting user * Case of same user * Help PHPStan
2023-11-16Use strict_types (#5830)Gravatar Luc SANCHEZ
* Little's optimisations and booleans in conditions * Apply strict type * Apply strict type * Apply strict type * Fix multiple bugs with PHP 8.2 and 8.3 * Many declares missing, more errors fixed * Apply strict type * Another approach * Stronger typing for Minz_Session * Fix case of SQLite --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-09-12SQL: clean old auto-updates (#5649)Gravatar Alexandre Alapetite
Should help with some DB lock issues. Complete https://github.com/FreshRSS/FreshRSS/pull/3558 after https://github.com/FreshRSS/FreshRSS/pull/5625 already cherry-picked from it. * Removed auto-update of MySQL GUID case sensitivity https://github.com/FreshRSS/FreshRSS/pull/2078 * Contributed to a DB lock in https://github.com/FreshRSS/FreshRSS/issues/5008 Also removed the following non-problematic auto-updates, simply because they were older than the above ones * Auto-create custom labels (1.12.0) https://github.com/FreshRSS/FreshRSS/pull/2027 * Auto-add JSON column for feeds (1.11.0) https://github.com/FreshRSS/FreshRSS/pull/1838 * Auto-create temporary tables (1.7.0) https://github.com/FreshRSS/FreshRSS/pull/1470
2023-03-31PHPStan level 6 for all PDO and Exception classes (#5239)Gravatar Alexandre Alapetite
* PHPStan level 6 for all PDO and Exception classes Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112 * Fix type * Now also our remaining own librairies * Motivation for a few more files * A few more DAO classes * Last interface
2023-03-26Modernize Constants and use new constant for string 'currentUser' (#5089)Gravatar Luc SANCHEZ
* Modernize Constants and use new constant 'currentUser' * Add FreshRSS_Context::currentUser() function and use * Add FreshRSS_Context::currentUser() function and use * Add FreshRSS_Context::currentUser() function and use * Add FreshRSS_Context::currentUser() function and use * Add FreshRSS_Context::currentUser() function and use * Update app/Controllers/userController.php * Update app/Controllers/userController.php * Update app/Controllers/userController.php * Update app/Models/Auth.php * Update p/api/greader.php * Update p/api/greader.php * Update p/api/greader.php * Update app/Models/Context.php * Update app/Models/LogDAO.php * Update lib/Minz/Log.php * Update p/api/greader.php * Update app/layout/header.phtml * Update app/views/helpers/export/articles.phtml * Update cli/do-install.php * Remarque's from Alkarex * Remarque's from Alkarex * Refactor using new Minz_User class * Consistent naming of public constants --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-01-02Fix regression user init (#4116)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/4115
2021-12-31Add PHPStan (#4021)Gravatar Alexandre Alapetite
* Add PHPStan #fix https://github.com/FreshRSS/FreshRSS/issues/4016 https://phpstan.org/ ```sh composer run-script phpstan ``` * More fixes * Fix global variables * Add .phtml * Fix merge https://github.com/FreshRSS/FreshRSS/pull/4090 * Fix more warnings * Fix view errors and enable in CI * ReturnTypeWillChange * Dynamic view type * Fix Minz static/self bug
2021-12-02Fix some PHPstan errors (#4019)Gravatar Alexandre Alapetite
Fix some wrong variables found by https://github.com/FreshRSS/FreshRSS/issues/4016
2019-11-04Default or custom OPML (#2627)Gravatar Alexandre Alapetite
* Default or custom OPML Fix https://github.com/FreshRSS/FreshRSS/issues/2075 Replaces https://github.com/FreshRSS/FreshRSS/pull/2515 https://github.com/FreshRSS/FreshRSS/issues/2514 Uses the local ./data/opml.xml if it exists, otherwise ./opml.default.xml * Better message * Move to controller
2019-10-23Feature/new archiving (#2335)Gravatar Alexis Degrugillier
* Change archiving config page layout I've changed some wording and moved actions into a maintenance section. * Update purge action Now we have more control on the purge action. The configuration allows us to choose what to keep and what to discard in a more precise way. At the moment, the configuration applies for all feeds. * Add purge configuration on feed level Now the extend purge configuration is available on feed level. It is stored as attributes and will be used in the purge action. * Update purge action Now the purge action uses the feed configuration if it exists and defaults on user configuration if not. * Add empty option in period list * Fix configuration warnings * Add archiving configuration on categories See #2369 * Add user info back * Add explanations in UI * Fixes for SQLite + error + misc. * Fix invalid feed reference * Short array syntax Only for new code, so far * Fix prefix error * Query performance, default values Work in progress * Fix default values and confirm before leaving Form cancel and confirm changes before leaving were broken. And start taking advantage of the short echo syntax `<?= ?>` as we have moved to PHP 5.4+ * More work * Tuning SQL * Fix MariaDB + performance issue * SQL performance * Fix SQLite bug * Fix some attributes JSON encoding bugs Especially for SQLite export/import * More uniform, fix bugs More uniform between global, category, feed settings * Drop special cases for old articles during refresh Instead will use lastSeen date with the new archiving logic. This was generating problems anyway https://github.com/FreshRSS/FreshRSS/issues/2154 * Draft drop index keep_history Not needed anymore * MySQL typo Now properly tested with MySQL, PostgreSQL, SQLite * More work for legacy values Important to avoid overriding user's preference and risking deleting data erroneously * Fix PHP 7.3 / 7.4 warnings @aledeg "Trying to use values of type null, bool, int, float or resource as an array (such as $null["key"]) will now generate a notice. " https://php.net/migration74.incompatible * Reintroduce min articles and take care of legacy parameters * A few changes forgotten * Draft of migration + DROP of feed.keep_history * Fix several errors And give up using const for SQL to allow multiple database types (and we cannot redefine a const) * Add keep_min to categories + factorise archiving logic * Legacy fix * Fix bug yield from * Minor: Use JSON_UNESCAPED_SLASHE for attributes And make more uniform * Fix sign and missing variable * Fine tune the logic
2019-10-06SQL allow recreating existing user (#2555)Gravatar Alexandre Alapetite
* SQL allow recreating existing user Taking advantage of https://github.com/FreshRSS/FreshRSS/pull/2554 In a case when FreshRSS data is lost, but database data still intact (in particular MySQL or PostgreSQL), this patch allows recreating previous users without error * Better error retrieval Especially when error occur during the prepare statement
2019-09-29PDO refactoring for code simplification (#2522)Gravatar Alexandre Alapetite
* PDO refactor * Automatic prefix when using the syntax `_tableName` * Uniformity: MySQL is now PDO::ATTR_EMULATE_PREPARES = false just like SQLite and PostgreSQL, with consequences such as only one statement per query * Use PDO methods exec(), query(), prepare() + execute() in a more efficient way * Remove auto-update SQL code for versions older than FreshRSS 1.5 (3 years old) * The name of the default category is set in PHP instead of in the DB (simplies SQL and allows changing the name according to the FreshRSS language) * Rename `->bd` to `->pdo` (less of a frenshism, and more informative) * Fix some requests, which were not compatible with MySQL prepared statements * Whitespace * Fix syntax for PostgreSQL sequences + MySQL install * Minor formatting * Fix lastInsertId for PostgreSQL * Use PHP 5.6+ const Take advantage of https://github.com/FreshRSS/FreshRSS/pull/2527 https://www.php.net/manual/en/migration56.new-features.php * A bit of forgotten PHP 5.6 simplification for cURL * Forgotten $s * Mini fix custom user config https://github.com/FreshRSS/FreshRSS/pull/2490/files#r326290346 * More work on install.php but not finished * install.php working * More cleaning of PDO in install * Even more simplification Take advantage of PDO->exec() to run multiple statements * Disallow changing the name of the default category https://github.com/FreshRSS/FreshRSS/pull/2522#discussion_r326967724
2019-09-15CLI to export/import any database to/from SQLite (#2496)Gravatar Alexandre Alapetite
* CLI to export/import any database to/from SQLite Require PHP 5.5+ https://github.com/FreshRSS/FreshRSS/pull/2495 * Travis * Execution rights * Fix wrong static fields * Fix MySQL bad default buffering https://stackoverflow.com/questions/6895098/pdo-mysql-memory-consumption-with-large-result-set/6935271#6935271 https://php.net/manual/ref.pdo-mysql * Fix count on progression * Avoid static DB information To ease working with two DBs at the same time * Less static, simplify Needs some testing * Small corrections * Special case for SQLite to SQLite * Modify special case for SQLite * Remove special case for SQLite More uniform logic for the 3 databases. Fix wrong DROP TABLE for SQLite. * Drop indexes * Revert "Drop indexes" This reverts commit f28d2bae0935745c1c74ea38f2ee083f3fd4bf9d. * Fix deletion * Fix classic export * Update cli/README.md Co-Authored-By: Marien Fressinaud <dev@marienfressinaud.fr> * Addressing part of review * Remove goto :cry: * Travis * Comment for SQLite case * Fix missing fields when inserting
2019-09-11add: Allow admins to configure default feeds (#2515)Gravatar Marien Fressinaud
* Homogenize SQL_INSERT_FEEDS across database types * Extract default feeds into system configuration * Adapt default feeds init during installation
2019-01-02HTTP authenfication fixes (#2204)Gravatar Alexandre Alapetite
* Security fixes when HTTP user does not exist in FreshRSS * Accept HTTP header X-WebAuth-User for delegated HTTP Authentication (e.g. Træfik) * Document delegated HTTP authentication from https://github.com/FreshRSS/FreshRSS/pull/2202
2018-09-29Custom labels (#2027)Gravatar Alexandre Alapetite
* First draft of custom tags https://github.com/FreshRSS/FreshRSS/issues/928 https://github.com/FreshRSS/FreshRSS/issues/1367 * SMALLINT to BIGINT for id_entry And uppercase SQL types * Fix layout for unreads * Start UI menu * Change menu order * Clean database helpers https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r217971535 * Travis rules do not understand PostgreSQL constants Grrr * Tag controller + UI * Add column attributes to tags * Use only favicon for now, for label * Fix styling for different themes * Constant for maximum InnoDB index length in Unicode https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r219052200 (I would have personnally prefered keeping the readability of a real value instead of a constant, in this case of many SQL fields) * Use FreshRSS_Factory::createCategoryDao * Add view of all articles containing any tag * Fix search in tags * Mark as read tags * Partial auto-update unread tags * More auto update tag unreads * Add tag deletion * Do not purge tagged articles * Minor comment * Fix SQLite and UI bug * Google Reader API support for user tags Add SQL check that tag names must be distinct from category names * whitespace * Add missing API for EasyRSS * Compatibility SQLite Problematic parentheses * Add SQL DISTINCT for cases with multiple tags * Fix for PostgreSQL PostgreSQL needs some additional type hint to avoid "could not determine data type of parameter $1" http://www.postgresql-archive.org/Could-not-determine-data-type-of-parameter-1-tp2171092p2171094.html
2017-09-22[ci] Add Travis (#1619)Gravatar Frans de Jonge
* [ci] Add Travis * Exclude some libs * Semi-auto whitespace fixes * line length in SQLite * Exclude tests from line length * Feed.php line length * Feed.php: get rid of unnecessary concat * Feed.php: line length * bootstrap.php: no newline at end of file * Allow concatenating across multiple lines * Add Travis badge * do-install line length * update-or-create-user line length * cli/create-user line length * tests/app/Models/SearchTest.php fix indentation * tests/app/Models/UserQueryTest.php fix indentation * tests/app/Models/CategoryTest.php fix indentation * [fix] PHP 5.3 on precise * cli/do-install no spaces * cli/list-users line length * cli/reconfigure line length * empty catch statements * api/index line length nonsense * spaces before semicolon * app/Models/EntryDAO bunch of indentation * extra blank lines * spaces before comma in function call * testing tabwidth * increase to 10 * comment out tabwidth line * try older phpcs version 3.0.0RC4 * line length exception for app/install.php * proper spaces * stray spaces in i18n * Minz/ModelPdo line length * Minz whitespace * greader line length * greader elseif placement * app/Models/Feed.php spacing in function argument * ignore php 5.3 * app/Models/ConfigurationSetter.php stray whitespace * EntryDAOSQLite line length * I vote for higher max line length =P * ignore SQL * remove classname complaint * line length/more legible SQL * ignore line length nonsense * greader line length * feedController issues * uppercase TRUE, FALSE, NULL * revert * importExportController lowercase null * Share.php default value not necessary because ! is_array () a few lines down * CategoryDAO constants should be UPPERCASE * EntryDAO reduce line length * contentious autofix * Allow failures on all versions of PHP except 7.1 because reasons
2017-03-26Candidate implementation of defered insertionGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/530
2017-02-25Missing checkUsername and const pattenGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/pull/1423 https://github.com/YunoHost-Apps/freshrss_ynh/issues/27#issuecomment-279792363
2016-11-06Fix small bugs in installGravatar Alexandre Alapetite
Small fixes in install (e.g. better check that DB password works)
2016-11-05Add CLI for user information + Fix last user activityGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1345
2016-10-24CLI option no-default-feedsGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1095
2016-10-04Fix bug language option for new userGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1273
2016-10-01PostgreSQL multiuser bugGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/pull/1195
2015-01-06Fix last calls to Minz_Configuration methodsGravatar Marien Fressinaud
- We have still to fix actualize_script and greader api (refactoring?) - We have to fix the FreshRSS_Configuration calls - We have to fix availableLanguages calls See https://github.com/FreshRSS/FreshRSS/issues/730
2014-12-21BREAKING FEATURE: move user dataGravatar Marien Fressinaud
- Create ./data/users/ folder - Move user configuration to ./data/users/username/config.php - Move sqlite db to ./data/users/username/db.sqlite - Move user logs to ./data/users/username/log.txt See https://github.com/FreshRSS/FreshRSS/issues/729
2014-12-11Fix french i18n for install + some fixesGravatar Marien Fressinaud
French is finished!
2014-10-29Ne pas rafraîchir les flux des utilisateurs non logués depuis x joursGravatar Alexandre Alapetite
https://github.com/marienfressinaud/FreshRSS/issues/681 Warning: needs some testing
2014-10-17Show more information about user when selectedGravatar Marien Fressinaud
2014-10-05Replace Minz_Log::record by corresponding methodsGravatar Marien Fressinaud
Please not use Minz_Log::record anymore! See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-05Let's begin the big refactoring!Gravatar Marien Fressinaud
Minz_Translate::t\s? replaces by _t See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-08-09SQLite: Bug creation new usersGravatar Alexandre Alapetite
Not tested much yet. Some MySQL parts changed a bit too to double-check. https://github.com/marienfressinaud/FreshRSS/issues/574
2014-07-26Correct bug in add/remove usersGravatar plopoyop
2014-07-03Preparation for SQLiteGravatar Alexandre Alapetite
https://github.com/marienfressinaud/FreshRSS/issues/100
2014-01-01SQL : Insère la catégorie par défaut dès la création des tablesGravatar Alexandre Alapetite
2013-12-31Multi-utilisateur fonctionnel en HTTP AuthGravatar Alexandre Alapetite
+ Possibilité d'ajout / suppression d'utilisateur (seulement par l'administrateur) + Divers changements pour le mode multi-utilisateur https://github.com/marienfressinaud/FreshRSS/issues/126 + Minz : Renomme "sel_application" en "salt'