X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/0da9e6e7d82b2cb758626d1ee4eb6b3297d667b1..6cba8db7a811888e5f29708a50893ab6982b3181:/lib/utils.inc.php diff --git a/lib/utils.inc.php b/lib/utils.inc.php index de2cbfc..b61796c 100644 --- a/lib/utils.inc.php +++ b/lib/utils.inc.php @@ -22,7 +22,54 @@ class Utils { __TITLE__ -
'; + + + +
'; private $footer = '
'; @@ -174,6 +221,8 @@ class Utils { } private function getRestTicket($username, $password) { + global $CFG; + $result = false; $url = $CFG->wblistadm_url . '/ticket'; @@ -190,9 +239,11 @@ class Utils { } public function makeRestCall($method, $data = null) { + global $CFG; + $result; - $url = $CFG->wblistadm_url . "/$method"; + $url = $CFG->wblistadm_url . "$method"; $token = $this->getCSRFPreventionToken($_SESSION['ticket']); $response = $this->RESTCall($url, $data, $_SESSION['cookies'], $token); @@ -203,7 +254,11 @@ class Utils { } else { // HTTP GET $data = json_decode($response['content']); - $result = $data->data; + if (is_object($data)) { + $result = $data->data; + } else { + $result = array('No result'); + } } } else { $result = ($data) ? false : array();