You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Please note that whilst I refer to URL_PATH in upper case, this is just for ease of viewing, URL_PATH is stored in /include/config.php in lower case:
/* set the $url_path to point to the default URL of your cacti
* install ex: if your cacti install as at
* http://serverip/cacti/ this would be set to /cacti/.
$url_path = '/cacti/';
When installing or updating cacti, the URL path should be compared against URL_PATH to ensure that the install is running from the same location as expected. If not, the URL_PATH should be updated such that:
cacti incorrect uses /cacti/ as the URL_PATH (currently)
cacti should detect that the /install/ location is no longer at /cacti/ but at / (ie, not /cacti/install/ but /install/ or maybe even query for a static/expected value using the URL_PATH/include/cacti_version)
If unable to update config.php present normal error about unwriteable configuration
Present user with warning about URL_PATH change showing old and new, allowing them to confirm the change.
I would disagree about it being at package level since it’s really something that should be set as part of the install/upgrade since an admin can change the url at any point. Especially if they are using the source to install it.
Checking for write access would be something good for both technical support and the installer. Feel free to kick the can a bit on this time permitting. Open a feature request or just do a pull when you have it done.
I am just making a pull request for this. It will display an error if the URL mismatchs with the location of the install/index.php script whilst it is running. Not sure whether to make it cleaner by moving the code into a function but now I'm just testing it with code in the index.php file.