Making a MOD Kill switch...?

Discussion forum for MOD Writers regarding MOD Development.
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Making a MOD Kill switch...?

Post by igorw » Mon Jul 05, 2010 9:54 am

MasterZ wrote:You can make it only disable the mod if it connects to the distant end and gets a disable signal.
Exactly, you have 4 possibilities:
  • Well-formed response, MOD stays enabled
  • Well-formed response, MOD gets disabled
  • Bad response (could not parse JSON or similar), MOD stays enabled
  • Timeout (could not reach host), MOD stays enabled
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

User avatar
imkingdavid
Former Team Member
Posts: 2667
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: Making a MOD Kill switch...?

Post by imkingdavid » Mon Jul 05, 2010 2:06 pm

eviL<3 wrote:
MasterZ wrote:You can make it only disable the mod if it connects to the distant end and gets a disable signal.
Exactly, you have 4 possibilities:
  • Well-formed response, MOD stays enabled
  • Well-formed response, MOD gets disabled
  • Bad response (could not parse JSON or similar), MOD stays enabled
  • Timeout (could not reach host), MOD stays enabled
Fair point. :)
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3467
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Re: Making a MOD Kill switch...?

Post by bonelifer » Mon Jul 05, 2010 3:27 pm

Instead of a kill switch just inform them there is a new version or that there is a security/bug issue. People don't like it when you start f'n with their board. Hence why people have in the past made mods to disable the "phpbb is out of date" message in the ACP, because they don't like it when you call "home". Therefore if you are going to do this it should be the least invasive, ie just a message and no messing with(ie turning off of the mod).
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

User avatar
3Di
Former Team Member
Posts: 13781
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Making a MOD Kill switch...?

Post by 3Di » Mon Jul 05, 2010 3:30 pm

bonelifer wrote:Instead of a kill switch just inform them there is a new version or that there is a security/bug issue. People don't like it when you start f'n with their board. Hence why people have in the past made mods to disable the "phpbb is out of date" message in the ACP, because they don't like it when you call "home". Therefore if you are going to do this it should be the least invasive, ie just a message and no messing with(ie turning off of the mod).
Indeed, but.. if a MOD got a security issue/hole then we have to have to disable it.. the reason's point is clear, I think.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
imkingdavid
Former Team Member
Posts: 2667
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: Making a MOD Kill switch...?

Post by imkingdavid » Mon Jul 05, 2010 5:15 pm

3Di wrote:
bonelifer wrote:Instead of a kill switch just inform them there is a new version or that there is a security/bug issue. People don't like it when you start f'n with their board. Hence why people have in the past made mods to disable the "phpbb is out of date" message in the ACP, because they don't like it when you call "home". Therefore if you are going to do this it should be the least invasive, ie just a message and no messing with(ie turning off of the mod).
Indeed, but.. if a MOD got a security issue/hole then we have to have to disable it.. the reason's point is clear, I think.
The admin should be on top of things enough to check periodically for updates. If they're not, it's their fault if their board gets messed up because of an out of date MOD. I don't think it's right to completely disable a feature that the admin took the time to add and expects to be there every time.

Also, by turning of the feature, that doesn't tell the admin that the feature is out of date or has a security flaw. They begin to think there's an issue on their side and freak out. Instead, maybe just a notification like the staff-viewable board offline message adapted for version out of date.

If such a feature is included, as was suggested before, there should be an on/off switch for it.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
Sajaki
Registered User
Posts: 1354
Joined: Mon Mar 02, 2009 1:41 pm
Name: Andreas
Contact:

Re: Making a MOD Kill switch...?

Post by Sajaki » Mon Jul 05, 2010 6:47 pm

wow that's a neat idea ;)

i have something like this in the acp to check for the mod version against a file in my svn repo. but it just shows a red warning in Acp. however, you could do things like setting a flag whenever the version number isn't right.

Code: Select all

$info = get_remote_file('your.repository.com', '/svn/trunk', 'version.txt', $errstr, $errno);
if ($info === false)
   {
       	// version file reference does not exist, do not perform comparison.
   }
   else
    {
   	$info = explode("\n", $info);
        $latest_version = trim($info[0]);
			
	// is the installed version >= the latest version ? then you are up to date
	$up_to_date = (version_compare(
	         str_replace('rc', 'RC', strtolower($installed_version)), 
	         str_replace('rc', 'RC', strtolower($latest_version)), 
		            '=')) ? true : false;
		        		
        if ($up_to_date) 
         {
                  // your version is the same or even newer than the official version
                  // OK
          } 
         else               
          {
                  // you have an old version
                   // WRITE an sql that sets a flag to false
                  // make your mod depending on this flag be true
           }
}
        		

User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Spokane, WA
Name: David Lewis
Contact:

Re: Making a MOD Kill switch...?

Post by Highway of Life » Tue Jul 06, 2010 9:45 pm

eviL<3 wrote:Exactly, you have 4 possibilities:
  • Well-formed response, MOD stays enabled
  • Well-formed response, MOD gets disabled
  • Bad response (could not parse JSON or similar), MOD stays enabled
  • Timeout (could not reach host), MOD stays enabled
In the case of bad response or timeout, it could return a “click here to see if your MOD is up to date”, That link would have a variable that contains the current version number, and the link goes to a simple PHP script that would compare your latest version to the newest one. If your version is old, it could display a link to download the new version of the MOD. That would adequately handle servers that keep the MOD from checking the version.

You could also use JSONp
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.

User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Making a MOD Kill switch...?

Post by igorw » Tue Jul 06, 2010 11:38 pm

Highway of Life wrote:You could also use JSONp
Good point. Or even CORS (cross-site resource sharing) for those browsers that support it (firefox, chrome, safari, IE (I believe)). A client-side solution would not require scheduling those requests on the server side and you could probably still get some client-side caching for them. I like that approach.

It is important to note that of course JavaScript would need to be enabled for this to work.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Spokane, WA
Name: David Lewis
Contact:

Re: Making a MOD Kill switch...?

Post by Highway of Life » Thu Jul 08, 2010 12:59 am

eviL<3 wrote:It is important to note that of course JavaScript would need to be enabled for this to work.
Again, you can have a fall-back for this too. And JS would only be required by the admin, right?
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.

User avatar
3Di
Former Team Member
Posts: 13781
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Making a MOD Kill switch...?

Post by 3Di » Thu Jul 08, 2010 1:37 am

Bah, by my side you are making things bigger that they need, just a boolean PHP stuff, a .txt file with a boolean flag that lies here and there... I mean different sites, thast's all. Take it easy.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

Locked

Return to “[3.0.x] MOD Writers Discussion”