Roundcube Community Forum

Release Support => Release Discussion => Topic started by: Gautham Vignesh on December 21, 2010, 01:13:30 AM

Title: captcha integration
Post by: Gautham Vignesh on December 21, 2010, 01:13:30 AM
Hi all,
    why the captcha are available in a separate page instead of appearing in login page , have i need to perform any customization to  make it see them in login page ..?
Title: captcha integration
Post by: rosali on December 21, 2010, 06:27:49 AM
captcha config:


/* Captcha challenge to enter authenticated state */
$rcmail_config['captcha_auth'] = TRUE;


./skins/default/templates/login.html





captcha.php


class captcha extends rcube_plugin {

  public $task = "login|mail|logout";


It is not designed for this purpose. But these few hacks seem to do the job.
Title: captcha integration
Post by: Gautham Vignesh on December 21, 2010, 07:34:12 AM
Hi Rosali,
          Thanks Rosali.. its integrated now..but after we logout it doesn't appear .. after clicking the login button only it does appears .. and some faults are happening like suddenly shows 0 mails in inbox - when we double click on inbox , it shows the mails.
Title: captcha integration
Post by: rosali on December 21, 2010, 07:37:10 AM
Did you do the following step? -> see '|logout'


class captcha extends rcube_plugin {

  public $task = "login|mail|logout";
Title: captcha integration
Post by: Gautham Vignesh on December 21, 2010, 08:09:42 AM
Hi Rosali ,
               yeah i done those you have mentioned first.. still thats the problem
Title: captcha integration
Post by: rosali on December 21, 2010, 08:47:01 AM
Does it help to comment the login_after hook?


  function init()
  {
    $this->add_texts('localization/');  
    if(file_exists("./plugins/captcha/config/config.inc.php"))
      $this->load_config('config/config.inc.php');
    else
      $this->load_config('config/config.inc.php.dist');
    $this->add_hook('template_object_captcha', array($this, 'show_captcha'));
    //$this->add_hook('login_after', array($this, 'check_captcha'));
    $this->add_hook('render_page', array($this, 'check_captcha'));

  }
Title: captcha integration
Post by: Gautham Vignesh on December 21, 2010, 09:50:41 AM
Nopes .. haven't any changes happen :(
Title: captcha integration
Post by: rosali on December 21, 2010, 10:28:41 AM
I use Roundcube v0.5-RC.

Attached version works for me. Remove modification in login.html template.

EDIT: Attachment removed
Title: captcha integration
Post by: Gautham Vignesh on December 21, 2010, 10:48:26 AM
I made a redirection of page .. in index.php
 

 // end session
else if ($RCMAIL->task == 'logout' && isset($_SESSION['user_id'])) {
  $userdata = array('user' => $_SESSION['username'], 'host' => $_SESSION['imap_host'], 'lang' => $RCMAIL->user->language);
  $OUTPUT->show_message('loggedout');
  $RCMAIL->logout_actions();
----> header('location:http://localhost/roundcubemail');  //redirects from ?_task=logout
  $RCMAIL->kill_session();
  $RCMAIL->plugins->exec_hook('logout_after', $userdata);
}
Title: captcha integration
Post by: rosali on December 21, 2010, 11:09:19 AM
That's a dirty hack. At least place it after kill_session and logout_after hook.
Title: captcha integration
Post by: Gautham Vignesh on December 21, 2010, 11:14:16 AM
sure yeah ..

I do have some internal errors .. of inbox - shows up no mails in your mailbox .. and when i click on inbox , it displays the mails .. this happens only 1/10 of login .

can you tell me in which file have i need to change it or why is that happens..??
Title: captcha integration
Post by: Gautham Vignesh on December 21, 2010, 11:51:51 PM
Issues to disappearance of captcha :

1. when the user -> correct and pass -> wrong , with captcha -> correct

2. Once the captcha verification is wrong due to abv problem.. i need to clear the history
    to make it appear
Title: captcha integration
Post by: Gautham Vignesh on December 21, 2010, 11:52:30 PM
Issues to disappearance of captcha :

1. when the user -> correct and pass -> wrong , with captcha -> correct

2. Once the captcha verification is wrong due to abv problem.. i need to clear the history
    to make it appear

Rosali can you just find me a way to overcome it ya :)
Title: captcha integration
Post by: rosali on December 22, 2010, 12:59:59 AM
Why do you want to re-captcha if it was already solved correct?
Title: captcha integration
Post by: Gautham Vignesh on December 22, 2010, 01:08:33 AM
i agree your statement Rosali..
this works cool now.. how possible is that i can customize the mailbox .. and under which file i wana to make modifications to do it .. ??
Title: captcha integration
Post by: Gautham Vignesh on December 22, 2010, 10:04:31 AM
According to re-captcha it might be correct ya.. but even when your trying to login with :

 user --> correct or wrong and pass --> wrong  with captcha correct .. the next page appears with only login form without captcha .. in such a case a BRUTE FORCE or a SQL INJECTION attacks can be possible i hope ...

So what you think about this Rosali ..? or am i wrong in my approach ??
Title: captcha integration
Post by: Gautham Vignesh on December 22, 2010, 10:07:55 AM
I think for this the captcha stores some cookies ... so when we make suitable cookies to be deleted .. the captcha will occur ...

So to make changes in cookies what file i have to keep the hand ..??
Title: captcha integration
Post by: Gautham Vignesh on December 22, 2010, 06:32:50 PM
Hi Rosali,
           I think you had developed the captcha plugin for roundcube .. am having a doubt in your configuration ..

you are creating a cookie named as 'captcha_solved' from the file captcha.php..this makes the disapperance of captcha whenever the password condition fails ..

according to this screenshot , when i delete only the 'captcha_solved' manually using the browser..i suppose to get captcha and of course am getting it ..

would just post me something to delete this captcha and where i have to do that ..??
waiting for your reply :)
Title: captcha integration
Post by: rosali on December 23, 2010, 01:05:34 AM
test new beta.
Title: captcha integration
Post by: Gautham Vignesh on January 22, 2011, 05:58:19 AM
Quote from: rosali;31953
Why do you want to re-captcha if it was already solved correct?


it may be correct , anyhow i need to appear it again . So can you just help me out .

i had the same problem with this new beta also ...