11
snakes
Re: Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/10 11:31

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


The link is repaired.
I posted it to both forums



12
snakes
Re: Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/10 9:49

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0





13
snakes
Weblinks: new link awaiting & link refused notification to anonymous
  • 2005/10/10 9:44

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


Hi there,

It's me again and weblinks again.
This is a new hack that allow notification admin when a new link is submitted and awaiting for approval and a notification to anonymous users when a link is refused.

Here is how to.
1) New link awaiting for approval:
weblinks/language/english/mail_template/link_awaiting_notify.tpl
Hi,

new site is waiting for approval.
Please connect to your admin section to check it:
{
WAITINGLINKS_URL}

New 
site's information:
Name: {SITE_NAME}
URL: {SITE_URL}
Email: {SITE_EMAIL}


weblinks/submit.php, add this function at line 47 after the include_once calls
function sendNotificationToAdmin(&$myPost) {
    global 
$xoopsConfig;
    global 
$MODULE_URL;
    
    
$xoopsMailer =& getMailer();
    
$xoopsMailer->useMail();
    
    
$xoopsMailer->assign("WAITINGLINKS_URL"$MODULE_URL."/admin/index.php?op=listNewLinks");
    
$xoopsMailer->assign("SITE_NAME"$myPost['title']);
    
$xoopsMailer->assign("SITE_URL"$myPost['url']);
    
$xoopsMailer->assign("SITE_EMAIL"$myPost['mail']);
    
    
$xoopsMailer->assign("UNAME"'');
    
$xoopsMailer->assign("ULINK"'');
    
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH."/modules/weblinks/language/".$xoopsConfig['language']."/mail_template/");
    
$xoopsMailer->setTemplate("link_awaiting_notify.tpl");
    
$xoopsMailer->setFromEmail($myPost['mail']);
    
$xoopsMailer->setFromName($xoopsConfig['sitename']);
    
$xoopsMailer->setToEmails($xoopsConfig['adminmail']);
    
$xoopsMailer->setSubject(_WLS_LINKSWAITING);
    
$success $xoopsMailer->send();
}

Now after line 157/159
// bug fix: approve notify mail dont send
            
$notification_handler->subscribe('link'$modify_newid'approve'XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
        }
add this code
// Notification to admin when a new link is waiting for approval, added by SnAKes
        
if($_POST['uid'] == && !empty($_POST['mail'])) sendNotificationToAdmin($_POST);
This should look like this
if ($notify
        {
            include_once 
XOOPS_ROOT_PATH '/include/notification_constants.php';

// bug fix: approve notify mail dont send
            
$notification_handler->subscribe('link'$modify_newid'approve'XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
        }
        
        
// Notification to admin when a new link is waiting for approval, added by SnAKes
        
if($_POST['uid'] == && !empty($_POST['mail'])) sendNotificationToAdmin($_POST);
        
redirect_header("index.php",2,_WLS_RECEIVED);



2) Link refused notification:
weblinks/language/english/mail_template/links_refused_notify.tpl
Hi,

The site you have submitted had been refused for one of the following reasons:
 - 
its contents does not meet our critera
 
its contents is illegal
 
it's a redirection URL, we only accept direct access URL

Your site'
s informations:
Name: {SITE_NAME}
URL: {SITE_URL}


weblinks/english/admin.php, add this line at the end before '?>'
define("_WEBLINKS_LINK_REFUSED""Your link has been refused");


weblinks/admin/modify.php, add this function at about line 50 after function listNewLinks()
// Notification of refusal to anonymous users, added by SnAKes
function sendRefusalNotificationToAnonymous(&$myPost) {
    global 
$xoopsConfig;
    
$xoopsMailer =& getMailer();
    
$xoopsMailer->useMail();
    
$xoopsMailer->assign("SITE_URL"$myPost["url"]);
    
$xoopsMailer->assign("SITE_NAME"$myPost["title"]);
    
$xoopsMailer->assign("UNAME"'');
    
$xoopsMailer->assign("ULINK"'');
    
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH."/modules/weblinks/language/".$xoopsConfig['language']."/mail_template/");
    
$xoopsMailer->setTemplate("link_refused_notify.tpl");
    
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
    
$xoopsMailer->setFromName($xoopsConfig['sitename']);
    
$xoopsMailer->setToEmails($myPost['mail']);
    
$xoopsMailer->setSubject(_WEBLINKS_LINK_REFUSED);
    
$success $xoopsMailer->send();
}
Now at line 84 in function delNewLink() add this code
// Notification to anonymous users, added by SnAKes
    
if($_POST['uid'] == && !empty($_POST['mail'])) sendRefusalNotificationToAnonymous($_POST);


With my old post for weblinks hack you should be able to have a weblinks that notify to anonymous user when a link is refused or approved and to admin when a link is awaiting.

Weblinks hack for anonymous email notification when link approved
Weblinks: hardlink plus php support.



14
snakes
Re: Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/9 14:08

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


I'm on the way to add 2 new hacks.
Notify to admin when a new link is awaiting for approbation, and notify visitor when a link is refused.

I think they are also essential



15
snakes
Re: Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/6 11:09

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


tzvook: I've got another thing for you.
Thumbshots.org is only for Dmoz subscribed website.
But I've discovered, thanx to GooglePreview extensions to FireFox, that when thumbshots.org doesn't find the picture for non Dmoz, you can then ask for Alexa:
http://thumbnails.alexa.com/image_server.cgi?size=small&url=YOU_URL_HERE



16
snakes
Re: Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/6 7:35

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


Just in case you want to personnalize it.
Firefox Toolbar Tutorial.
In fact the .XPI files are just .ZIP files.
And all contents are editable.



17
snakes
Re: Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/5 13:05

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


Line 200 is OK, no need to be changed.

Here are the modifications from the begining:

weblinks/templates/weblinks_header.html
<script language="javascript">
function 
weblinks_hardlink(link,lid){
  
link.href='<{$module_url}>/visit.php?lid=' lid;
  return 
true;
}
</
script>
This code is to be added on the first line of the file

weblinks/templates/weblinks_link.html (about line 6) and
weblinks/templates/weblinks_linklist.html (about line 6)
replace
<a href="<{$module_url}>/visit.php?lid=<{$link.lid}>" target="_blank">
with
<a href="<{$link.url}>" onmousedown="return weblinks_hardlink(this,<{$link.lid}>)" target="_blank">

templates/weblinks_link.html (about line 186)
The code should look like this:
<{if $link.flag_url == 1}>
    <!-- <
a href="<{$module_url}>/visit.php?lid=<{$link.lid}>" target="_blank"> -->
    <
a href="<{$link.url}>" onmousedown="return weblinks_hardlink(this,<{$link.lid}>)" target="_blank">
  <{/if}>

templates/weblinks_linklist.html (about line 67)
The code should look like this:
<{if $link.flag_url == 1}>
    <!-- <
a href="<{$module_url}>/visit.php?lid=<{$link.lid}>" target="_blank"> -->
    <
a href="<{$link.url}>" onmousedown="return weblinks_hardlink(this,<{$link.lid}>)" target="_blank">
  <{/if}>


In fact I added a javascript function that will dynamically (on the fly) change a hardlink into a redirection link.
Now in every templates file, I'm looking for a link to visit.php (this is the file that do the redirection). And I
change this link into the real hardlink and add a call to the javascript function. Thus when a guy click on the hardlink,
the browser first call the javascript function that change the hardlink into redir, and then the browser load the changed URL.

My own php and templates files of weblinks have been changed a lot of time to suit my needs for my website. I cannot post them all.

If you need, send me a mail with your weblinks_header.html, weblinks_link.html and weblink_linklist.html to support at goloom d0t com



18
snakes
Re: Might be a DOS attack .... need a sec opinion !!!
  • 2005/10/4 21:05

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


tzvook: here is a little present for you if you are using FireFox.
Meant4u Gifts Toolbar

Save it on the harddisk and drag 'n drop to the browser.



19
snakes
Re: module.textsanitizer.php hack for encrypting email addresses
  • 2005/10/4 12:43

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


Hi there.
I didn't activate the "Notify me of new posts in this thread" so I forgot that I've sent this post...

I didn't try it for 2.2.x
Gonna have a look now...
...
...Wow!
It is already in the 2.2.2 package!
So you don't need to change anything.



20
snakes
Re: Image resizing in Xoopspartners
  • 2005/10/4 12:35

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


Here is a hack that force the resizing to keep the image proportion.
index.php: (about line 67)
add this code
$ImageSize getimagesize($array_partners[$i]["image"]);
    
$ImageWidth "";
    
$ImageHeight "";
    if(
is_array($ImageSize)) {
        if(
$ImageSize[0] >= $ImageSize[1]) $ImageWidth = ($ImageSize[0]>100 "100" $ImageSize[0]);
        else 
$ImageHeight = ($ImageSize[1]>100 "100" $ImageSize[1]);
    } else {
        
$ImageWidth "100";
    }

About line 78
Change
$ImagePartner .= "<img src='".$array_partners[$i]["image"]."' alt='".$array_partners[$i]["url"]."' width='102' height='47' border='0' />";

with
$ImagePartner .= "<img src='".$array_partners[$i]["image"]."' alt='".$array_partners[$i]["url"]."' ".(!empty($ImageHeight) ? "height="$ImageHeight"" "width="$ImageWidth"")." border='0' />";


block/partners.php: (about line 46)
add this code after
list($id$url$image$title) = $xoopsDB->fetchrow($result);

$ImageSize getimagesize($image);
        
$ImageWidth "";
        
$ImageHeight "";
        if(
is_array($ImageSize)) {
            if(
$ImageSize[0] >= $ImageSize[1]) $ImageWidth = ($ImageSize[0]>100 "100" $ImageSize[0]);
            else 
$ImageHeight = ($ImageSize[1]>100 "100" $ImageSize[1]);
        } else {
            
$ImageWidth "100";
        }
        
$partners['dimensions'] = (!empty($ImageHeight) ? "height="$ImageHeight"" "width="$ImageWidth"");


templates/blocks/xoopspartners_block_site.html: (about line 40).
Replace:
<img src="<{$partner.image}>" width="102" border="0" alt="<{$partner.url}>" <{$block.fadeImage}> /><br />

with:
<img src="<{$partner.image}>" <{$partner.dimensions}> border="0" alt="<{$partner.url}>" <{$block.fadeImage}> /><br />


Now go to admin section and click on the module upgrade button




TopTop
« 1 (2) 3 4 5 ... 7 »



Login

Who's Online

199 user(s) are online (118 user(s) are browsing Support Forums)


Members: 0


Guests: 199


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits