-
Notifications
You must be signed in to change notification settings - Fork 79
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
Fixing a bug and adding support for custom save device days and latest RC elastic skin. #165
base: master
Are you sure you want to change the base?
Conversation
This is a PR for following proposed changes:- Adding support to custom save device with X days Adding support for recent Roundcube elastic skin, i.e. tested on 1.6. Fixed the bug when activated already TFA is not being reflected in the settings.
Doesn't work for me. I get an error on the plugin settings page Oops... something went wrong!An internal error has occurred. Your request cannot be processed at this time. Merged config changes in config.inc.php
FreeBSD 13.1 / PHP 8.1.9 / Roundcube 1.6.0 Can't find errors in the error.log or php-fpm logs |
I have tested on php 8.1.3 and RC 1.6 and it works fine, anyhow I will carry more tests tomorrow and will keep you updated. For the time being, I recommend to debug with following method, try to use log_error(print_r($anyvariable,true)) and figure out at which line the plugin breaks, also, try to check web server logs and RC logs/errors.log and I would appreciate if you can post any found errors, with thanks. Zakaria. |
I made few changes, not sure if they will fix the bug, but I recommend to give it a go 👍 . Also, make sure to set $rcmail_config['enable_ua2fa'] to false, if you are not using users_allowed_2fa option, or comment it out its enabling configuration. Also, make sure to adjust the language you use to reflect the following modified label:- $labels['dont_ask_me_xdays'] = 'Don't ask me codes again on this computer for % days'. Also, when cloning the repo, make sure to run git checkout patch-1. Good luck. Zakaria. |
Thanks! Testing!
Naturally added your repo to the remotes and pulled the patch-1 branch. Using that to generate diffs I can add to the FreeBSD port. No luck with this yet, still get that same fatal error message. Any clue how I can enable more logs (without resorting to PHP xdebug)? Whilst you're at it: Should be able to reuse that as prefix in
|
Found and enabled the debug_logger plugin. Not much more info to be found.
|
With that being said, I recommend this hacky way, open twofactor_gauthenticator.php and in each method at the beginning add
Keep moving logging call down the lines until you find at which point the plugin breaks i.e. you wont find any new logs. I would appreciate if you can send over the results. With thanks. Zakaria. |
Got something, added
early in the plugin, now I have something useful
|
There you go! Fixes the error if no twofactor_gauthenticator element is found in the user's prefs.
|
To update all localizations in one go, you can run
|
I think you've missed the array in array_key_exists parameter, given this is its format. Anyhow, I've just submitted this fix along in patch-1, and thanks for it as well as the sed tip, its very much appreciated. |
Yep, was monkey-patching that in live env and replicating back to the git repo. Thanks for bringing this plugin up-to-date!! |
The recovery codes don't show for me... Improved logging a bit
|
I recommend to check browser console, it could be a Javascript issue or another array_key_exists missing, anyhow it works for me just fine. |
I try to check with your code but code is incorrect every time I try to config with all fields. Do you have test this? |
Yes, I did test this on RC 1.6 and it works. Please try after recent commit. Since I made several changes from first commit. |
* Mark 8.1 compatible for Roundcube 1.6.0 * Add patch [1] [1]: alexandregz/twofactor_gauthenticator#165 PR: 265653
An update, I just fixed one tiny bug in X days. |
* Mark 8.1 compatible for Roundcube 1.6.0 * Add patch [1] [1]: alexandregz/twofactor_gauthenticator#165 PR: 265653
Hi, @InputOutputZ Can you please fix the extraneous @alexandregz Saw your comment on your failing test(s), can you elaborate? Really would like to see a new release for this. |
Just fixed it. Mind me, for localisation, I will leave it for @alexandregz to look after, since the code you provided works only for English localisation. Zakaria. |
Tiny bug fix. Email address is set to undefined in the authenticator app. |
This is a PR for following proposed changes:-
Adding support for custom save device with X days
Adding support for recent Roundcube elastic skin, i.e. tested on 1.6.
Fixed the bug when activated already TFA is not being reflected in the settings.
Adding support for customised QR image colour in config options.