Have I read the related troubleshooter articles above before posting (which pages?)? Yes
Have I searched the tickets before posting? Yes, found ticket 11948, but still have questions/remarks
Have I read the documentation before posting (which pages?)? Yes
Joomla! version: 2.5.11
PHP version: 5.3.22
MySQL version: 5.5.14
Host: www.kensoor.nl
Admin Tools version: 2.5.11
Description of my issue:
Within Admin Tools I can list several IP addresses that may access the administrator part of Joomla. Problem I have is that the people that needs to have access have a dynamic IP.
I already saw ticket 11948 about this and your response. But I was wondering if you can't still enhance Admin Tools with this feature? What I did now is that I have a PHP file that keeps my .htaccess updated in the /administrator/ folder. This PHP file is added in a cron.
It would be nice to have such kind of a feature for DynDNS people. Could you reconsider building this in Admin Tools?
Example of the PHP file that updates my .htaccess:
<?php
// Rewrites the entire htaccess file. When a line starts with '# Allow from myaccount.dyndns.org' the
// very next line will be replaced with the actual ip associated with myaccount.dyndns.org
$htaccessFile = "/home/webroot/public_html/administrator/.htaccess";
$handle = fopen($htaccessFile, "r");
if ($handle) {
$previous_line = $content = '';
while (!feof($handle)) {
$current_line = fgets($handle);
if(stripos($previous_line,'# Allow from myaccount.dyndns.org') !== FALSE) {
$output = gethostbyname('myaccount.dyndns.org');
$content .= 'Allow from '.$output."\n";
} elseif(stripos($previous_line,'# Allow from myaccountsecond.dyndns.org') !== FALSE) {
$output = gethostbyname('myaccountsecond.dyndns.org');
$content .= 'Allow from '.$output."\n";
}else{
$content .= $current_line;
}
$previous_line = $current_line;
}
fclose($handle);
$tempFile = tempnam('/tmp','allow_');
$fp = fopen($tempFile, 'w');
fwrite($fp, $content);
fclose($fp);
rename($tempFile,$htaccessFile);
chown($htaccessFile,'myuser');
chmod($htaccessFile,0644);
}
?>