Author Topic: [MOD] Captcha Control  (Read 11676 times)

0 Members and 1 Guest are viewing this topic.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
[MOD] Captcha Control
« on: August 08, 2010, 04:27:59 PM »
 :flag-de:
Durch diese Modifikation ist es nun möglich alle wichtigen Einstellungen für das Captcha im Administrationsreich einzustellen. ReCaptcha wird ebenfalls unterstützt, muss aber installiert sein.

 :flag-en:
With this modification, it is now possible, with all the important settings for the Captcha in the administrative realm set. ReCaptcha is also supported, but must be installed.

Step 1
Open / Öffne: global.php
4images 1.7.7
Search / Suche:
// Initialize CAPTCHA configuration
$captcha_enable              1;
$captcha_enable_comments     1;
$captcha_enable_upload       1;
$captcha_enable_registration 1;
$captcha_enable_postcards    1;
$captcha_ttf                 1;
$captcha_path                ROOT_PATH.'captcha';
$captcha_chars               "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$captcha_length              5;
$captcha_wordfile            0;
$captcha_width               200;
$captcha_height              70;
$captcha_text_color          '#000000';
$captcha_text_size           25;
$captcha_text_transparency   60;
$captcha_filter_text         1;
$captcha_filter_bg           1;

4images 1.7.8
// Initialize CAPTCHA configuration
$captcha_enable              1;
$captcha_enable_comments     1;
$captcha_enable_upload       1;
$captcha_enable_registration 1;
$captcha_enable_postcards    1;
$captcha_ttf                 1;
$captcha_path                ROOT_PATH.'captcha';
$captcha_chars               "abcdefghijklmnopqrstuvwxyz1234567890";
$captcha_length              5;
$captcha_wordfile            0;
$captcha_width               200;
$captcha_height              70;
$captcha_text_color          '#000000';
$captcha_text_size           25;
$captcha_text_transparency   60;
$captcha_filter_text         1;
$captcha_filter_bg           1;

Replace with / Ersetze mit:
4images 1.7.7
/* // Initialize CAPTCHA configuration
$captcha_enable              = 1;
$captcha_enable_comments     = 1;
$captcha_enable_upload       = 1;
$captcha_enable_registration = 1;
$captcha_enable_postcards    = 1;
$captcha_ttf                 = 1;
$captcha_path                = ROOT_PATH.'captcha';
$captcha_chars               = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$captcha_length              = 5;
$captcha_wordfile            = 0;
$captcha_width               = 200;
$captcha_height              = 70;
$captcha_text_color          = '#000000';
$captcha_text_size           = 25;
$captcha_text_transparency   = 60;
$captcha_filter_text         = 1;
$captcha_filter_bg           = 1; */

4images 1.7.8
/*// Initialize CAPTCHA configuration
$captcha_enable              = 1;
$captcha_enable_comments     = 1;
$captcha_enable_upload       = 1;
$captcha_enable_registration = 1;
$captcha_enable_postcards    = 1;
$captcha_ttf                 = 1;
$captcha_path                = ROOT_PATH.'captcha';
$captcha_chars               = "abcdefghijklmnopqrstuvwxyz1234567890";
$captcha_length              = 5;
$captcha_wordfile            = 0;
$captcha_width               = 200;
$captcha_height              = 70;
$captcha_text_color          = '#000000';
$captcha_text_size           = 25;
$captcha_text_transparency   = 60;
$captcha_filter_text         = 1;
$captcha_filter_bg           = 1; */

Search / Suche:
//-----------------------------------------------------
//--- Generate Setting --------------------------------
//-----------------------------------------------------
$sql "SELECT setting_name, setting_value
        FROM "
.SETTINGS_TABLE;
$result $site_db->query($sql);
if (!
$result) {
  echo 
$lang['no_settings'];
  exit;
}
while (
$row $site_db->fetch_array($result)) {
  
$config[$row['setting_name']] = $row['setting_value'];
}
$site_db->free_result();

Add after / Füge danach ein:
// Initialize CAPTCHA configuration
$captcha_enable              $config['captcha_enable'];
$captcha_enable_comments     $config['captcha_enable_comments'];
$captcha_enable_upload       $config['captcha_enable_upload'];
$captcha_enable_registration $config['captcha_enable_registration'];
$captcha_enable_postcards    $config['captcha_enable_postcards'];
$captcha_ttf                 1;
$captcha_path                ROOT_PATH.''.$config['captcha_path'].'';
$captcha_chars               "".$config['captcha_chars']."";
$captcha_length              $config['captcha_length'];
$captcha_wordfile            $config['captcha_wordfile'];
$captcha_width               $config['captcha_width'];
$captcha_height              $config['captcha_height'];
$captcha_text_color          ''.$config['captcha_text_color'].'';
$captcha_text_size           $config['captcha_text_size'];
$captcha_text_transparency   $config['captcha_text_transparency'];
$captcha_filter_text         $config['captcha_filter_text'];
$captcha_filter_bg           $config['captcha_filter_bg'];
// Initialize CAPTCHA configuration end


Step 2
Open / Öffne: admin/settings.php
Search / Suche:
  show_form_footer($lang['save_changes'], ""2);
}

Add above / Füge darüber ein:
  show_table_separator($setting_group["captchacontrol"], 2"setting_group_captchacontrol");
  
show_setting_row("captcha_enable""radio");
  
show_setting_row("captcha_enable_comments""radio");
  
show_setting_row("captcha_enable_upload""radio");
  
show_setting_row("captcha_enable_registration""radio");
  
show_setting_row("captcha_enable_postcards""radio");
  
show_setting_row("captcha_path");
  
show_setting_row("captcha_chars");
  
show_setting_row("captcha_length");
  
show_setting_row("captcha_wordfile""radio");
  
show_setting_row("captcha_width");
  
show_setting_row("captcha_height");
  
show_setting_row("captcha_text_color");
  
show_setting_row("captcha_text_size");
  
show_setting_row("captcha_text_transparency");
  
show_setting_row("captcha_filter_text""radio");
  
show_setting_row("captcha_filter_bg""radio");
  
show_setting_row("captcha_recaptcha_onoff""radio");
  
show_setting_row("captcha_recaptcha_domain");
  
show_setting_row("captcha_recaptcha_publickey");
  
show_setting_row("captcha_recaptcha_privatkey");


Step 3
:flag-de:
Öffne: lang/deutsch/admin.php
Suche:
?>
Add above / Füge darüber ein:
/*-- Setting-Group captchacontrol --*/
$setting_group["captchacontrol"] = "Captcha Einstellungen";
$setting['captcha_enable'] = "Captcha einschalten";
$setting['captcha_enable_comments'] = "Captcha in den Kommentaren";
$setting['captcha_enable_upload'] = "Captcha im Uploadformular";
$setting['captcha_enable_registration'] = "Captcha wären der Registration";
$setting['captcha_enable_postcards'] = "Captcha beim Postkarten versenden";
$setting['captcha_path'] = "Captcha Verzeichnis<br /><span class=\"smalltext\">Ausgehend vom ROOT- Verzeichnis</span>";
$setting['captcha_chars'] = "Erlaubte Zeichen im Captcha";
$setting['captcha_length'] = "Zeichenlänge<br /><span class=\"smalltext\">Welche Länge soll der Code besitzen</span>";
$setting['captcha_wordfile'] = "Vorgefertigte Wörter verwenden<br /><span class=\"smalltext\">captcha/wordlist.tx</span>";
$setting['captcha_width'] = "Captcha Breite<br /><span class=\"smalltext\">In Pixel</span>";
$setting['captcha_height'] = "Captcha Höhe<br /><span class=\"smalltext\">In Pixel</span>";
$setting['captcha_text_color'] = "Captcha Schriiftfarbe";
$setting['captcha_text_size'] = "Captcha Schrifthöhe";
$setting['captcha_text_transparency'] = "Captcha Transparents<br /><span class=\"smalltext\">0-100</span>";
$setting['captcha_filter_text'] = "Text verschleiern<br /><span class=\"smalltext\">Erschwärt den Spambots das Captcha zu lesen</span>";
$setting['captcha_filter_bg'] = "Hintergrund verschleiern<br /><span class=\"smalltext\">Erschwärt den Spambots das Captcha zu lesen</span>";
$setting['captcha_recaptcha_onoff'] = "ReCaptcha- Unterstützung<br /><span class=\"smalltext\">Registration: <a href=\"http://recaptcha.net\" target=\"_blank\">http://recaptcha.net</a></span>";
$setting['captcha_recaptcha_domain'] = "ReCaptcha Domain<br /><span class=\"smalltext\">Trage hier die Domain ein, auf der ReCaptcha registriert wurde</span>";
$setting['captcha_recaptcha_publickey'] = "ReCaptcha Public-Key<br /><span class=\"smalltext\">Trage hier den Public-Key der registrierten Domain ein</span>";
$setting['captcha_recaptcha_privatkey'] = "ReCaptcha Privat-Key<br /><span class=\"smalltext\">Trage hier den Privat-Key der registrierten Domain ein</span>";


 :flag-en:
Open: lang/english/admin.php
Search:
?>
Add above / Füge darüber ein:
/*-- Setting-Group XX --*/
$setting_group[XX] = "Captcha Settings";
$setting['captcha_enable'] = "Captcha enabled";
$setting['captcha_enable_comments'] = "Enables the CAPTCHA system for the comments";
$setting['captcha_enable_upload'] = "Enables the CAPTCHA system for the upload";
$setting['captcha_enable_registration'] = "Enables the CAPTCHA system for the registration form";
$setting['captcha_enable_postcards'] = "Enables the CAPTCHA system for the e-cards";
$setting['captcha_path'] = "Path to the folder which contains the CAPTCHA files<br /><span class=\"smalltext\">Starting from the root directory</span>";
$setting['captcha_chars'] = "A list of letters which will be used for the randomly generated CAPTCHA strings";
$setting['captcha_length'] = "Number of letters of the CAPTCHA strings";
$setting['captcha_wordfile'] = "If this option is set to 1, a word from \"captcha/wordlist.txt\" is used.";
$setting['captcha_width'] = "Width of the CAPTCHA image in pixel.";
$setting['captcha_height'] = "Height of the CAPTCHA image in pixel.";
$setting['captcha_text_color'] = "Color (Hex) of the CAPTCHA text.";
$setting['captcha_text_size'] = "Size of the CAPTCHA text.";
$setting['captcha_text_transparency'] = "Transparency of the CAPTCHA text.<br /><span class=\"smalltext\">0-100</span>";
$setting['captcha_filter_text'] = "The CAPTCHA text willbe filtered (\"obscured\").";
$setting['captcha_filter_bg'] = "The CAPTCHA background image will be filtered (\"obscured\").";
$setting['captcha_recaptcha_onoff'] = "ReCaptcha support<br /><span class=\"smalltext\">Registration: <a href=\"http://recaptcha.net\" target=\"_blank\">http://recaptcha.net</a></span>";
$setting['captcha_recaptcha_domain'] = "ReCaptcha Domain<br /><span class=\"smalltext\">Insert here the domain that was registered on the ReCaptcha</span>";
$setting['captcha_recaptcha_publickey'] = "ReCaptcha Public-Key<br /><span class=\"smalltext\">Insert here the public key of a registered domain</span>";
$setting['captcha_recaptcha_privatkey'] = "ReCaptcha Private-Key<br /><span class=\"smalltext\">Insert here the private key of a registered domain</span>";

Please replace the "XX" with the correckt Group.

ReCaptcha Support

Installation
Redo Step 2 from this thread / Mache Step 2 aus diesem Thread rückgängig: http://www.4homepages.de/forum/index.php?topic=27551.0
Step 2 must be installed for this modification so / Schritt 2 muss für diese Modifikation so installiert werden
Open / Öffne: global.php
Search / Suche:
$captcha_filter_bg           $config['captcha_filter_bg'];
// Initialize CAPTCHA configuration end

Add after / Füge danach ein:
$captcha_recaptcha           $config['captcha_recaptcha_onoff']; //0 = disable; 1 = enable with auto domain select; "yourdomain" = for one specific domain only, this domain must be specified in $recaptcha_domains below
//$captcha_recaptcha           = "yourdomain2"; //use only reCAPTCHA keys for yourdomain2

$recaptcha_domains[''.$config['captcha_recaptcha_domain'].''] = array("".$config['captcha_recaptcha_publickey']."""".$config['captcha_recaptcha_privatkey']."");
/*//to add more then one domain:
$recaptcha_domains['example.com']   = array("public key for example.com", "private key for example.com");
$recaptcha_domains['4homepages.de'] = array("asdfasdfasdf", "a98sd7as9df7as");
$recaptcha_domains['google.com']    = array("23kj423h42k", "8fas9d8a9sdf9a");
*/
if ($captcha_enable && $captcha_recaptcha
    
&& (isset($recaptcha_domains[$captcha_recaptcha])
          || isset(
$recaptcha_domains[strtolower($_SERVER["HTTP_HOST"])])))
{
  
$captcha_recaptcha = (isset($recaptcha_domains[$captcha_recaptcha]))
                          ? 
$recaptcha_domains[$captcha_recaptcha]
                          : 
$recaptcha_domains[strtolower($_SERVER["HTTP_HOST"])];
}
else
{
  
$captcha_recaptcha 0;
}


Finish / Fertig
Upload the attachment and copy the install.php (install_177.php for 4images 1.7.7 / install_178.php for 4images 1.7.8) in your root directory. Then run the installation: http://yoursite.com/install.php
Lade  den Anhang herunter und kopiere die install.php (install_177.php für 4images 1.7.7 / install_178.php für 4images 1.7.8) in deinem Root- Verzeichnis. Führe dann die Installation aus: http://deineseite.de/install.php
« Last Edit: August 22, 2010, 01:36:37 PM by Sumale.nin »

Offline dgu

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [MOD] Captcha Control
« Reply #1 on: August 22, 2010, 12:21:57 PM »
Hallo,

Danke dafür, werde ich nacher Probieren. Nun aber noch eine Frage dazu. "Bitte ersetze die "XX" mit der richtigen Gruppenzahl" wo finde ich diese Gruppenzahl? Steht die da in dieser Datei drinn oder wo bekomme ich diese her?

MFG

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Captcha Control
« Reply #2 on: August 22, 2010, 12:59:03 PM »
@Sumale.nin (and anyone else creating mods that require changes in admin/settings.php):

You don't have to use XX number in newly added settings. Instead of a number, use an unique for your mod word.
Example:
  show_table_separator($setting_group["captchacontrol"], 2"setting_group_captchacontrol");

and:
/*-- Setting-Group captchacontrol --*/
$setting_group["captchacontrol"] = "Captcha Settings";


In this example I've replaced XX number with a "captchacontrol" word (note, you have to enclose it in quotes!)

This way the installation process doesn't require "count" or look what was the last XX number, less confusion.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Captcha Control
« Reply #3 on: August 22, 2010, 01:38:06 PM »
Thank you Vano: Post #1 Updated

Hallo,

Danke dafür, werde ich nacher Probieren. Nun aber noch eine Frage dazu. "Bitte ersetze die "XX" mit der richtigen Gruppenzahl" wo finde ich diese Gruppenzahl? Steht die da in dieser Datei drinn oder wo bekomme ich diese her?

MFG

Schau dir bitte nochmal Step 2 und Step 3 an.
Ich habe den Code geändert. Nu musst du nichts mehr editieren etc.

Rembrandt

  • Guest
Re: [MOD] Captcha Control
« Reply #4 on: August 22, 2010, 02:08:42 PM »
@sumale, warum hast du zwei installer?
ich habe sie mir nicht angesehn, aber die 4images versionen können doch nicht der grund dafür sein?

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Captcha Control
« Reply #5 on: August 22, 2010, 02:32:43 PM »
Doch weil sich die Zeichen geändert haben "$captcha_chars"
Da ich Voreintragungen mache und sich das ja an dem Standard der Versionen halten soll habe ich auch zwei Installer zurückgegriffen, wie soll ich das sonst machen?

Rembrandt

  • Guest
Re: [MOD] Captcha Control
« Reply #6 on: August 22, 2010, 03:15:04 PM »
die unterscheidung z.w. groß und kleinbuchstaben haben in der 1.7.7 version eh nicht funktioniert, ausser mit einer modifikation in der capcha
ich hätte an deiner stelle beim installer kleinbuchstaben, zahlen und ein par sonderzeichen reingesetzt.

mfg Andi

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Captcha Control
« Reply #7 on: August 22, 2010, 04:16:28 PM »
Achso, da habe ich nie drauf geachtet. Naja egal!
Ist ja nicht die Welt jetzt :D

b.o.fan

  • Guest
Re: [MOD] Captcha Control
« Reply #8 on: October 11, 2010, 09:02:21 PM »
hallo

habe ReCaptcha eingebaut. Nur Zeigt er mir nur die "alten" Captcha's an, wieso?

wie baue ich {recaptcha} ein?

z.B. in register_form.html?

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Captcha Control
« Reply #9 on: October 12, 2010, 08:41:28 PM »
Das hat mit dieser Modifikation nichts zu tun, dass solltest du schon in dem richtigen Thread erfragen:
http://www.4homepages.de/forum/index.php?topic=27551.0

LG