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
Legend:
Download
Report
FULL PACKAGE
Works with the following PHP Versions
5.1
5.2
5.3
not sure it works with PHP 4 Versions
cleaned up the install file
added instructions for creating a new user
delete the standard oscommerce admin files as they are no longer use and a security risk
the last upload was corrupt repacked and uploaded again
This is a full package
updated the install docs to be more compatible with 2.2 RC2A
added 3 new file for the modular index.php
NOTE: multiple reports of the zip not being able to be opened
This is a Full Package for 2.2RCA2A
This is an addon for the contri Administration Access Level Accounts 2.0.
By this addon, the user which is logged of because of he didn't request a page for too long, goes back to the page where he came from before he was logged of. Installation requires the editting of 2 files! Also Dutch installation file included.
-------------------------------------------
Dit is een toevoeging op de contri Administration Access Level Accounts 2.0.
Door deze addon gaat de gebruiker, indien deze uit is gelogd doordat deze te lang geen pagina heeft aangevraagd, na het opnieuw inloggen terug naar de pagina waar de gebruiker vandaan kwam. Ik had zelf de ergenis dat ik steeds terug moest naar waar ik vandaan kwam. Nu is dat verleden tijd!
Installatie benodigd de bewerking van slechts 2 bestanden! Inclusief Engelse installatie.
If you use the categories extension for this Contribution, there are two problems inthe SQL query in admin_members.php:
1. The language_id is set to '2'. Ihave changed it to '" . (int)$languages_id . "'
2. $top_categories_query is wrong
tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '0' order by sort_order")
If you have more then one subcategories, others then admin_id=1 cannot access these.
You need to change it to
$top_categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " order by sort_order");
File is attached
I have found a typo in login_admin.php on the line 39.
Change
$login_groups_id = $check_admin[login_groups_id];
to
$login_groups_id = $check_admin['login_groups_id'];
The file is attached
I installed this great contribuition. I got stuck on the catalog files it showed error on mysql where id=1 near to line (ALL)).
I had this great idea to make another top admin so it would be different from id=1. It really worked. So I suggest if someone has the same kind of trouble just do that as well.
Bug fixed.
Thanks for this great contribuition.
No file add - just a file with this text.
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
version 2.3.1 with french language
Added a Configuration flag and corresponding code to categories.php to allow the disabling of user-level restrictions on catalog access and catalog operations. If Configuration flag is 'true', groups with access to categories.php will be able to view/edit all products. If 'false', category access and allowable operations will need to be expressly assigned, user by user.
This zip file is NOT the full package, only the installation SQL file and the new categories.php and installation instructions.
Fixed a bug in account_check.js.php which was causing function to reject as invalid e-mail addresses having dots in leading word, such as joe.morris@graug.com. This is the full package.
Access with Level Account (v. 2.3.0) for the Administration Area of osCommerce (MS2) with categories extension
================
Version Information:
This is the full previous Admin-Access-Level package (2.1_1) with UPDATE to be compatible with osCommerce-2.2ms2-051113
This package has been originally written for osCommerce's Administration Tool (MS1) by Zaenal Muttaqin <zaenal@paramartha.org> (donation to http://www.stormpay.com <zaenal@paramartha.org>)
After, customized by Seth Lake to works on osCommerce (MS2) and refinements by Herald Ponce De Leon (hpdl@oscommerce.com)
Then, the existing works have been joined by Piero Trono (http://php-multishop.com) in this package that include the complete translation in German, Spanish, Italian and French (translation in French thanks to CRDD - coroidedroite@yahoo.fr), including the button images and some missing variables.
Note: as I don't speak German, some German Definitions are written in English, I'm sorry.
This package is released under the GNU/GPL License with absolutely no warranty
(read LICENSE.txt file).
In addition, it includes the contribution Extension to Administration Access Level Accounts 2.0 by Oliswiss http://forums.oscommerce.de/index.php?showuser=6697 with the corrections from Thomas Shittli and me, Pedro Parrilla.
===================
# Main Features
- Login box to access the Administration Panel
- Password forgotten - email password feature.
- Logoff function
- Create, edit and delete multiple administration accounts
- Create, edit and delete multiple administration groups
- Assign and define boxes and file permissions for individual groups
- Head Administrator can add and remove boxes as well as files from certain groups
- Automatically displays accessable boxes and files in the Left Menu
- Email notification when you create an administrator account
# Added features with categories access contribution:
- It is possible to set rights to product categories on their highest level for administrators.
- The Administrators see only those categories, on which them corresponding rights possess.
- Administrators of the group 1, thus the Top administrators, have full rights for all categories.
- The options for categories (new category, edit, delete, move) as well as those for products (new product, edit, delete, copy, move) can be assigned to each administrators, which are not member from the Top-Admin group.
# Added features my me:
- I have added more text to the emails to indicate the name of the corresponding admin, as well as an email copy for the store admin email so that we can always track any changes on any account, even the password changes.
- Spanish text correction.
- I have added a drop down menu on the login_admin.php form so that it is possible to select the language from the beginning.
- The user/admin logging into the administrative area will be redirected the categories page, as it does not make sense to go into the main admin page, where most of the links won't be accessible, depending on the rights defined for that admin.
- Now, the code pay attention to the rights defined not only for the main categories, but also for the sub-categories, which makes much more sense to me.
# Bugs fixed:
Apart from the integration of all the bugs posted at http://www.oscommerce.com/community/contributions,1359, I have fixed and added some bug fixes from the forum>
- I have cleaned up some links and drop down menus which should not appear in a restricted access for an admin not in the Top admin group.
- Problems with the name of the categories when editing a member.
- Database problems, as the warning one with the function tep_num_rows.
- Some general bugs regarding basic operations, as delete admin... or the edition of the categories for the top admin members.
- Of course, all bugs fixes by Thomas posted at http://www.oscommerce.com/community/contributions,1359, 6-June-2006.
- ...and the rest of the fixes posted till the current date 16-Oct-2008, including the register globals issue, the "idden" issue and so on.
====================
NOTE: This contribution comes from several contributions and fixes which I decided to integrate to help anyone which might be interested on it, given that there were some bugs and many questions on the forum, so I thought that I might share my work on trying to improve it with eveybody.
I would like to thank all people who have done/collaborated in it, starting from Zaenal Muttaqin, Seth Lak, Piero Tron, Oliswiss, of course, and Thomas Shittli.
This set of contributions (let's call this that way) has been tested with Oscommerce 2.2 Ms2.
Bug:
When a admin without permission click in some link in catalog/admin/index.php an error mesage is generated. The system canot find "FILENAME_FORBIDEN"
Fix:
file : admin/includes/functions/general.php
function : tep_admin_check_login
what to do : replace "FILENAME_FORBIDEN" to "FILENAME_FORBIDDEN"
The attached file is a dummy file that contains exactly what's written here.
This bug fix the checkbox in "Define Groups" page.
All you have to this is:
In file admin/includes/account_check.js.php
replace all
this.defineForm
to
document.defineForm
:-)
Cristiano Meira Magalhães
=========================
crixtiano@gmail.com
This fix addresses the issue when integrating Adminstration Access Levels Accounts 2.2a with the register globals contribution whereby you cannot edit admin accounts once setup(i.e. cannot change password, details, etc).
The attached file contains instructions only and is not the full package
This fixes a bug in the 24 Jan 2006 2.2a full package.
In the admin/includes/application_top.php file, the line:
if (basename($PHP_SELF) != FILENAME_LOGIN && basename($PHP_SELF) != FILENAME_PASSWORD_FORGOTTEN) {
should be changed to:
if (basename($PHP_SELF) != FILENAME_LOGIN && basename($PHP_SELF) != FILENAME_PASSWORD_FORGOTTEN && basename($PHP_SELF) !=
FILENAME_FORBIDDEN) {
The attached file is a dummy file that contains exactly what's written here.
This is the Dutch language update conctribution for Admin Acces 22a. You need to have Admin Access 22a installed. It also includes the Dutch button graphics. Enjoy
This fixes a bug in the 2 Feb 2006 2.2a full package, which as of now is regarded as the most recent "stable" version.
In the admin/admin_members.php file, line 472:
$contents[] = array('align' => 'center', 'text' => TEXT_INFO_EDIT_GROUP_INTRO . '<br> <br>' . tep_draw_input_field('admin_groups_name', $gInfo->admin_groups_name));
TEXT_INFO_EDIT_GROUP_INTRO should be TEXT_INFO_EDIT_GROUPS_INTRO.
In the admin/includes/functions/general.php file, line 973 and 974 are:
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$product_id . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'");
These lines were changed as a bug fix in the 060817 update of osCommerce core files. These should be changed to:
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$product_id . "' or products_id like '" . (int)$product_id . "{%'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . (int)$product_id . "' or products_id like '" . (int)$product_id . "{%'");
The attached file is a dummy file that contains exact what's written here.
Here are some Bug Fixes to oliswiss' last Extensions because they rewards the patch-process with the error:
Categories / Products
-> Categories / Products Status Action
1065 - Query was empty
Fixes:
======
General changes
---------------
- German translation revised, e.g. 'Account' -> 'Konto'
- Some Buttons changed, too
- No 'patch' file - you get the complete file, so that
using a Merge-Tool is no problem
admin_members.php
-----------------
- Admin-Group-Member-Editing:
works now: You can (re)define the categories-access rights
- Admin-Group-Member-Creating:
works now: You can define the the categories-access rights
and they are saved now to the Database
- Some buttons replaced:
- 'Insert' -> 'Save'
- 'Next' -> 'Save'
You have to merge the PHP-Files with your version. If you use
a Merge Tool like WinMerge
-> SourceForge.net WinMerge,
http://sourceforge.net/projects/winmerge
this step should be simple.
02.07.2006, Thomas Schittli
Current support thread is here - file is a dummy
http://forums.oscommerce.com/index.php?showtopic=186194&hl=
sorry for previous - to click happy
This extension makes it possible to set rights to product categories on their highest level for administrators.
The Administrators see only those categories, on which them corresponding rights possess.
Administrators of the group 1, thus the Top administrators, have full rights for all categories.
The options for categories (new category, edit, delete, move) as well as those for products (new product, edit, delete, copy, move) can be assigned to each administrators, which are not member from the Top-Admin group.
in english AND german
CONTAINS:
- FULL PACKAGE of this Contribution
- PATCHFILES for earlier versions
This extension makes it possible to set rights to product categories on their highest level for administrators.
The Administrators see only those categories, on which them corresponding rights possess.
Administrators of the group 1, thus the Top administrators, have full rights for all categories.
The options for categories (new category, edit, delete, move) as well as those for products (new product, edit, delete, copy, move) can be assigned to each administrators, which are not member from the Top-Admin group.
in english AND german
CONTAINS:
- FULL PACKAGE of this Contribution
- PATCHFILE for earlier version
The Patch solves following Problems:
- Administrators (not group 1), which did create a category, couldn't display it due to he had no rights on it (solved).
- a small bug in the first version prevented the deletion of a category (solved).
- Wheelmouse-problem with JavaScript solved.
The German Definitions have been corrected and upgraded because of big grammar mistakes.
Die deutschen Files wurden korrigiert und verbessert, da die ursprüngliche Übersetzung grobe grammatische Fehler aufwies, was daran liegt, dass die englischen Files einfach mit google übersetzt wurden, wobei immer große Missverständnisse entstehen.
Just a little tweeking here and there...
Moved style attributes to a separate file.
Numbered edits for ease of disabling/locating
Added "Includes Contribution" line to file headers
Added disabling directions to edited areas.
Reformatted the index.php page to show Administration and My Account at the top of the main navigation area.
Reworded a few of the language files. Translations are compliments of Dictionary.Com translator. {I'm sorry I can't be more precise in my translations, but other than Ancient Greek I'm stuck with English here.}
Added instructions for installing after other modifications and contributions are already installed. (22a-README.txt)
This extension makes it possible to set rights to product categories on their highest level for administrators.
The Administrators see only those categories, on which them corresponding rights possess.
Administrators of the group 1, thus the Top administrators, have full rights for all categories.
The options for categories (new category, edit, delete, move) as well as those for products (new product, edit, delete, copy, move) can be assigned to each administrators, which are not member from the Top-Admin group.
in english AND german
This is the full previous Admin-Access-Level package (2.1_1) with UPDATE to oscommerce-2.2ms2-051113.
The package includes definitions of constants in the following languages: english, french, spanish, italian, german.
some bugs are corrected in the file french.php :
a parse error and the french date formating behind :
// look in your $PATH_LOCALE/locale directory for available locales..
// on RedHat6.0 I used 'en_US'
// on FreeBSD 4.0 I use 'en_US.ISO_8859-1'
// this may not work under win32 environments..
setlocale(LC_TIME, 'fr_FR.ISO_8859-1');
define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
define('PHP_DATE_TIME_FORMAT', 'd/m/Y H:i:s'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
function tep_date_raw($date, $reverse = false) {
if ($reverse) {
return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
} else {
return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
}
}
This package has been written originally by Zaenal Muttaqin for osCommerce's Administration Tool (MS1), after customized by Seth Lake to works on osCommerce (MS2), with refinements by Herald Ponce De Leon.
Then, the existing works have been joined by Piero Trono (http://php-multishop.com) in this package that includes the complete translation in spanish, italian and french (translation in french thanks to CRDD - coroidedroite@yahoo.fr), including the button images and some missing variables.
I have added just one missing instruction to the admin/language/english.php file. You can overwrite your file with mine or you can put the missing instruction at line no 305. The instruction is:
define('TEXT_INFO_EDIT_GROUP_INTRO','Edit Group Introduction');
The Web Development Network [www.wadaan.net]
some small fixes, more email and SSL. not a major update.
thanks to Keith (xtreemsurf) for finding the fault in SSL compatibility. Fixes this issue.
Update the Administration Access Level Accounts 2.1 for Espanish Language
this is an update to 2.1 fixing the bad email text for forgotten passwords.
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
