Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how do i password protect my admin dir?


Guest

Recommended Posts

my admin directory is not being password protected, how do i protect it?

 

I am having the same problem as you, could someone please help us...

 

From searching the forums i think it has somehting to do with .htaccess file but i couldnt be 100% sure as there is no real guide and explination on what is to be done....

 

Cheers,

Sindows

Link to comment
Share on other sites

Hosts usually have an option to do this from their CPanel. If not, then you can generate the files yourself with free tools available on the web.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

// Open /admin/includes/application_top.php add the following code in

// include authentication user/password of administration

require(DIR_WS_INCLUDES . 'authen.php');

 

// Open /admin/includes/configure.php and add the following code in

// define admin user/password

define('ADMIN_USERNAME', 'admin');

define('ADMIN_PASSWORD', 'mypasword');

 

 

// Save the following PHP codes as authen.php in /admin/includes/authen.php

<?php

 

if(!isset($PHP_AUTH_USER))

{ header('WWW-Authenticate: Basic realm="' . TITLE . '"');

header('HTTP/1.0 401 Unauthorized');

echo $SERVER_NAME . ' Authorization Required.';

exit;

}

else

{ if (($PHP_AUTH_USER != ADMIN_USERNAME) || ($PHP_AUTH_PW != ADMIN_PASSWORD))

{ header('WWW-Authenticate: Basic realm="' . TITLE. '"');

header('HTTP/1.0 401 Unauthorized');

echo $SERVER_NAME . ' Authorization Required.';

exit;

}

}

 

?>

 

This is stolen directly from a contribution...I just don't remember the name of it...

Link to comment
Share on other sites

// Open /admin/includes/application_top.php add the following code in

// include authentication user/password of administration

  require(DIR_WS_INCLUDES . 'authen.php');

 

// Open /admin/includes/configure.php and add the following code in

// define admin user/password

  define('ADMIN_USERNAME', 'admin');

  define('ADMIN_PASSWORD', 'mypasword');

// Save the following PHP codes as authen.php in /admin/includes/authen.php

<?php

 

if(!isset($PHP_AUTH_USER))

{ header('WWW-Authenticate: Basic realm="' . TITLE . '"');

header('HTTP/1.0 401 Unauthorized');

echo $SERVER_NAME . ' Authorization Required.';

exit;

}

else

{ if (($PHP_AUTH_USER != ADMIN_USERNAME) || ($PHP_AUTH_PW != ADMIN_PASSWORD))

{ header('WWW-Authenticate: Basic realm="' . TITLE. '"');

  header('HTTP/1.0 401 Unauthorized');

  echo $SERVER_NAME . ' Authorization Required.';

  exit;

}

}

 

?>

 

This is stolen directly from a contribution...I just don't remember the name of it...

 

 

Just tryed that and it didnt work, now my admin page comes up blank

Link to comment
Share on other sites

You can either set up htaccess and htpasswd files

this link is helpful

http://www.ilovejackdaniels.com/apache/pas...-with-htaccess/

although there are a ton of other sites out there with this information

or you can try a contribution

http://www.oscommerce.com/community/contributions,3062

or most hosts have a passowrd protect link somewhere on thier control panels. They are very easy to use.

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

You can either set up  htaccess and htpasswd files

this link is helpful

http://www.ilovejackdaniels.com/apache/pas...-with-htaccess/

although there are a ton of other sites out there with this information

or you can try a contribution

http://www.oscommerce.com/community/contributions,3062

or most hosts have a passowrd protect link somewhere on thier control panels. They are very easy to use.

 

Thats all well and good,

 

But i dont use apache or a host...

 

I host my own servers and they are IISv6.0 based...

 

What can i do about that...

 

Why doesnt the admin panel come password protected as default, like the admin folder on PHPnuke, PHPBB.. etc etc...

 

Any more ideas would be much appriciated

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...