Custom Registration Token - 0.5.0 - Beta

Eklentiler ile ilgili gelişmeler. Yeni modlar, güncellemeler.

Custom Registration Token - 0.5.0 - Beta

İleti sabri ünal 13.12.2006, 15:05

not: mod henüz tarafımca test edilmemiştir.

mod adı: Custom Registration Token
mod işlevi: forumlarınıza spam kayıt yapmalarını önlemek için kayıt anlaşması sayfasınındaki agreed olarak geçen kontrol değeri üstünde kimi değişiklikler yapar...

öncelikli olarak spam motorları agreed=true değerini çok basit bir şekilde geçebilmektedir... bunun yerine pentapengiin tarafından unique registiration hash modu geliştirilmiştir.. bu mod da aynı modun daha da geliştirilmiş bir türevidir... bu yeni modda phpBB de agreed=true olarak geçen ikili değeri tamamen yönetim panelinden kontrol edilebilir hale getirmektedir... böylece spamlara ve spammerlere karşı daha değişken bir yapı kurmak elde olabilmektedir...

bunun için yönetim panelinde kimi eklemeler yapılmaktadır... yapılan eklemelerle agreed=true -> true değerinin yerini alacak değerin ne kadar uzunluğunda olabileceği de yönetim panelinden ayarlanabilmektedir...

detaylı bilgi için yazar notlarını okuyabilirsiniz...


Kod: Tümünü seç
##############################################################
## MOD Title: Custom Registration Token
## MOD Author: drathbun < N/A > (Dave Rathbun) http://www.phpBBDoctor.com
## MOD Description: Change token from "agreed=true" to a session unique variable instead
## MOD Version: 0.5.0
##
##
## Installation Level: Easy
## Installation Time: ~ 5 Minutes
## Files To Edit: (4)   admin/admin_board.php
## includes/usercp_register.php
## language/lang_english/lang_admin.php
## templates/subSilver/admin/board_config_body.tpl
## Included Files: (3)   root/register.php
## root/lang_register.php
## root/registration_agree.tpl
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## Author Notes:
## This MOD was inspired by a simple idea: change the "agreed=true" present on the
## registration URL to something that would be unique and customizable by each
## board admin. There is an admin control panel interface (via the board
## configuration page) to change the token name from "agreed" to something
## different.
##
## We also borrowed an idea from another MOD (by pentapenguin) that changed the
## simple "true" value to a unique hash. There is an additional option that lets a
## board administrator adjust the length of the registration token (we suggest
## using a value of 16 or less; the min is 2 and the max is 32.) The net result is
## that no two registrations will have the same URL, making it much more difficult
## for "reg bots" to join your forum.
##
##
## Note that this MOD will not do anything to impair human registrations, and there
## are certainly documented cases of human spammers as well as registration bots.
## This MOD is only designed to make your registration form different from everyone
## else's, it does not do anything to keep humans from registering.
##
## This MOD is in BETA status as of version 0.5.0.
##############################################################
## MOD History:
##
##   2006-10-28 - Version 0.5.0
##      Initial public release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]-------------------------------------
# Special Instructions: Be sure to replace phpbb_ with the
# proper table prefix for your installation
#
insert into phpbb_config (config_name, config_value) values ('phpbbdoctor_registration_token', 'change_me');
insert into phpbb_config (config_name, config_value) values ('phpbbdoctor_registration_token_len', '12');


#
#-----[ OPEN ]-------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]-------------------------------------
# On or about line 242; find text might not be a complete line
#
   "SERVER_NAME" => $new['server_name'],

#
#-----[ BEFORE, ADD ]-------------------------------------
#
   // BEGIN Custom Registration Token 0.5.0 (www.phpBBDoctor.com)
   'L_REGISTRATION_TOKEN' => $lang['Registration_token'],
   'L_REGISTRATION_TOKEN_EXPLAIN' => $lang['Registration_token_explain'],
   'REGISTRATION_TOKEN' => $new['phpbbdoctor_registration_token'],
   'L_REGISTRATION_TOKEN_LEN' => $lang['Registration_token'],
   'L_REGISTRATION_TOKEN_LEN_EXPLAIN' => $lang['Registration_token_len_explain'],
   'REGISTRATION_TOKEN_LEN' => $new['phpbbdoctor_registration_token_len'],
   // END Custom Registration Token 0.5.0 (www.phpBBDoctor.com)

#
#-----[ OPEN ]-------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]-------------------------------------
# On or about line 44; find text might not be a complete line
#
$unhtml_specialchars_replace

#
#-----[ AFTER, ADD ]-------------------------------------
#
// BEGIN Custom Registration Token 0.5.0 (www.phpBBDoctor.com)
// Simple translation of spaces to _ to avoid what we expect
// to be a common issue with the token names
$token_config_value = str_replace(' ', '_', $board_config['phpbbdoctor_registration_token']);

// The token name will be passed as a GET parameter, so
// let's encode it to make it pass correctly.
$token_name = rawurlencode($token_config_value);

// Make sure the token length is integer, and that it
// fits within certain boundaries (must be between 2 and 32, default = 12)
$token_len = intval($board_config['phpbbdoctor_registration_token_len']);
if ( $token_len <= 1 || $token_len > 32)
{
        $token_len = 12;
}

// Token value is based on an md5 hash of the token name in
// combination with the session id. Since the session id is carried
// throughout the process and the token name is stored in the database
// we are ensured that we can recreate the token value as the
// session moves from page to page.
$token_value = substr(md5($token_name . $userdata['session_id']), 0, $token_len);
// END Custom Registration Token 0.5.0 (www.phpBBDoctor.com)


#
#-----[ FIND ]-------------------------------------
# On or about line 52; find text might not be a complete line
#
global $userdata

#
#-----[ AFTER, ADD ]-------------------------------------
#
   // BEGIN Custom Registration Token 0.5.0 (www.phpBBDoctor.com)
   global $token_value, $token_name;
   // END Custom Registration Token 0.5.0 (www.phpBBDoctor.com)


#
#-----[ FIND ]-------------------------------------
# On or about line 65; find text might not be a complete line
#
agreed=true

#
#-----[ IN-LINE FIND ]-------------------------------------
#
agreed=true

#
#-----[ IN-LINE REPLACE WITH ]-------------------------------------
#
$token_name=$token_value

#
#-----[ FIND ]-------------------------------------
# On or about line 66; find text might not be a complete line
#
agreed=true

#
#-----[ IN-LINE FIND ]-------------------------------------
#
agreed=true

#
#-----[ IN-LINE REPLACE WITH ]-------------------------------------
#
$token_name=$token_value

#
#-----[ FIND ]-------------------------------------
# On or about line 79; find text might not be a complete line
#
!isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed'])

#
#-----[ IN-LINE FIND ]-------------------------------------
#
!isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed'])

#
#-----[ IN-LINE REPLACE WITH ]-------------------------------------
#
!isset($HTTP_POST_VARS[$token_config_value]) && !isset($HTTP_GET_VARS[$token_config_value])

#
#-----[ FIND ]-------------------------------------
# On or about line 274; find text might not be a complete line
#
if ($board_config['enable_confirm']

#
#-----[ BEFORE, ADD ]-------------------------------------
#
   // BEGIN Custom Registration Token 0.5.0 (www.phpBBDoctor.com)
   if ( $mode == 'register' && $HTTP_POST_VARS[$token_name] != $token_value )
   {
      message_die (GENERAL_ERROR, $lang['Invalid_registration_token']);
   }
   // END Custom Registration Token 0.5.0 (www.phpBBDoctor.com)


#
#-----[ FIND ]-------------------------------------
# On or about line 895; find text might not be a complete line
#
name="agreed" value="true"

#
#-----[ IN-LINE FIND ]-------------------------------------
#
name="agreed" value="true"

#
#-----[ IN-LINE REPLACE WITH ]-------------------------------------
#
name="' . $token_name . '" value="' . $token_value . '"


#
#-----[ OPEN ]-------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]-------------------------------------
# On or about line 762 to 763; find text might not be a complete line
#
//
// That's all Folks!

#
#-----[ BEFORE, ADD ]-------------------------------------
#
// BEGIN Custom Registration Token 0.5.0 (www.phpBBDoctor.com)
$lang['Registration_token'] = 'Registration Token';
$lang['Registration_token_explain'] = 'Enter a unique registration token, this will replace the word "agree" on your registration URL. This should not have any impact on human registrations but bots that rely on the standard "agree=true" URL format will fail.';
$lang['Registration_token_len'] = 'Registration Token Length';
$lang['Registration_token_len_explain'] = 'How many characters should your registration token be? Suggested value is 16 or less. Must be between 2 and 32, will default to 12 if outside of that range.';
// END Custom Registration Token 0.5.0 (www.phpBBDoctor.com)

// TERCÜMESİ
$lang['Registration_token'] = 'Kayıt Değişkeni';
$lang['Registration_token_explain'] = 'Yeni bir kayıt değişkeni ekleyiniz, bu değişken kayıt anlaşmasındaki "agree" değerinin yerine kullanılacaktır. Bu değişikliğin kayıt olmak isteyen üyeler açısından bir problemi bulunmamaktadır; fakat kayıt botları standart olan "agree=true" değişkeni üstünden spam kayıtlar yapmaya çalışmaktadır, bu şekilde spam kayıt yapmaları önlenmiş olacaktır.';
$lang['Registration_token_len'] = 'Kayıt değişkeni uszunluğu';
$lang['Registration_token_len_explain'] = 'Kayıt değişkeni kaç karakter uzunluğunda olmalıdır? 16 veya daha fazla karakter uzunluğunda olmasını tavsiye ederiz. 2 veya 32 karakter arasında bir uzunluk seçebilirsiniz. Varsayılan olarak 12 kakakter uzunluğu kullanılmaktadır.';
#
#-----[ OPEN ]-------------------------------------
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]-------------------------------------
# On or about line 40 to 41; find text might not be a complete line
#
{CONFIRM_DISABLE} />{L_NO}</td>
   </tr>

#
#-----[ AFTER, ADD ]-------------------------------------
#
   <!-- added by Custom Registration Token 0.5.0 (www.phpBBDoctor.com) -->
   <tr>
      <td class="row1">{L_REGISTRATION_TOKEN}<br /><span class="gensmall">{L_REGISTRATION_TOKEN_EXPLAIN}</span></td>
      <td class="row2"><input type="text" size="20" name="phpbbdoctor_registration_token" value="{REGISTRATION_TOKEN}" /></td>
   </tr>
   <tr>
      <td class="row1">{L_REGISTRATION_TOKEN_LEN}<br /><span class="gensmall">{L_REGISTRATION_TOKEN_LEN_EXPLAIN}</span></td>
      <td class="row2"><input type="text" size="20" name="phpbbdoctor_registration_token_len" value="{REGISTRATION_TOKEN_LEN}" /></td>
   </tr>
   <!-- end added by Custom Registration Token 0.5.0 (www.phpBBDoctor.com) -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
En son sabri ünal tarafından, 13.12.2006, 15:52 tarihinde değiştirildi, toplamda 2 değişiklik yapıldı.
Kullanıcı avatarı
sabri ünal
Üye
Üye
 
İleti: 1325
Kayıt: 27.10.2005, 15:49
Konum: İstanbul

İleti CrazYAngeR 13.12.2006, 15:12

üstat net olarak ne değişiklik yaptığını anlatabilrimisin.
Kullanıcı avatarı
CrazYAngeR
Üye
Üye
 
İleti: 262
Kayıt: 13.06.2006, 00:34
Konum: İstanbul

İleti sabri ünal 13.12.2006, 15:50

notlar ve açıklamalar eklendi, modun dil değerleri tercüme edildi...
Kullanıcı avatarı
sabri ünal
Üye
Üye
 
İleti: 1325
Kayıt: 27.10.2005, 15:49
Konum: İstanbul


Duyurular & Güncellemeler



Kimler çevrimiçi

Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 0 misafir

cron