Jump to content

Will Munny

Clients
  • Posts

    1,557
  • Joined

  • Last visited

  • Days Won

    2

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by Will Munny

  1. This appears to have changed in the latest version. There now appears to be only one place to make the edit. The 'PT30M'. Is this a safe edit, are there any gotchas I may have missed?. . .

    /applications/core/widgets. . .

    		/* Do we have permission? */
    		if ( !\IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'online' ) ) )
    		{
    			return "";
    		}
    
    		$where = array(
    			array( 'core_sessions.running_time>' . \IPS\DateTime::create()->sub( new \DateInterval( 'PT30M' ) )->getTimeStamp() ),
    			array( 'core_groups.g_hide_online_list=0' )
    		);

     

  2. If altering this you would need to also make sure PHP is configured so that the session expiration time is at least as high as the value you set or you'll see varying results when garbage collection runs. that is one of the reasons it is no longer configurable as increasing the value does not necessarily lead to reliable results

    Is this the session.gc_maxlifetime setting?

  3. Yes you're right, thanks for the pointer. There were two references to the 30 minute limit in that file you mentioned and changing them both (one for members, one for guests) appears to work. . .

            /* Get Members */
            $members = iterator_to_array( \IPS\Db::i()->select( array( 'member_id', 'member_name', 'seo_name', 'member_group' ), 'core_sessions', array(
                array( 'login_type=' . \IPS\Session\Front::LOGIN_TYPE_MEMBER ),
                array( 'running_time>' . \IPS\DateTime::create()->sub( new \DateInterval( 'PT90M' ) )->getTimeStamp() )
            ), 'running_time DESC', $this->orientation === 'horizontal' ? NULL : 60 )->setKeyField( 'member_id' ) );
            
            /* Get guests count */
            $memberCount = 0;
            $guests = 0;
            $anonymous = 0;
            if ( $this->orientation === 'horizontal' )
            {
                foreach ( \IPS\Db::i()->select( 'login_type, COUNT(*) AS count', 'core_sessions', array( 'running_time>' . \IPS\DateTime::create()->sub( new \DateInterval( 'PT90M' ) )->getTimeStamp() ), NULL, NULL, 'login_type' ) as $row )

    Safe???

    Also, There appears to be no setting to make this box only available to members. Do you have any advice for me on how to hide it from guests?

  4. Actually it seems you also have to edit the following line to make it work. . .

    		$table->limit = 30;

    That also makes the online users page much bigger or smaller though (depending on which way you edit the limit). I actually prefer to see bigges online users pages.

    Any devs got some input for this?

  5. I think I figured this out myself. In /applications/core/modules/front/online. . .

            /* Initial filters */
            $where = array(
                array( "core_sessions.running_time>?", \IPS\DateTime::create()->sub( new \DateInterval( 'PT30M' ) )->getTimeStamp() ),

    If I change the 'PT30M' to something like 'PT15M' or 'PT90M', it appears to work. Is this a safe edit?

  6. I hope there'll be a skin changes instructional. This will be the first time I'll try that updating method. I had a server HDD failure this week that cost me a whole lot of time to rebuild my system to spec (plus 10 hours forum downtime. Last thing I need is an IPB upgrade :D


  7. Hmm not sure i understand. :) You are giving me an adivce to install csf? :) Or maybe i didnt understand... :D



    Well, I'm assuming you want to get your server tuned up in general... and that includes rock solid security to keep out unwanted spiders and scrapers, which hog resources, sometimes badly. If you've just got yourself an UNMANAGED server, PHP will be set to all it's default values i.e. wide open to attack, back door placements, this that and the other... you need to close up the cracks immediately. Apache/Linux comes with it's own firewall built in and configserver's plugin is a nice addition to your server as a graphical interface and automated system to detect attacks and block them. It also downloads things like the Spamhaus lists so it's up to date on the latest threats. You can just set it up and forget it... I went online with my server without the firewall switched on to see what would happen. Thousands of bots online, all of them bad bots. Getting your firewall set up nicely is key to saving your resources for those that deserve it i.e. your real human visitors.


    Hmmm... Installed apc? :huh: We tried with memcache. But, there is a page "apc.php" that you can put on your server so it shows apc stats, also we found memcache.php page but it was always showing like 99,9% free and 0,01% was cached... :huh: What i want to say is that we didnt know if memcache was working at all... :(



    As I alluded to above, at this time I'm more concerned that you're running a default PHP set up... do some Googling for 'Harden PHP' and you'll see lots of advice and tutorials.
    Look at it like this: Put the plug in the plug hole before filling the bath with water.
  8. If you're running cPanel, you could do a lot worse than installing the configserver plugin to manage your firewall. Although their install services are available for a fee, it's actually free software and if you're confident enough, you can install it and set it up on your own...
    http://www.configserver.com/cp/csf.html

    ... advice given humbly with no sense of superiority :blink:

  9. Did you read my tutorial on changing to UTF-8?... It's not a database converter but it details the exhaustive steps required to be truly running in UTF-8... and many people probably won't need to make the conversion if you take these steps. In fact, you may decide that running a converter on your database is not worth the risk, unless your board's primary language is in a complex script...

    After making the changes detailed in my tutorial, everything posted thereafter will work fully and properly in UTF-8, no matter what the language...
    Making the switch to UTF-8

  10. So I can just change...

    $url	= preg_replace( "/s=([a-zA-Z0-9]{32})(&|&)/", '', $url ) . '&s=' . $matches[1];

    to...

    $url	= preg_replace( "/s=([a-zA-Z0-9]{32})(&|&)/", '', $url ) . '&s=' . $matches[1];



    I just tested and now everything validates perfectly. Is this safe? Is it really as elementary as this?!!

  11. Well I'm only seeing this after upgrading. Previously I had every topic page valid. Now I get hundreds of ampersand erros in cookie session id's...
    My browser doesn't display the cookeis but automates services, such as bots, validators, header checkers etc etc are seeing the sessions and the invaliud code.

  12. I previously had my board 100 percent valid code... but I just upgraded to 3.0.4 and I get hundreds of errors. Most of them seem to cascade from an unescaped ampersand in session ID... eg...

    …e&module=global&section=login&s=128379128371'

    Where can I fix this?

×
×
  • Create New...