1 sayfadan 1. sayfa

Remote Avatar Check [1.0.2]

İletiTarih: 13.05.2006, 03:51
ALEXIS
ben bu günkü olaydan sonra çalıştım ve uzak avatar kontrolünü değştirdim, yeni fonksiyon php ile yapılan basit şifrelemeleri (AUTH) de engelliyor

Resim

Kod: Tümünü seç
##############################################################
## MOD Title: Remote Avatar Check
## MOD Author: darklordsatan < N/A > (N/A) N/A
## MOD Description: This mod basically performs three checks over a remote avatar.
##                  1. Checks if the image exists
##                  2. Checks if the image filesize isn't bigger than the one configured at the ACP.
##                  3. Checks if the image dimensions aren't bigger than the ones configured at the ACP.
##                  Aditionally, it returns an error message in case of failure for any of the aforementioned
##                  scenarios.
## MOD Version: 1.0.2
##
## Installation Level: (Easy)
## Installation Time: 2 Minutes
## Files To Edit: includes/usercp_avatar.php
##                language/lang_english/lang_main.php
## Included Files: N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: The mod is designed with a fresh phpBB installation in mind.
##               If you already have your board running, likely you'll find this mod useless. The reason
##               is simple: It doesnt try to check already configured avatars, but new ones to be set by
##               the members in their profile panel.
##               However, if you still want to use this mod, I'd recommend to make a global announcement
##               informing your users, their avatars will be removed to ensure compliance with the rules
##               (this is a potential reason to upset members who already comply with them), then
##               proceed to manually remove all the avatars, by means of a simple SQL query
##               UPDATE `phpbb_users` SET user_avatar = '' WHERE 1;
##
##############################################################
## MOD History:
##
##   2005-10-14 - Version 1.0.0
##      - Release of the first version
##
##   2005-10-22 - Version 1.0.1
##      - Minor code fixes/additions in order to resubmit the mod at the phpBB MOD database
##
##   2006-02-17 - Version 1.0.2
##      - The mod is compliant with the latest phpBB release (2.0.19)
##      - Fixed a nasty bug where a huge remote image could potentially arise a script execution timeout error
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

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

#
#-----[ FIND ]------------------------------------------
#
return ( $mode == 'editprofile' ) ? ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_REMOTE : '';

#
#-----[ BEFORE, ADD ]------------------------------------------
#
   // Start Remote Avatar Check Mod
   global $board_config;
   
   $remote_file = @fopen ($avatar_filename, "rb");
   
   if(!$remote_file)
   {
      $error = true;
      $error_msg = sprintf($lang['Remote_avatar_no_image'], $avatar_filename);
      return;
   }
   
   $user_avatar_size = 0;
   do
   {
      if (strlen(@fread($remote_file, 1)) == 0 || $user_avatar_size > $board_config['avatar_filesize'])
      {
         break;
      }
      $user_avatar_size ++;
   }
   while(true);
   @fclose($remote_file);
 
   if($user_avatar_size > $board_config['avatar_filesize'])
   {
      $error = true;
      $error_msg = sprintf($lang['Remote_avatar_error_filesize'], $board_config['avatar_filesize']);
      return;
   }
 
   list($user_avatar_width, $user_avatar_height) = @getimagesize($avatar_filename);
   
   if($user_avatar_width > $board_config['avatar_max_width'] || $user_avatar_height > $board_config['avatar_max_height'])
   {
      $error = true;
      $error_msg = sprintf($lang['Remote_avatar_error_dimension'], $board_config['avatar_max_width'], $board_config['avatar_max_height']);
      return;
   }
   // End Remote Avatar Check Mod

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

#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Remote Avatar Check
$lang['Remote_avatar_no_image']        = ' %s imajı mevcut değil';
$lang['Remote_avatar_error_filesize']  = 'Sembol dosyası %d Byte\'tan az olmalıdır';
$lang['Remote_avatar_error_dimension'] = 'Sembolün genişliği %d pikselden, yüksekliği %d pikselden küçük olmalıdır';


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

İletiTarih: 05.06.2006, 19:42
sabri ünal
başlık diğer mesajlar arasında kaynamıştı... modu ayrı bir başlık olarak çıkardım...

İletiTarih: 06.06.2006, 00:45
ALEXIS
canver modları bölümündeydi:

İlk önce güvenlik bölümüne taşıdım, sonra güvenlikte gölge bırakarak mod duyurularına taşıdım. Güvenlikte 1 adet gölge oluşturmuş oldum.

İletiTarih: 06.06.2006, 01:48
murtaza
tam olarak avatar boyutunumu seyapiyo bu?
napiyo?

kücültüyomu ?

Sevgiyle

İletiTarih: 06.06.2006, 01:59
showtime_0
yönetim panelinden ayarladığın boyut ve ebatları aşarsa ya da dosyayı erişilemiyorsa uyarı veriyor

Cvp: Remote Avatar Check [1.0.2]

İletiTarih: 06.06.2006, 17:59
tankaya61
ALEXIS , pek bişi anlamadım :$
lınkı verılen avatar bır sekılde gosterılemıyorsa hatamı verıyo :)

İletiTarih: 06.06.2006, 19:23
purple
1. Checks if the image exists
2. Checks if the image filesize isn't bigger than the one configured at the ACP.
3. Checks if the image dimensions aren't bigger than the ones configured at the ACP.
Aditionally, it returns an error message in case of failure for any of the aforementioned


Forumunuzda dışarıdan avatar ekleme açık ise şunları yapıyor;
1. Resim var mı yok mu önce kontrol ediyor.
2. Resim dosyasının büyüklüğünün (kb. cinsinden) ACP'de ayarlandığından daha büyük olup olmadığını kontrol ediyor.
3. Resim dosyasının çözünürlüğünün (yükseklik ve genişlik) ACP'de ayarlandığından daha büyük olup olmadığını kontrol ediyor.
Ek olarak, bütün bu kontrollerden sonra aykırı bir durum söz konusu ise kullanıcıya bir hata mesajı ile geri dönüyor.

Saygılar...

Cvp: Remote Avatar Check [1.0.2]

İletiTarih: 21.06.2006, 14:46
LaserJet
şahane birşey çok işimi gördü emeği geçen herkese teşekkür ederim.

Cvp: Remote Avatar Check [1.0.2]

İletiTarih: 21.06.2006, 23:35
yaso19
Ben teorik olarak uzaktan avatar kullanımını tehlikeli görüyorum. Benim düşünceme göre iyi bi hacker kesinlikle bu konu üzerinde bi açık bulabilir.. Bu yüzden sitemde uzaktan avatar kullanımını pasif bıraktım.. Ama yine de bu modda az da olsa güvenliğe işe yarar tabi :)

Cvp: Remote Avatar Check [1.0.2]

İletiTarih: 22.06.2006, 19:37
tankaya61
paylasımın ıcın tesekkurler
bu bende kuruluymus ( benım haberım yok )
sanırım normalde kurulu olan bır mod :?