I'm not sure if this is related to the captcha module, or the textimage module (drupal 5.x). However, I have both installed, and use image verification when logging in.
If the site is offline for maintenance, I should still be able to log in as admin. However, in this instance, the captcha image is "not available" on the login page. If the site is online, the image appears.
Previously, the only time I happened to see this "not available" message was when I first installed the modules and hadn't yet set up the permissions properly for anonymous user within the captcha setup.
Anyway, I was using two different browsers, and was still logged in within one of them, so I could put the site back online.
Not sure if this is a bug, or just something I've done wrong, but I thought I should post it anyway.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | offlinemode_3.patch | 1.22 KB | soxofaan |
| #8 | offlinemode_2.patch | 1.18 KB | soxofaan |
| #7 | offlinemode.patch | 1.18 KB | soxofaan |
| #6 | image_captcha.module.siteoffline.patch | 864 bytes | robloach |
Comments
Comment #1
robloachThis could potentially be a huge problem. Does it still occur? Apply the other user login/user login block patch before testing...
Comment #2
soxofaan commentedThis is indeed a very tricky problem
The image CAPTCHA involves 2 HTTP requests:
In offline mode only the "?q=user" request is permitted for unauthenticated users.
So it's impossible to generate any image within the same Drupal setup.
The problem is unrelated to the login patches Rob refers to.
The only solution I see is disabling the image CAPTCHA for login forms when in offline mode (and maybe falling back on Math or something)
Comment #3
robloachI'd suggest doing one of two things:
Personally, I'd just disable it when the site is in offline mode. Much easier and would prevent people from locking themselves out of their own site.
Comment #4
soxofaan commentedI see three options to fix this:
I'm not sure yet what would be the best
Comment #5
robloachI think falling back to Math Captcha is the easiest solution when you're using Image Captcha and the site is offline. Not many people will be attempting to log in when a site is offline, since only user/1 has the privileges to log in. If the site is using Image Captcha and it's offline, I think falling back to Math Captcha would provide enough security to stop the majority of attacks. It's also not often that a site goes completely offline. This simple work around should be enough, at least for now.
Comment #6
robloachThis patch will make it so that when the site is offline, it falls back to the Math Captcha.
Comment #7
soxofaan commentedLooks fine.
I would add some documentation though
and I would only fall back to math captcha for unauthenticated users, that way the super user (user 1) still can see the preview/examples of the image captcha.
see attached patch.
Comment #8
soxofaan commentednew version which removes the $args variable in the patch (where did that come from in the first place, Rob?)
Comment #9
robloachThought I should put $args in there to pass whatever is left in the _captcha function's arguments onto Math Captcha. Since Math Captcha doesn't take any more arguments, I guess it isn't needed.
Comment #10
robloachThis conflicts with the recently committed patches. Needs re-issue.
Comment #11
soxofaan commentedConflict is because http://drupal.org/cvs?commit=81498 (about the cleaner persistence widget) included the offline-mode patch from #6. I guess this was not intentional.
updated patch from #8 in attachment.
Comment #12
robloachYay!... But, should it be:
... $user->uid != 1 instead? I guess it wouldn't really make a difference.
Comment #13
soxofaan commentedMakes sense, but no difference ;)
No problem for me to change it.
Comment #14
IKN commentedSorry, but
1. I don't see which patch is approved yet nor
2. how to use add it.
3. Is there a new version of the module that integrates this fix?
I haven't added a patch yet and don't want to screw up a production site. Any answers to 1, 2 and 3 would be much appreciated.
Thank you.
David
Comment #15
robloachIt is already a part of 5.x-3.x-dev.
Comment #16
(not verified) commented