Community Add-Ons
Administration Access Level Accounts 2.0
for osCommerce Online Merchant v2.2
This is a re-work of 'Admin Account with Access Level' 1.2 by Zaenal Muttaqin to work with MS2. Here's the original:
http://www.oscommerce.com/community/contributions,1174
I had to stretch my poor PHP skills to get this to work, I did almost nothing to it. All credit goes to Zaenal.
There's two folders, an 'original' folder with all of the files not distributed with MS2 and a 'modified' folder with files that have been modified from MS2. With a virgin MS2 install simply copy all the files over the orginial MS2 files.
Here's the discussion for this:
http://forums.oscommerce.com/viewtopic.php?p=197787
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
<?
define ('execute_cron_job','1');
?>
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
