#1  
Old 13th August 2014, 23:18
asig asig is offline
Junior Member
 
Join Date: Aug 2014
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default DNS_import improvement

Good afternoon; this is my first post. When I used the dns import process, I obtain some errors when the TTL field is specified in a non-numeric format (4h, 1d, ...)

The following function (in file ispconfig/interface/web/dns/dns_import.php ) solve this issue (if it's used in the right if/switch):

//ASIG funcion is_numericTTL
// $fff is the evaluated string
// Function result return: true is the $fff argument is a TTL number; false in other case.
// $numttl (by reference) the numeric value of the $fff string (if the argument is a TTL number); else -1
function is_numericTTL($fff, &$numttl) {
$time_format = strtolower(substr($fff, -1));
switch ($time_format) {
case 's':
$numttl = (int)(substr($fff, 0, -1));
break;
case 'm':
$numttl = (int)(substr($fff, 0, -1) * 60);
break;
case 'h':
$numttl = (int)(substr($fff, 0, -1) * 3600);
break;
case 'd':
$numttl = (int)(substr($fff, 0, -1) * 86400);
break;
case 'w':
$numttl = (int)(substr($fff, 0, -1) * 604800);
break;
default:
if (is_numeric($fff)) {
$numttl = (int)$fff;
} else {
$numttl = -1; }
}
return ($numttl != -1);
}
Reply With Quote
The Following User Says Thank You to asig For This Useful Post:
robertoshulze2257 (18th August 2014)
Sponsored Links
  #2  
Old 13th August 2014, 23:24
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,986
Thanks: 840
Thanked 5,647 Times in 4,457 Posts
 
Default

Thank you for the patch. I added it to the bugtracker.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Tags
dns, dns_import.php, import, is_numericttl, ttl

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AWStats - Fix and Improvement (working) erosbk Developers' Forum 33 1st May 2012 13:04
UI Improvement Needed ispfan Developers' Forum 1 23rd December 2011 13:03
ISPConfig named.conf improvement larwilliams Tips/Tricks/Mods 8 3rd April 2007 12:01
VSFTPD config improvement leo Developers' Forum 2 19th December 2006 17:32


All times are GMT +2. The time now is 21:58.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.