Authimage finally working!

Big thanks to Gudlyf for his WordPress hack Authimage! Initially, I had a bit of difficulty getting it to work. My biggest problem was that it would not recognize that I entered the correct code. I noticed other people had posted problems about this, but no solutions were proposed. If you’re having a similar problem, read on.
    My directory structure and relevant files, for reference:

  • / (Root/Top-level directory of website.)
    • authimage.php
    • atomicclockradio.ttf
  • /tmp/ (This is where authimage creates temporary images.)
  • /blog/wordpress/
    • my-hacks.php
    • wp-comments.php
    • wp-comments-post.php
Please note that my blog directory is not the default wordpress directory. In fact, my wordpress directory is within my blog directory. The README tells you to copy the functions in “authimage-hacks.php” to your “my-hacks.php” file, but it does not mention anything about modifying any of those functions. In the function checkAICode, I had to change
$tmp_code_loc = getcwd() . $tmp_code_loc;

to

$tmp_code_loc = getcwd() . “/../..” . $tmp_code_loc;
This is because the “my-hacks.php” file must be in the wordpress directory, and the temporary image files are created in the /tmp/ directory. The functions in “my-hacks.php” must be able to access the image files to compare the filenames with the entered code. I also had to modify “authimage.php” to point to the correct “my-hacks.php” file. I changed
require_once(ABSPATH . ‘my-hacks.php’);

to

require_once(ABSPATH . ‘blog/wordpress/my-hacks.php’);
That was basically it! Everything else was according to the README file. Hope that helps someone.

3 comments

  1. Pingback: the salmon farm
  2. Just to put the TrackBack in context (I just noticed I don’t mention your site anywhere in the post), I needed to add your modifications to get my site working too. Cheers, you saved me a lot of hair-pulling-out time!

Leave a comment

Your email address will not be published. Required fields are marked *