Fork me on GitHub

Rapport de message :*
 

Extgallery 1.8 de Zoulou et securityimage de Dugris

Titre du sujet : Extgallery 1.8 de Zoulou et securityimage de Dugris
par eparcyl92 sur 10/06/2010 19:45:32

Pour une autre méthode de protection, notamment pour les envoi par "send e-cards", suivez ce lien.
Sinon, avec le module Securityimage de Dugris, c'est comme cela.

ATTENTION!! N'OUBLIEZ PAS D'ENLEVER LES ESPACES DU MOT:
j a v a s c r i p t


Dans le fichier public-upload.php

$permHandler ExtgalleryPublicPermHandler::getHandler();
if(
count($permHandler->getAuthorizedPublicCat($xoopsUser'public_upload')) < 1) {
    
redirect_header("index.php"3_MD_EXTGALLERY_NOPERM);
    exit;
}
switch(
$step) {
    case 
'enreg':
// Hack SecurityImage de Dugris
    
include_once(XOOPS_ROOT_PATH "/class/xoopsformloader.php");
    if ( 
defined('SECURITYIMAGE_INCLUDED') && !SecurityImage::CheckSecurityImage() ) {
    
redirect_header'j a v a s c r i p t:history.go(-1)'2_SECURITYIMAGE_ERROR ) ;
    exit();
    }
// Hack SecurityImage de Dugris 
        
$photoHandler xoops_getmodulehandler('publicphoto''extgallery');
        
$result $photoHandler->postPhotoTraitement('photo_file'false);
        if(
$result == 2) {

Et enfin, ceci
$plugin xoops_getmodulehandler('plugin''extgallery');
        
$plugin->triggerEvent('photoForm'$form);
        
$form->addElement(new XoopsFormHidden("step"'enreg'));
// Hack SecurityImage de Dugris
        
if (defined('SECURITYIMAGE_INCLUDED')) {
        
$security_image = new SecurityImage_SECURITYIMAGE_GETCODE );
        if (
$security_image->render()) {
        
$form->addElement($security_imagetrue);
        }
    }
// Hack SecurityImage de Dugris
        
$form->addElement(new XoopsFormButton("""submit"_SUBMIT"submit"));
        
$form->display();
        include(
XOOPS_ROOT_PATH."/footer.php");
        break;


===================================
Pour le send e-cards, vous pouvez faire ceci:

Ouvrez le fichier public-sendecard.php

REMPLACER EXACTEMENT CECI
include_once XOOPS_ROOT_PATH.'/modules/extgallery/class/php-captcha.inc.php';
        
        
// Enable captcha only if GD is Used
        
if($xoopsModuleConfig['graphic_lib'] == 'GD') {
            if (!
PhpCaptcha::Validate($_POST['captcha'])) {
                
redirect_header("public-photo.php?photoId=".$photoId."#photoNav"3_MD_EXTGALLERY_CAPTCHA_ERROR);
                exit;
            }
        }


PAR CELA:
// Hack SecurityImage de Dugris
    
include_once(XOOPS_ROOT_PATH "/class/xoopsformloader.php");
    if ( 
defined('SECURITYIMAGE_INCLUDED') && !SecurityImage::CheckSecurityImage() ) {
    
redirect_header'j a v a s c r i p t:history.go(-1)'2_SECURITYIMAGE_ERROR ) ;
    exit();
    }
// Hack SecurityImage de Dugris


ET ENFIN, REMPLACER EXACTEMENT CECI
// Enable captcha only if GD is Used
        
if($xoopsModuleConfig['graphic_lib'] == 'GD') {
            
$form->addElement(new XoopsFormText(_MD_EXTGALLERY_SECURITY'captcha''10''5'''),false);
        }


PAR CELA:
// Hack SecurityImage de Dugris
        
if (defined('SECURITYIMAGE_INCLUDED')) {
        
$security_image = new SecurityImage_SECURITYIMAGE_GETCODE );
        if (
$security_image->render()) {
        
$form->addElement($security_imagetrue);
        }
    }
// Hack SecurityImage de Dugris


Et voila

Pour les nullos, voici les 2 fichiers zippés dans ce forum

A+++
Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

36 Personne(s) en ligne (20 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 36 | Plus ...