Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 11 Jul 2015, 22:47
nick-harper nick-harper is offline
 
Join Date: Jun 2008
Lock Script to Scheduled Task?

I have created a custom script and added it as a scheduled task but how can I lock it so only the scheduled task can run it?

I tried to lock it to IP, but it uses the user's ip.

I tried passing a variable in the url in the task when it runs but it didn't work.

I have dumped POST and GET but nothing gets passed through when the scheduler runs it.
__________________
Coventry City Forum
Reply With Quote
  #2  
Old 11 Jul 2015, 23:32
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I'm not sure I understand. Do you mean make it so that someone can't just enter the url in their browser and run it? The scheduled tasks that come with vbulletin have this at the beginning:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


so that if it's not included from a script that has already set up $vbulletin, it won't run.
Reply With Quote
  #3  
Old 11 Jul 2015, 23:40
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by kh99 View Post
I'm not sure I understand. Do you mean make it so that someone can't just enter the url in their browser and run it? The scheduled tasks that come with vbulletin have this at the beginning:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


so that if it's not included from a script that has already set up $vbulletin, it won't run.
Good to know, Kevin!

What I did for one of my external PHP files (called via clicking a link) is this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #4  
Old 15 Jul 2015, 11:07
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
The latter is unsafe. There are several cases when $_SERVER['HTTP_REFERER'] will be empty, and it is easily faked.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #5  
Old 15 Jul 2015, 15:28
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Just protect the directory with the cron script in it. If it's in the default cron folder than it should not be accessible anyways as you should block all access to the includes directory.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 14:51.

Layout Options | Width: Wide Color: