if u want to use this contribution and make a cron job add the following:
1. in the script u want to make: let's say test.php
add at the begining of the file (the first line is for a file that is in the admin protected area)
#!/usr/local/bin/php -q
2. in admin/includes/application_top.php
look for
// comment out below line to disable this contribution
if (basename($PHP_SELF) != FILENAME_LOGIN_ADMIN && basename($PHP_SELF) != FILENAME_PASSWORD_FORGOTTEN && basename($PHP_SELF) != FILENAME_FORBIDDEN) {
tep_admin_check_login();
}
and change with
if (basename($PHP_SELF) != FILENAME_LOGIN_ADMIN && basename($PHP_SELF) != FILENAME_PASSWORD_FORGOTTEN && basename($PHP_SELF) != FILENAME_FORBIDDEN) {
if (execute_cron_job == 1) {
$login_id = '1';
$login_groups_id = '1';
$login_firstname = 'test';
tep_session_register('login_id');
tep_session_register('login_groups_id');
tep_session_register('login_first_name');
}else{
tep_admin_check_login();
}
}
the ideea above is when u came from your script to register your sessions and not the go to the function tep_admin_check_login();
3. in the script u want to make: let's say test.php add before the ?>
// so it doesn't remain any sessions
tep_session_unregister('login_id');
tep_session_unregister('login_firstname');
tep_session_unregister('login_groups_id');
So finaly the cron job task looks like: don't forget the php from fron
00 21 * * * php /home/username/public_html/admin/test.php
The file attached containt only this explanation
More...




LinkBack URL
About LinkBacks









Bookmarks