Fork me on GitHub

#1 2015-10-25 23:41:12

lavvaf
Member
Registered: 2015-10-09
Posts: 29

Cpatcha for eyeLogin

Dear All,

I need to add Captcha in user login and registration. May i ask you help me to do it?

Thanks

Offline

#2 2015-10-26 15:40:58

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 730
Website

Re: Cpatcha for eyeLogin

I refer to http://forums.oneye-project.org/viewtop … 2594#p2594 . Use that first file to show the captcha and that events.eyecode to check for a valid input.


Best regards,
Lars Knickrehm

The oneye project.

Offline

#3 2015-10-28 20:50:35

lavvaf
Member
Registered: 2015-10-09
Posts: 29

Re: Cpatcha for eyeLogin

Dear Lars, First thanks for your answer, but i generate a random code and create a png in php. this is my sample code:

<?php
session_start();
$code=rand(1000,9999);
$_SESSION["code"]=$code;
$im = imagecreatetruecolor(50, 24);
$bg = imagecolorallocate($im, 22, 86, 165); //background color blue
$fg = imagecolorallocate($im, 255, 255, 255);//text color white
imagefill($im, 0, 0, $bg);
imagestring($im, 5, 5, 5,  $code, $fg);
header("Cache-Control: no-cache, must-revalidate");
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>

I don't know how to use captcha image in login page!?
Please help me...

Offline

#4 2015-10-28 22:32:51

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 730
Website

Re: Cpatcha for eyeLogin

1. Generate that code when creating the login window. Save it in the server-side session variables.
2. Show that captcha using an oneye event: Use the url "'index.php?checknum=' . $checknum . '&msg=EVENT_NAME&' . time()" and define that EVENT_NAME event in the events.eyecode. Take the "getWallpaper" event of eyeDesk as an example.
3. Validate the user input when logging in / registering.


Best regards,
Lars Knickrehm

The oneye project.

Offline

Board footer

Powered by FluxBB