Fork me on GitHub

Rapport de message :*
 

Re: Security Image Weblinks

Titre du sujet : Re: Security Image Weblinks
par cx1max sur 30/07/2008 14:59:58

Hello, voici un hack pour le module News de InstantZero.
Il y a peut être des aberrations dans mon hack ?

News 1.61
SecurityImages pour Proposer un article

Fichier news/include/storyform.inc.php
Vers la ligne 186

Après
$smiley_checkbox = new XoopsFormCheckBox('''nosmiley'$nosmiley);
$smiley_checkbox->addOption(1_DISABLESMILEY);
$option_tray->addElement($smiley_checkbox);
$sform->addElement($option_tray);
//TODO: Approve checkbox + "Move to top" if editing + Edit indicator


Avant
//Submit buttons
$button_tray = new XoopsFormElementTray('' ,'');


Insérer
// Hack SecurityImage by DuGris
if ( defined('SECURITYIMAGE_INCLUDED') ) {
    
$captcha true;
    if (
is_object($xoopsUser) && $xoopsUser->isAdmin($com_modid)) {
        
$captcha false;
    }
    if (
$captcha) {
        
$security_image = new SecurityImage_SECURITYIMAGE_GETCODE );
        if (
$security_image->render()) {
            
$sform->addElement($security_imagetrue);
        }
    }
}
// Hack SecurityImage by DuGris




Ensuite, fichier news/submit.php
Vers la ligne 291
Après
include_once XOOPS_ROOT_PATH.'/modules/news/include/storyform.inc.php';
        break;

    case 
'post':


Avant
$nohtml_db = isset($_POST['nohtml']) ? $_POST['nohtml'] : 1;
        if (
is_object($xoopsUser) ) {
            
$uid $xoopsUser->getVar('uid');


Insérer
// Hack SecurityImage by DuGris
        
include_once(XOOPS_ROOT_PATH ."/class/xoopsformloader.php");
        
$captcha true;
        if (
is_object($xoopsUser) && $xoopsUser->isAdmin($com_modid)) {
            
$captcha false;
        }
        if (
$captcha) {
            if ( 
defined('SECURITYIMAGE_INCLUDED') && !SecurityImage::CheckSecurityImage() ) {
                
redirect_header'j a v a s c r i p t:history.go(-1)' 1_SECURITYIMAGE_ERROR ) ;
            }
        }
        
// Hack SecurityImage by DuGris

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

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