- function getcomments($m)
- {
- global $xmlrpcerruser;
- $err="";
- $ra=array();
- // get the first param
- if(XMLRPC_EPI_ENABLED == '1')
- {
- $msgID=xmlrpc_decode($m->getParam(0));
- }
- else
- {
- $msgID=php_xmlrpc_decode($m->getParam(0));
- }
- $dbh=dba_open("/tmp/comments.db", "r", "db2");
- if($dbh)
- {
- $countID="${msgID}_count";
- if(dba_exists($countID, $dbh))
- {
- $count=dba_fetch($countID, $dbh);
- for($i=0; $i<$count; $i++)
- {
- $name=dba_fetch("${msgID}_name_${i}", $dbh);
- $comment=dba_fetch("${msgID}_comment_${i}", $dbh);
- // push a new struct onto the return array
- $ra[] = array(
- "name" => $name,
- "comment" => $comment
- );
- }
- }
- }
- // if we generated an error, create an error return response
- if($err)
- {
- return new xmlrpcresp(0, $xmlrpcerruser, $err);
- }
- else
- {
- // otherwise, we create the right response
- // with the state name
- return new xmlrpcresp(php_xmlrpc_encode($ra));
- }
- }
+ function getcomments($m)
+ {
+ global $xmlrpcerruser;
+ $err="";
+ $ra=array();
+ // get the first param
+ if(XMLRPC_EPI_ENABLED == '1')
+ {
+ $msgID=xmlrpc_decode($m->getParam(0));
+ }
+ else
+ {
+ $msgID=php_xmlrpc_decode($m->getParam(0));
+ }
+ $dbh=dba_open("/tmp/comments.db", "r", "db2");
+ if($dbh)
+ {
+ $countID="${msgID}_count";
+ if(dba_exists($countID, $dbh))
+ {
+ $count=dba_fetch($countID, $dbh);
+ for($i=0; $i<$count; $i++)
+ {
+ $name=dba_fetch("${msgID}_name_${i}", $dbh);
+ $comment=dba_fetch("${msgID}_comment_${i}", $dbh);
+ // push a new struct onto the return array
+ $ra[] = array(
+ "name" => $name,
+ "comment" => $comment
+ );
+ }
+ }
+ }
+ // if we generated an error, create an error return response
+ if($err)
+ {
+ return new xmlrpcresp(0, $xmlrpcerruser, $err);
+ }
+ else
+ {
+ // otherwise, we create the right response
+ // with the state name
+ return new xmlrpcresp(php_xmlrpc_encode($ra));
+ }
+ }