Jump to content

Detect admin dir


bartman
 Share

Recommended Posts

Just playing around with a new module, and need to find the path to the admin directory ,

is this possible as the admin directory can be different on every install
IMHO, I do not think this is possible. and will have to be added in the configuration of the module

Share this post


Link to post
Share on other sites

Where are you trying to detect it from? If it is from a file in the admin directory, then you can get the URL of the current page and then extract the admin directory from it. If it is a file outside the admin directory, for example in a module, then you should add a configuration option. Otherwise, the only way is to scan all the root directories, then look for a file like header.inc.php. If you find it, then you've found the admin directory.

Share this post


Link to post
Share on other sites

its a module i am building for our own use, it will be from the front office, basically i want a link to edit this item to appear on the product page, I was going to use the same functions as the maintenace page in prestashop so in the module you would input your ip and when the product page loads it detects ip and if the ip's match the link to edit this item will on the product page

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More