Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Update: Human confirmation v1.1


Bansai

Recommended Posts

Just an other update ...

 

Small changes in:

catalog/includes/human_confirmation.php

 

No need to update, but it makes youre live easier :wink:

 

I found that it is difficult to test and change the numberimages.

Every time i change the images and have imagesizes other then befor i must also change the variables in "human_confirmation.php" too.

So i make a update that self-detect the size of the images.

Hope that helps testing a Shop.

 

Bansai!

Yip yip yip yip yap yap yip *BANG* --- NO TERRIER

Link to comment
Share on other sites

  • 2 months later...

I installed this contribution on my test page and I am not having any luck. I have rechecked all the code changes, and it is consistent with the instructions. I changed the permissions on the image folder to 775, and I still keep getting the error message:

 

Warning: imagejpeg(): Unable to open 'images/number_pics/_confirmpic807540.jpg' for writing in /home/admin/domains/phulbari.com/public_html/includes/human_confirmation.php on line 68

 

 

Has anyone seen this problem? I also noticed that if I refresh the page, the human confirmation box is not presented. Why is this?

 

Please help!

 

Rajeev

your source for custom hand-knotted rugs from Nepal.

A part of family of companies.

Link to comment
Share on other sites

I have just installed this mod and am receiving the following error:

 

Fatal error: Call to undefined function: imagecreate() in /home/ukhealth/public_html/catalog/includes/human_confirmation.php on line 77

 

I have check the install details and everything is correct! Is this possibly a problem with my server config?

 

If anyone can help...I would be grateful. Thanks in advance.

Link to comment
Share on other sites

1. Sorry Guys, i was off for some time ...

 

2. @rejeevk

 

That error is a permission problem. Not only you must have the permissin to write - also GD-Lib must have ! Test it with CHMOD 777 and maybe you can restrict the access to a serverside access ( w/ .htaccess)

 

3. @stevec0023

 

You dont have GD-Lib installed on your Server (or a wrong version) Sorry the Contrib dont work without GD-Lib !

 

Bye and Bansai!

Yip yip yip yip yap yap yip *BANG* --- NO TERRIER

Link to comment
Share on other sites

I have just installed this mod and am receiving the following error:

 

Fatal error: Call to undefined function: imagecreate() in /home/ukhealth/public_html/catalog/includes/human_confirmation.php on line 77

 

I have check the install details and everything is correct! Is this possibly a problem with my server config?

 

If anyone can help...I would be grateful. Thanks in advance.

Try changing the function imagecreate() to @imagecreate(). That should fix it.

 

Good luck! Please let us know if this solution worked for you.

your source for custom hand-knotted rugs from Nepal.

A part of family of companies.

Link to comment
Share on other sites

I changed the security on the folder to 777, and now I can see the image. However, when I hit the refresh button, the "Human Confirmation" box is not presented. Any idea why?

your source for custom hand-knotted rugs from Nepal.

A part of family of companies.

Link to comment
Share on other sites

  • 2 weeks later...

Hi!

Can anyone help me to fix this?

Im trying to get the:

Human confirmation V 1.0

http://www.oscommerce.com/community/contributions,1476

 

to work with latest CVS (031208) but i only get:

 

Fatal error: Call to undefined function: _session_is_registered() in /home/n/nysite/www/shop/create_account.php on line 508

 

 

line 508 is:

 

 

  if (!tep_session_is_registered('noautamationcode')) tep_session_register('noautamationcode');
 include('includes/human_confirmation.php');
 tep_session_close('noautamationcode');

 

 

 

i know that tep_session are going to be removed but how do i fix this?

 

Please post the fixez in the code that i have to do.

 

BIG THANKS IF SOMEONE CAN HELP ME!

 

 

================================================================================
==================
1. -> find: ( ~ line 18-20 )
================================================================================
==================

$process = false;
if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
  $process = true;

================================================================================
==================
change to ->
================================================================================
==================

$process = false;

// BOF // Contrib: Human confirmation v1

$thecode_okay = false;
$process_okay = false;
$noautomationcode = $HTTP_SESSION_VARS["noautamationcode"];

// -> v1.1 // Changed to work w/ random image names
$img_dir  = $HTTP_SESSION_VARS["noautamationdir"];
$img_name = $HTTP_SESSION_VARS["noautamationname"];
// Find and delete old images
if (strlen($img_name) >= 6) {
  $dirHandle = dir($img_dir);
  while($fileHandle = $dirHandle->read()) {
    if (substr($fileHandle,0,strlen($img_name)) == $img_name)
      @unlink($img_dir.$fileHandle);
  }
  $dirHandle->close();
}
// <- v1.1 // Changed to work w/ random image names

$thecode_okay = (isset($HTTP_POST_VARS['thecode']) && ($HTTP_POST_VARS['thecode'] == $noautomationcode ));
$process_okay = (isset($HTTP_POST_VARS['action'])  && ($HTTP_POST_VARS['action'] == 'process'));
if ( ($process_okay == true) && ($thecode_okay == true) ) {

// EOF // Contrib: Human confirmation v1

  $process = true;

================================================================================
==================
2. -> find: ( ~ line 476-490 )
================================================================================
==================

    <tr>
      <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
        <tr class="infoBoxContents">
          <td><table border="0" cellspacing="2" cellpadding="2">
            <tr>
              <td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
              <td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td>
            </tr>
          </table></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>

================================================================================
==================
change to ->
================================================================================
==================

    <tr>
      <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
        <tr class="infoBoxContents">
          <td><table border="0" cellspacing="2" cellpadding="2">
            <tr>
              <td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
              <td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td>
            </tr>
          </table></td>
        </tr>
      </table></td>
    </tr>

<?PHP
// BOF // Contrib: Human confirmation v1

 if (!tep_session_is_registered('noautamationcode')) tep_session_register('noautamationcode');
 include('includes/human_confirmation.php');
 tep_session_close('noautamationcode');

// EOF // Contrib: Human confirmation v1
?>

    <tr>
      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>

================================================================================
==================

 

 

 

 

RGDS Phiberz

Link to comment
Share on other sites

  • 3 months later...

Hi,

 

The script seems to work for me, the only thing is that I don't seem to get any warning messages when I create a new account and I don't fill in the required numbers. But it does prevent the script from being processed.

 

Could someone explain how I would do this. I'm pretty sure I need to do something like:

 

Create_account.php

$messageStack->add('create_account', ENTRY_HUMANCHECK_ERROR);

 

 

I've tried using this below in the human_confirmation.php in english, but I still don't recieve any warnings that the numbers were not entered

define('ENTRY_HUMANCHECK_ERROR', 'You need to type in the security numbers shown');

Link to comment
Share on other sites

  • 1 month later...

phiberz, I don't know if you've solved this:

 

Fatal error: Call to undefined function: tep_session_is_registered()in /home/n/nysite/www/shop/create_account.php on line 508

 

 

I was able to solve the same problem by adding this line:

 

  require('includes/functions/sessions.php');

 

near the beginning of create_account.php

Link to comment
Share on other sites

My web hosting provider has GB-Lib 2.0.15 installed/enabled.....followed the steps provided in the contribution but now, I get the following error on the account registration page:

 

Fatal error: session_register(): Failed to initialize storage module. in /home/cbadmin/public_html/includes/functions/sessions.php on line 74

 

Please advise what went wrong?

Link to comment
Share on other sites

My web hosting provider has GB-Lib 2.0.15 installed/enabled.....followed the steps provided in the contribution but now, I get the following error on the account registration page:

 

Fatal error: session_register(): Failed to initialize storage module. in /home/cbadmin/public_html/includes/functions/sessions.php on line 74

 

Please advise what went wrong?

Link to comment
Share on other sites

  • 3 months later...

how can i set up GB Lib i keep getting this error:

 

Fatal error: Call to undefined function: imagecreate() in c:\program files\apache group\apache\htdocs\catalog\includes\human_confirmation.php on line 77

Did you try? Did you fail? No matter! Try again. Fail again! But fail better!

Link to comment
Share on other sites

  • 5 months later...

Great contribution, thanks!

 

I had to move the folder containing the number images out of /images/ and place it off of the Root folder. And I had to also change the settings to 777 to get it to work. Is this OK? I think it is.

Link to comment
Share on other sites

  • 1 year later...
My web hosting provider has GB-Lib 2.0.15 installed/enabled.....followed the steps provided in the contribution but now, I get the following error on the account registration page:

 

Fatal error: session_register(): Failed to initialize storage module. in /home/cbadmin/public_html/includes/functions/sessions.php on line 74

 

Please advise what went wrong?

 

I seem to have the same error.

Fatal error: session_register(): Failed to initialize storage module: user (path: /tmp) in [...]

I checked this forum for solutions yet neither of them worked.

 

I changed my sessions configuration as recoomended by jcall here

and the message changed to Fatal error: session_register(): Failed to initialize storage module: user (path: /tmp2) in [...]

 

 

Any ideas as to the solution of the problem ?

 

 

Looking forward to helpful posts :-)

Nala

Link to comment
Share on other sites

  • 2 weeks later...

Warning: imagejpeg(): Unable to open 'images/number_pics/_confirmpic807540.jpg' for writing in /home/admin/domains/phulbari.com/public_html/includes/human_confirmation.php on line 68

 

to solve this you have to add a php.ini file to the server and write:

 

safe_mode=0

 

:D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...