Jump to content
Sign in to follow this  
papasan

[CONTRIB] Admin Access Level Accounts for MS2

Recommended Posts

does anyone know away around this, so if I typed: http://www.myweb.com/admin/whos_online.php in my browser, once succefully loging into the admin section it will go directly to the page I requested rather then /index.php (then have to click my way to the page).

 

i have some direct links in e-mail also, for printing packing slips and reciepts. what i currently do is click the email link, log in at index.php then click the email link again. this adds an extra couple of steps, but it's a work-around if you don't have massive amounts of orders.

 

i may look into adding a check box for remembering you're logged in unless you purposefully log-out, but don't hold your breath.

Share this post


Link to post
Share on other sites
I do not get this bug either, not sure what to tell you. perhaps you are waiting too long to do a search? sessions expire in 20-30 minutes or something like that.

 

PHP.INI default is 20 minutes (3600 second). Not too may people change that (except maybe for MaxiDVD :D )

Share this post


Link to post
Share on other sites

If I remember right... in some old code there was a way to go to a page then it would send you to login then when finished logging in it would take you back to the page you were originally entered the site from.

it is almost like a history 1 or 0 call.. but that wasn't it.

I don't think this is it, but you might look at the continue shopping button from the catalog side.

or something like

if (sizeof($navigation->snapshot) > 0) {

$origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);

$navigation->clear_snapshot();

} else {

$origin_href = tep_href_link(FILENAME_DEFAULT);

}

then when you get through logging in you would use

<td align="right"><?php echo '<a href="' . $origin_href . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

just an idea

 

nothing is guaranteed


(my knowledge is so small you would think that an ant was a genius in comparison)

Share this post


Link to post
Share on other sites

just a little trick i'm trying...i added this line to the top of my 'whos_online.php':

<meta http-equiv="refresh" content="30">

this will refresh the page every 30 seconds. so now when i'm idling on my admin page i sit it on 'whos_online.php' and it seems to keep me logged in. may change it to 60 or 120 seconds to keep the bandwidth down, but you get the picture.

Share this post


Link to post
Share on other sites

ok on the redirect it should be quite simple... lol

copy the navigation_history.php from catalog/includes/class dir to the admin/includes/class dir

in application_top.php

add the require line in for it

i.e.

// include navigation history class

require(DIR_WS_CLASSES . 'navigation_history.php');

also add these lines into the app top

// navigation history

if (tep_session_is_registered('navigation')) {

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

$navigation = new navigationHistory;

$navigation->unserialize($broken_navigation);

}

} else {

tep_session_register('navigation');

$navigation = new navigationHistory;

}

$navigation->add_current_page();

then in the files that you have the check for running the login add something like this .. you probably don't want to do this verbatim

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

then in the login page of the admin add this or something like it....

if (sizeof($navigation->snapshot) > 0) {

$origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);

$navigation->clear_snapshot();

tep_redirect($origin_href);

} else {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

}

 

really simple huh *grins*


(my knowledge is so small you would think that an ant was a genius in comparison)

Share this post


Link to post
Share on other sites

hi there

 

Strider wrote:

well you could do something like this example then

 

$cat = array();

 

if (tep_admin_check_boxes('configuration.php') != false) {

 

array_push($cat,array('title' => BOX_HEADING_CONFIGURATION,

 

*************

and continue throughout the rest of the arrays ..

 

 

Strider, once again, thanks! I got it up n running... Works great. Now each time a different user logs in, the index.php ONLY displays the sections (boxes) he has access to.

 

I don?t know if anyone is interested in having that code, but I would post it here or send it if its any help!

 

yes please I have been looking at this code for 2 days and tried to add in the "if" statements myself but just ended up messing up the code.

 

If someone could post the home index.php file It would very much appreciated.

 

I do not wont to spend any more time looking at code.. aaaaaa.a.aaa


Richard

Share this post


Link to post
Share on other sites
I don't have the problem ... do you have your permissions set correctly?

 

Which permissions do you mean, and how can check that. Im useing the Top Administrator which were preinstalled in the contrib.

 

I installed the contrib in a virgin shop ?

 

Hope YOU can help me or somebody else :D

Share this post


Link to post
Share on other sites

did you setup your file permissions in your admin... this is explained in previous posts within this forum I believe


(my knowledge is so small you would think that an ant was a genius in comparison)

Share this post


Link to post
Share on other sites

Any way to block someone after multiple failed login attempts?

I'm thinking either by cookies or by capturing the IP Address or whatever.

Further attempts after, say 3 failed ones, would result in being redirected to a "Please contact the administrator" page or something like that.

Share this post


Link to post
Share on other sites

you could put a time in the database then and check it say 30 minutes or something


(my knowledge is so small you would think that an ant was a genius in comparison)

Share this post


Link to post
Share on other sites
did you setup your file permissions in your admin... this is explained in previous posts within this forum I believe

 

Hey there I have just copy/pasted the new ver. into my shop. I have installed it on a virgin shop. Everything is working perfect, except the search and goto field.

Which permission are you talking about. I have read alle the post in this topic and can now find the answer.

 

Pls. Help or give me a hint how I can solve this. The admin protection is the only thing Im missing now....

 

Thanx.......

 

:D

Share this post


Link to post
Share on other sites
When useing a search field in the admin secion or the goto field it will log me out to (goes to login.php), it concerns every search form/goto form in the admin section....

 

did you setup your file permissions in your admin... this is explained in previous posts within this forum I believe

 

My problem is my search/goto field in the admin ? (look at the quote)

Share this post


Link to post
Share on other sites

Hey there again

 

I have search the entire forum and noby seems to have the same problem as I described here: http://forums.oscommerce.com/index.php?sho...=0entry231668 and also earlier in the topis.

 

What can it be because anything else is working PERFECT (see link for description of my problem).

 

Please note I installed the contrib on a virgin shop (MS2).

Share this post


Link to post
Share on other sites

How do you add more files on permission page? For example I have a featured product, cross sell, latest news, define mainpage as a sub folder for catalog. I also have vouchers/coupon as a new folder. Please help! I have the admin working but can't open all of the contributions above.


-----------------------------------------

Body Kit

Body Kit Forum

Share this post


Link to post
Share on other sites

ok,,

Maybe someone can tell me what I did wrong.

I installed this mod. on ms2. and when i tried to go to my admin/index.php all i get is 404 not found if i try to go to admin/login.php i get the same error.

i have saved this install however it is not live on my server as i had to get the admin section back up and running so i restored with my backup.

any ideals?

Tom


no bugs in my stuff,,, just random features ;)

Share this post


Link to post
Share on other sites
How do you add more files on permission page? For example I have a featured product, cross sell, latest news, define mainpage as a sub folder for catalog. I also have vouchers/coupon as a new folder. Please help! I have the admin working but can't open all of the contributions above.

the extra pages i have i manually added to the SQL database, but i think there's also a way to do it from the admin. if you have phpMyAdmin then open the DB and look in admin_files. it should be pretty self-explanitory.

Share this post


Link to post
Share on other sites
ok,,

Maybe someone can tell me what I did wrong.

I installed this mod. on ms2. and when i tried to go to my admin/index.php all i get is 404 not found if i try to go to admin/login.php i get the same error.

i have saved this install however it is not live on my server as i had to get the admin section back up and running so i restored with my backup.

any ideals?

Tom

if you're getting a 404 then a couple things could be happening. you could have misspelled the URL or you could be putting the files in the wrong place.

 

404 means file not found. it seems, from my experience, that when a file is not found that is linked to the file you directly access the page just stopps there. so it sounds like the main page your looking for is not where you think it is or you have the wrong URL.

Share this post


Link to post
Share on other sites
if you're getting a 404 then a couple things could be happening. you could have misspelled the URL or you could be putting the files in the wrong place.

 

404 means file not found. it seems, from my experience, that when a file is not found that is linked to the file you directly access the page just stopps there. so it sounds like the main page your looking for is not where you think it is or you have the wrong URL.

no,, when i put my original files back ,, it works fine,, same url,, and the files are there,, i can ftp in and look at them,, or use the file manager in cpanel and see them,, but,, when u try to load them,, u get 404,, not found,,,

i can see admin/index.php there,, but when u try to load it,, u get 404

i checked and double checked that each of the files from the mod was there,, and in the folder they were called for,,, but it wouldnt load ,, just 404

Thanks for the info though

Tom


no bugs in my stuff,,, just random features ;)

Share this post


Link to post
Share on other sites

I new to osConnerce so go easy one me, my problem is this im running osCommerce 2.2MS2, when i install the mod all works fine the only proplem i have is that when i try to set the member groups i get this error on the top of the pages

 

Fatal error: Call to undefined function: tep_array_merge() in D:\ladydistreats\catalog\admin\admin_members.php on line 352

 

the code that is on line 352 is

 

$mInfo_array = tep_array_merge($admin, $admin_group);

Edited by pko

Share this post


Link to post
Share on other sites
the code that is on line 352 is

$mInfo_array = tep_array_merge($admin, $admin_group);

my line 352, and the one in the 2.3 contribution, is:

$mInfo_array = array_merge($admin, $admin_group);

 

looks like you got one with a "tep_" in there somehow.

Share this post


Link to post
Share on other sites
Hey there again

 

I have search the entire forum and noby seems to have the same problem as I described here: http://forums.oscommerce.com/index.php?sho...=0entry231668 and also earlier in the topic.

 

What can it be because anything else is working PERFECT (see link for description of my problem).

 

Please note I installed the contrib on a virgin shop (MS2).

Could it be the version of PHP or what ??

Share this post


Link to post
Share on other sites
How do you add more files on permission page? For example I have a featured product, cross sell, latest news, define mainpage as a sub folder for catalog. I also have vouchers/coupon as a new folder. Please help! I have the admin working but can't open all of the contributions above.

the extra pages i have i manually added to the SQL database, but i think there's also a way to do it from the admin. if you have phpMyAdmin then open the DB and look in admin_files. it should be pretty self-explanitory.

Thanks so much, it works!

Great contribution!


-----------------------------------------

Body Kit

Body Kit Forum

Share this post


Link to post
Share on other sites
the code that is on line 352 is

$mInfo_array = tep_array_merge($admin, $admin_group);

my line 352, and the one in the 2.3 contribution, is:

$mInfo_array = array_merge($admin, $admin_group);

 

looks like you got one with a "tep_" in there somehow.

i replease my code with yours and it worked thx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×