cloudy

Author Topic: Weather Display Conditions Messenger PHP Script  (Read 20447 times)

0 Members and 1 Guest are viewing this topic.

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Weather Display Conditions Messenger PHP Script
« Reply #60 on: December 24, 2011, 06:02:31 AM »
That username / password is only to be used to better secure your cron command line argument

The instructions/ explanation is by this setting:
Code: [Select]
// security feature: require post authentication to send messages
// (my favorite method because I can set my cron for every 1 hour)
// this feature is great because then you can put the script in a public view
// requires cron command line input with curl like in this example (be sure to set your_username and your_password):
// curl -d 'username=your_username&password=your_password' http://www.642weather/weather/wd-conditions-messenger.php >/dev/null 2>&1
$require_post = 1; // set to 1 to enable

Enabling that allows me to safely put my script in public view:
you can refresh it 99 times and it will not send any email or twitter because the action to do that requires the cron command with valid user/password
http://www.642weather.com/weather/wd-conditions-messenger.php


Update, I have it working and sending emails and to Twitter with no access problems only thing I am not sure of is what  username and password this is referring to, I use the one for my server and it says login failed. Is that right?

Code: [Select]
// security feature: username
// used when $require_post = 1;
$post_username = ' ';

// security feature: password
// used when $require_post = 1;
$post_password = ' ';

Before someone says it yes I know it's blank, you think I would post my credentials in there?



Offline MesquiteWx

  • Nick
  • Posts: 403
  • Mesquite Weather Network
  • Mesquite, Texas
    • Mesquite Weather Network
Re: Weather Display Conditions Messenger PHP Script
« Reply #61 on: December 24, 2011, 06:25:10 AM »
That username / password is only to be used to better secure your cron command line argument

So is this the username/password for login to the server?

 I have tried that and it says its not valid. I have a cron set up and the only way I can get it to work is to disable the require post and enable flood protection and set the flood protection slightly before the cron to run. I understand what it's suppose to do but what I am not sure of is what username/password that is suppose to be used since my server login doesn't work.

-Thanks

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Weather Display Conditions Messenger PHP Script
« Reply #62 on: December 25, 2011, 05:56:11 PM »
the readme.txt explains it

I have flood filter enabled
You make up your own user password by filling in these settings(anything you want), then use the user/password in your cron command
$post_username = ' ';
$post_password = ' ';

Example using cron and CURL with post authentication: (be sure to set 'your_username' and 'your_password' same as in PHP script settings)
Code: [Select]
00 * * * /usr/bin/curl -d 'username=your_username&password=your_password' http://www.642weather.com/weather/wd-conditions-messenger.php >/dev/null 2>&1
In this example I use user mickey password mouse
$post_username = 'mickey';
$post_password = 'mouse';

Example using cron and CURL with post authentication:
Code: [Select]
00 * * * /usr/bin/curl -d 'username=mickey&password=mouse' http://www.642weather.com/weather/wd-conditions-messenger.php >/dev/null 2>&1

Offline MesquiteWx

  • Nick
  • Posts: 403
  • Mesquite Weather Network
  • Mesquite, Texas
    • Mesquite Weather Network
Re: Weather Display Conditions Messenger PHP Script
« Reply #63 on: December 26, 2011, 01:54:16 AM »
Forgive me as I wasn't clear on exactly what username and password to use. I understand it better now after that explanation so thank you. I already had a cron set up but my server is different so the command is different and won't work as shown in the example and that is what I wasn't sure about.

I have the flood filter set with the timed cron and that seems to be sufficing and working so I am going to stick to that since the username password method while would be better won't work on my server. Thanks again for your more detailed explanation so I better understand.

Thank you and Merry Christmas