Roundcube Captcha module

Discussion in 'Plugins/Modules/Addons' started by System_Owner, Aug 18, 2014.

  1. System_Owner

    System_Owner Member

    Has anyone else run into this?

    If we are hosting multiple domains on the same mail server so that you can go to:

    www.domain1.com/webmail
    www.domain2.com/webmail
    www.domain3.com/webmail

    and they all hit the same mail webserver, how can we get the RoundCube captcha module to keep track of what url/domain it came in on and then have the ability to add a captcha pub/priv key pair for each domain in the config.inc.php file and it choose the correct pair based on the incoming domain url with an If.....else if...else if..... statement?

    Does anyone know which variable it is that holds the url of the incoming domain that is sent to verify the captcha?

    Thanks.
     
  2. System_Owner

    System_Owner Member

    Roundcube Captcha code

    I actually finally found an article about it and this is the code I needed. Working with 11 different domains perfectly.

    Thanks.



    $domainkeys = array(
    'mydomain_1.tld' => array(
    'publickey' => '...publickey_1...',
    'privatekey' => '...privatekey_1...',
    ),
    'mydomain_2.tld' => array(
    'publickey' => '...publickey_2...',
    'privatekey' => '...privatekey_2...',
    ),
    );
    $domain = explode('.', $_SERVER['HTTP_HOST']);
    if(count($domain) > 2){
    array_shift($domain);
    }
    $domain = implode('.', $domain);
    $config['recaptcha_publickey'] = $domainkeys[$domain]['publickey'];
    $config['recaptcha_privatekey'] = $domainkeys[$domain]['privatekey'];
     
  3. Kileywest

    Kileywest New Member

    As the value of the variable changes, so sometimes it becomes confusing to know that which variable is holding which value. So, what should be done for it..??
    ----------
    website
     
    Last edited: Aug 30, 2014

Share This Page