HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   Remoting Classes, bug ? (http://www.howtoforge.com/forums/showthread.php?t=61261)

jmans 2nd April 2013 11:57

Remoting Classes, bug ?
 
Hello,

There is a mistake in the class Remoting.
This prevents the "$ client-> dns_zone_get_id ($ session," igigoiejfe.org. ")"
not work!

Here is a patch which I hope to bring good solution.

Code:

cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xvfz ISPConfig-3-stable.tar.gz

diff -ar -p /tmp/ispconfig3_install/interface/lib/classes/remoting.inc.php /usr/local/ispconfig/interface/lib/classes/remoting.inc.php
*** /tmp/ispconfig3_install/interface/lib/classes/remoting.inc.php      2012-12-04 14:36:35.000000000 +0100
--- /usr/local/ispconfig/interface/lib/classes/remoting.inc.php 2013-04-02 11:40:28.800116179 +0200
*************** class remoting {
*** 2142,2148 ****
              return false;
          }

!        $rec = $app->db->queryOneRecord("SELECT id FROM dns_soa WHERE origin like '".$origin.'%');
          if(isset($rec['id'])) {
              return $app->functions->intval($rec['id']);
          } else {
--- 2142,2148 ----
              return false;
          }

!        $rec = $app->db->queryOneRecord("SELECT id FROM dns_soa WHERE origin like '".$origin."'");
          if(isset($rec['id'])) {
              return $app->functions->intval($rec['id']);
          } else {


till 2nd April 2013 12:15

You use the function in the wrong way, so ther is no bug.
The ID parameter has to be either numerical or you have to pass an array if you want to search for a domain name.

Example for correct usage of the zone get fuction to return a zone by domain name:

$client->dns_zone_get($session, array('origin' => 'igigoiejfe.org.'));


All times are GMT +2. The time now is 16:27.

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