/[cvs]/nfo/site/htdocs/netfraggle.php
ViewVC logotype

Diff of /nfo/site/htdocs/netfraggle.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by joko, Tue Aug 31 16:43:35 2004 UTC revision 1.9 by xabbu, Sun Sep 12 00:42:39 2004 UTC
# Line 22  switch ($type) { Line 22  switch ($type) {
22    case 'XMLRPC':    case 'XMLRPC':
23      include('libs/XML/Server.php');      include('libs/XML/Server.php');
24      $s = new XML_RPC_Server(array(      $s = new XML_RPC_Server(array(
25          "query" => array(
26            "function" => "nfo_query"
27            "signature" => array(array('struct','struct','struct')),
28          ),
29        "getContent" => array(        "getContent" => array(
30          "function" => "nfo_get_content",          "function" => "nfo_get_content",
31          "signature" => array(array('struct', 'string')),          "signature" => array(array('struct', 'string')),
# Line 45  switch ($type) { Line 49  switch ($type) {
49          #"signature" => array(array($xmlrpcStruct, $xmlrpcString))          #"signature" => array(array($xmlrpcStruct, $xmlrpcString))
50          #"signature" => array($XML_RPC_Struct, $XML_RPC_String)          #"signature" => array($XML_RPC_Struct, $XML_RPC_String)
51    
52    function nfo_query($params) {
53      
54      $querytxt = $params->getParam(0);
55      $nqlquery = $querytxt->getval();
56      nfo_debug_clean();
57      #nfo_debug_write($params);
58      #nfo_debug_write($nqlquery);
59      $result = array();
60      cms_query($nqlquery,&$result);
61      #nfo_debug_write($result);
62    
63      $structinfo = array();
64      $structcontent = array();
65      $structfields = array();
66      
67      foreach ($result[0] as $key => $value) {
68       $structinfo[$key] = new XML_RPC_Value($value,"string");
69        }
70      foreach ($result[1] as $key => $value)  {
71       $structcontent[$key] = new XML_RPC_Value($value,"struct");
72        }
73      foreach ($result[2] as $key => $value) {
74       $structfields[$key] = new XML_RPC_Value($value,"string");
75       }
76      $struct = array();
77      $struct[0] = new XML_RPC_Value($structinfo,"struct");
78      $struct[1] = new XML_RPC_Value($structcontent,"struct");
79      $struct[2] = new XML_RPC_Value($structfields,"struct");
80      
81      $xmldoc = new XML_RPC_Response(new XML_RPC_Value($struct, "struct"));
82      nfo_debug_write($xmldoc);
83      #nfo_debug_write($xmldoc->serialize());
84    
85    return $xmldoc;
86      
87    }
88    
89    
90  function nfo_get_content($params) {  function nfo_get_content($params) {
91    $ck = $params->getParam(0);    $ck = $params->getParam(0);
# Line 59  function nfo_get_content($params) { Line 100  function nfo_get_content($params) {
100      $struct[$key] = new XML_RPC_Value($value, "string");      $struct[$key] = new XML_RPC_Value($value, "string");
101    }    }
102    $xmldoc = new XML_RPC_Response(new XML_RPC_Value($struct, "struct"));    $xmldoc = new XML_RPC_Response(new XML_RPC_Value($struct, "struct"));
   #nfo_debug_write($xmldoc);  
   #nfo_debug_write($xmldoc->serialize());  
103    return $xmldoc;    return $xmldoc;
104  }  }
105    
106  function nfo_list_topics($params) {  function nfo_list_topics($params) {
107    nfo_debug_clean();    nfo_debug_clean();
108    #nfo_debug_write($params);    nfo_debug_write($params);
109    #nfo_debug_write("list_topics");    nfo_debug_write("list_topics");
110    $meta = $params->getParam(0);    $meta = $params->getParam(0);
111    #nfo_debug_write($meta);    nfo_debug_write($meta);
112    $type = $meta->structmem('type');    $type = $meta->structmem('type');
113    $type = $type->scalarval();    $type = $type->scalarval();
114    #nfo_debug_write("$type");    #nfo_debug_write("$type");
115    $res = cms_getindex($type);    $res = cms_getindex($type);
116    nfo_debug_write($res);    #nfo_debug_write($res);
117    $newentries = array();    $newentries = array();
118    $tmp = new XML_RPC_Value();    $tmp = new XML_RPC_Value();
119    foreach ($res as $entry) {    foreach ($res as $entry) {
# Line 106  function nfo_authenticate($params) { Line 145  function nfo_authenticate($params) {
145    $pass = $pass->scalarval();    $pass = $pass->scalarval();
146    $common_sessiondata['userdata']['name'] = $user;    $common_sessiondata['userdata']['name'] = $user;
147    $common_sessiondata['userdata']['password'] = $pass;    $common_sessiondata['userdata']['password'] = $pass;
148    nfo_debug_write($common_sessiondata);    #nfo_debug_write($common_sessiondata);
149    $retval = common_checkauthorisation();    $retval = common_checkauthorisation();
150    return new XML_RPC_Response(new XML_RPC_Value($retval, 'boolean'));    return new XML_RPC_Response(new XML_RPC_Value($retval, 'boolean'));
151  }  }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.9

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed