-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memo: code refactoring #324
Comments
@virtualtam I change the class name Auth (the idea came from Laravel) to Authentication but I have some doubt about the unit tests.. can you (or anybody) help with that? |
Sure :) Here is a suggestion for grouping and renaming existing methods into new
#1008 -
#1005 -
Now regarding how to proceed (& split work into sub-tasks):
|
Relates to shaarli#324 Added: - `SessionManager` class to group session-related features - unit tests Changed: - `getToken()` -> `SessionManager->generateToken()` - `tokenOk()` -> `SessionManager->checkToken()` - inject a `$token` parameter to `PageBuilder`'s constructor Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Changed: - `is_session_id_valid()` -> `SessionManager::checkId()` - update tests Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Relates to shaarli#324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <[email protected]>
Closing as stale / obsolete. |
Motivation
Refactoring serves multiple purposes:
index.php
See also: #71, #95, #130
Tasks
Remove dead code
json_encode
get_magic_quotes_gpc
,stripslashes_deep
Date formatting
#270 / #486 - Use DateTime to format dates and timestamps
linkdate2timestamp
linkdate2rfc822
linkdate2iso8601
Feed
#273, #515 - use templates for Atom & RSS feeds
showATOM
showRSS
showDailyRSS
HTML generation
#397 #560 - move
PageBuilder
to a proper filebuildLinkList
pageBuilder
(class)renderPage
(the one chunk)showDaily
HTTP
#332 - Detect https protocol by reverse-proxy rfc7239 : X-Forwarded-Proto
#333 - Refactor HTTP / Url functions => #334, #346
serverUrl
indexUrl
pageUrl
http_parse_headers_shaarli
getHTTP
Images
#345 - Refactor thumbnail functions
#687 - Use web-thumbnailer to retrieve thumbnails
computeThumbnail
genThumbnail
lazyThumbnail
resizeImage
thumbnail
Import & export
#493, #607 - Netscape import
#538 - Netscape export
importFile
Links
html_extract_title
Shaarli utilities
#372 - Introduce a Shaarli class to group install/compatibility/update checks
#40 - Require write permissions only for relevant directories
#396 - application: refactor the install form generation
checkUpdate
checkPHPVersion
install
Session & login management
#1005 - Refactor session management utilities
#587 - Improve IP ban file format
#1008 - Refactor login / ban management
setup_login_state
allIPs
fillSessionInfo
check_auth
isLoggedIn
logout
ban_loginFailed
ban_loginOk
ban_canLogin
getToken
tokenOk
Utilities
#437 - Logging: move logm() from index.php to application/Utils.php
#800 - Fix a warning generated in
return_bytes
and refactor it#1122 - Replace logm() with a PSR-3 logger
logm
return_bytes
getMaxFileSize
Contributing
If there's a topic you'd like to work on, please say so in the comments or have a chat on Gitter before starting to code ;-)
Topics related to active issues will get extra attention.
I'll keep this issue updated as cleanup is progressing.
The text was updated successfully, but these errors were encountered: