Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules
Author Message
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Tue Feb 10, 2009 3:20 pm Reply with quote

This Ms-Analysis Cron Job script broke under RN2.3, was working under RN until then. Probably something simple with the include path but after a few attempts no luck, so here I am Smile

modules/MS_Analysis/include/cronmaintenance.php
Code:
global $prefix, $db;


// Set time limit and ignore user abort
if( !get_cfg_var('safe_mode') )
{
   @set_time_limit( 300 );
   @ignore_user_abort( 1 );
}

// Next setting ($forum_admin) is needed so that PHP-Nuke finds the required files in the correct path
define('FORUM_ADMIN', true);
require_once("../../../config.php");
require_once("../../../db/db.php");
// END: Next setting ($forum_admin) is needed so that PHP-Nuke finds the required files in the correct path

// Load Admin Settings
$result = $db->sql_query( "select curdate, staticupdate, GMT_offset, allow_pruning from $prefix"._msanalysis_admin." where id='1'" );
$MSArow = $db->sql_fetchrow( $result );

// Compose LOCAL Timestamp   
$MSAdata[current] = -1 * ( date( "Z" ) / 3600 );
$MSAdata[zonedate] = mktime(date('H'), date('i'), date('s'), date('n'), date('j'), date('Y'), -1) + ( ( $MSAdata[current] + $MSArow[GMT_offset] ) * 3600 );
$MSAdata[logdate] = date( "Y-m-d H:i:s", $MSAdata[zonedate] );
$MSAdata[slogdate] = date( "Y-m-d", $MSAdata[zonedate] );

// Set last update time
$db->sql_query( "update $prefix"._msanalysis_admin." set lastupdate = '$MSAdata[logdate]' where id='1'" );

// Carry out maintenance every hour (by cron deamon)
if( $MSArow[staticupdate] ) {
   require_once( "class.maintenance.php" );    // Routine Classes for tracker
   $msamainteneance = new msa_maintenance();
   $msamainteneance->hourly_maintenance( $MSAdata[slogdate] );
}
   
// Every day default clear the hits for this day. If set, also prune MS-Tables
if( $MSAdata[slogdate] != $MSArow[curdate] ) {
   if( $MSArow[staticupdate] ) {
      // Set new logdate in Admin Table
      $db->sql_query( "update $prefix"._msanalysis_admin." set curdate='$MSAdata[slogdate]' where id = '1'" );
      require_once( "class.maintenance.php" );    // Routine Classes for tracker
      $msamainteneance = new msa_maintenance( );
      $msamainteneance->daily_maintenance( );
      if( $MSArow[allow_pruning] ) $msamainteneance->pruning_maintenance( );
   }
}

unset( $MSAdata );

Heres the full download if needed http://www.rtsforce.com/files/MS_analysis_full.zip
 
View user's profile Send private message Visit poster's website
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Tue Feb 10, 2009 9:58 pm Reply with quote

Forum files moved, and your error log will most likely tell you the exact problem, which might be outside this script.

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
spasticdonkey







PostPosted: Tue Feb 10, 2009 11:58 pm Reply with quote

thanks, that gives me a place to start Smile
 
spasticdonkey







PostPosted: Thu Feb 12, 2009 7:23 am Reply with quote

well it ended up being that the script is calling config.php directly without calling mainfile, so it wasnt loading rnconfig, as per this post: [ Only registered users can see links on this board! Get registered or login! ]

changing line 95 in config.php to
if(!defined('INCLUDE_PATH')) define('INCLUDE_PATH', '');
got it working again
 
kguske







PostPosted: Thu Feb 12, 2009 7:41 am Reply with quote

I'm wondering if that might affect your other functions. Maybe you could add that line to the msanalysis script before it includes config.php?
 
spasticdonkey







PostPosted: Thu Feb 12, 2009 8:30 am Reply with quote

yes that worked and is a much better solution Smile
 
draxx
Involved
Involved



Joined: Nov 19, 2003
Posts: 282

PostPosted: Mon Apr 13, 2009 5:08 pm Reply with quote

I loved it but MS Analysis is soooooooo insecure you do know that right?
 
View user's profile Send private message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Sun Jul 15, 2012 8:17 am Reply with quote

Is it safe this one to install it with the last RavenNuke version?
 
View user's profile Send private message
spasticdonkey







PostPosted: Sun Jul 15, 2012 10:27 am Reply with quote

I'm not sure what version you are using, but I played with v2.3 pro for awhile, and it still had many cases of full path disclosure. There were also several known issues and I'm not sure how many were fixed before the script was no longer supported. I myself would not use it without making a bunch of changes.
 
KennyW
Hangin' Around



Joined: Jul 15, 2004
Posts: 44

PostPosted: Tue Jul 17, 2012 4:53 pm Reply with quote

MS Analysis Brings back some memories havent seen this in many years just got to test it out again,many thanks for the link to download it Spasticdonkey
 
View user's profile Send private message
chatserv
Member Emeritus



Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico

PostPosted: Wed Sep 11, 2013 12:45 am Reply with quote

At a quick glance it seemed to me that admin files, (at least the files that i checked), are storing data into the DB without much variable checking or filtering. But i didn't view all files, filtering could be taking place on some included file. Either way i'm guessing some old abandoned modules might have fallen behind if no one took over.
 
View user's profile Send private message Visit poster's website
draxx







PostPosted: Sun Sep 15, 2013 1:09 am Reply with quote

Hi Chatserv!
 
hicuxunicorniobestbuildpc







PostPosted: Mon Nov 18, 2013 5:14 am Reply with quote

Is there any future for this module?
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Wed Nov 20, 2013 5:56 pm Reply with quote

Unlikely seeing as it has been unsupported for a few years now. You can find most information any way either through the Statistics module or through your hosting control panel.
 
View user's profile Send private message Send e-mail
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©