09 Banned Emails

Started by Mindless, February 07, 2013, 08:59:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ZajferX

thank you very much .. i had $lang = array_merge( $lang, load_language('ad_banemail') ); in my code so added the S and now it works perfectly :D

Quote from: denede on May 03, 2014, 03:10:13 AM
did you created the lang_ad_banemails.php file into the lang/en or lang/1 directory?
and check the line from bannedemails.php to be $lang = array_merge( $lang, load_language('ad_banemails') ); and not $lang = array_merge( $lang, load_language('ad_banemail') );

the code to load the script and the rest is from signup.php and/or invite_signup.php

denede

#15
did you created the lang_ad_banemails.php file into the lang/en or lang/1 directory?
and check the line from bannedemails.php to be $lang = array_merge( $lang, load_language('ad_banemails') ); and not $lang = array_merge( $lang, load_language('ad_banemail') );

the code to load the script and the rest is from signup.php and/or invite_signup.php

ZajferX

installed it and i get an error in admin

QuoteCan't find language files

and also the last part of the mod i do not understand

load the js script

<script type='text/javascript' src='./scripts/check_mail.js'></script>

where should this code be?

find

<input type='text' size='40' name='email' />

in what file is this code?

change to

<input type='text' size='40' id='email' onblur='checkit_email();' name='email' /><div id='mailcheck'></div>

denede

Quote from: ThanaThos on January 31, 2014, 10:48:58 AM
I doubt me a little ;) so must edit this post and it adapted a tbdev 2009 and not a version already edit.

like i've said, learn to read the code. It doesn't matter if you have that part of code or not.

ThanaThos

I doubt me a little ;) so must edit this post and it adapted a tbdev 2009 and not a version already edit.

denede

#11
Quote from: ThanaThos on January 31, 2014, 09:26:29 AM
I do not search the exact phrase, but I found nothing that bears the name of "wanthintanswer"
because you don't have it. it is from another mod.
if you want it so baaaaad, take a look here:https://u-232-forum.duckdns.org/topic,1243.0.html


ThanaThos

I do not search the exact phrase, but I found nothing that bears the name of "wanthintanswer"

denede

Quote from: ThanaThos on January 30, 2014, 08:25:29 PM
Quote$wanthintanswer = md5($hintanswer);
Not found in tbdev 2009 final ...?

Search :
Quote$secret = mksecret();

bellow this add :
Quotecheck_banned_emails($email);

just insert it above $ret = mysql_query("INSERT INTO users .....
there you should find something similar to what are you looking for... (read the code, don't search for the exact phrase)

ThanaThos

Quote$wanthintanswer = md5($hintanswer);
Not found in tbdev 2009 final ...?

Search :
Quote$secret = mksecret();

bellow this add :
Quotecheck_banned_emails($email);

Mindless

#7
Well it was just thrown together from a thought, i guess i fucked it and missed something, I'll look at it some point, present i have U-232 V4 code to work out so my heads elsewhere, there's a good few members on here capable of working it out easily also so just sit patiently, its only an addition to the mod, takesignup.php still needs the proper check to stop the signup.

denede

#6
thank you, but what to do if i have js conflicting files ? i've done a topic here:
https://u-232-forum.duckdns.org/index.php?topic=1783.msg7926.html#new
now they are conflicting as hell..
it says Username Available when i insert a new username, but it shows after the email field :rofl:

Mindless

check_mail.js - scripts folder

Code (html) Select
function checkit_email() {
email = document.getElementById('email').value;
var url = '../mailcheck.php?email=' + escape(email);
try {
request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
request = false;
}
}

if (!request && typeof XMLHttpRequest != 'undefined') {
request = new XMLHttpRequest();
}
request.open("GET", url, true);
global_content = email;
request.onreadystatechange = check;
request.send(null);
}

function check() {
if (request.readyState == 4) {
if (request.status == 200) {
var response = request.responseText;
document.getElementById("mailcheck").innerHTML = response;
if(response.substring(0,20) == "<font color='#cc0000'>")
document.reform.submitt.disabled = true;
else if(response.substring(0,20) == "<font color='#33cc33'>")
document.reform.submitt.disabled = false;
}
}
}


mailcheck.php - to root folder

Code (php) Select
<?php
/**
 *   https://github.com/Bigjoos/
 *   Licence Info: GPL
 *   Copyright (C) 2010 U-232 v.3
 *   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
 *   Project Leaders: Mindless, putyn.
 *
 */
if (empty($_GET['email'])) {
    die(
'Silly Rabbit - Twix are for kids - You cant post nothing please enter a valid email address !');
}
sleep(1);
require_once (
dirname(__FILE__) . DIRECTORY_SEPARATOR 'include' DIRECTORY_SEPARATOR 'bittorrent.php');
dbconn();
$HTMLOUT "";
$lang array_merge(load_language('global') , load_language('mailcheck'));

if (!
validemail($_GET["email"])) {
    
$HTMLOUT.= "<font color='#cc0000'>{$lang['mailcheck_notval']}</font>";
    echo 
$HTMLOUT;
    exit();
}
//== Banned email checks
$email htmlsafechars($_GET["email"]);
$expl explode("@"$email);
$wildemail "*@" $expl[1];
$sql sql_query("SELECT id, comment FROM bannedemails WHERE email = " sqlesc($email) . " OR email = " sqlesc($wildemail)) or sqlerr(__FILE____LINE__);
    if (
$mailcheck mysqli_fetch_assoc($sql)) {
        
$HTMLOUT.= "<font color='#cc0000'><img src='{$INSTALLER09['pic_base_url']}cross.png' alt='Cross' title='Email address is banned' align='absmiddle' /><b>{$lang['mailcheck_sorry']} " htmlsafechars($mailcheck["email"]) . {$lang['mailcheck_banned']} " htmlsafechars($mailcheck["comment"]) . "</b></font>";
    } else {
    
$HTMLOUT.= "<font color='#33cc33'><img src='{$INSTALLER09['pic_base_url']}tick.png' alt='Tick' title='Email Valid' align='absmiddle' /><b>{$lang['mailcheck_valid']}</b></font>";
}
echo 
$HTMLOUT;
exit();
?>


lang_mailcheck.php - to lang folders

Code (php) Select
<?php
$lang 
= array(
    
//
    
'mailcheck_notval' => "That's not a valid email address, please try again",
    
'mailcheck_sorry' => "Sorry... but that email address",
    
'mailcheck_banned' => "is banned -",
    
'mailcheck_valid' => "Email is address valid"
);
?>


load the js script

Code (html) Select
<script type='text/javascript' src='./scripts/check_mail.js'></script>

find

Code (html) Select
<input type='text' size='40' name='email' />

change to

Code (html) Select
<input type='text' size='40' id='email' onblur='checkit_email();' name='email' /><div id='mailcheck'></div>

And that should be it.

denede

sounds great, in the meantime i'll try playing with the file..hmm

Mindless

By using the same method as the name check - a function to run and query the table - will do it when i have time.

denede

thank you for a fast posting. but as an adition for this, how can it be made as namecheck ?
so that when someone types a banned address, the reason will be displayed under the e-mail field or simply if it's not banned it will display it same place