Beispiel #1
0
 public static function get($parameters)
 {
     OC_Util::checkLoggedIn();
     $user = OC_User::getUser();
     $app = addslashes(strip_tags($parameters['app']));
     $key = addslashes(strip_tags($parameters['key']));
     $result = OC_OCS::getData($user, $app, $key);
     $xml = array();
     foreach ($result as $i => $log) {
         $xml[$i]['key'] = $log['key'];
         $xml[$i]['app'] = $log['app'];
         $xml[$i]['value'] = $log['value'];
     }
     return new OC_OCS_Result($xml);
     //TODO: replace 'privatedata' with 'attribute' once a new libattice has been released that works with it
 }
Beispiel #2
0
 /**
  * get private data and create the xml for ocs
  * @param string $format
  * @param string $app
  * @param string $key
  * @return string xml/json
  */
 private static function privateDataGet($format, $app = "", $key = "")
 {
     $user = OC_OCS::checkpassword();
     $result = OC_OCS::getData($user, $app, $key);
     $xml = array();
     foreach ($result as $i => $log) {
         $xml[$i]['key'] = $log['key'];
         $xml[$i]['app'] = $log['app'];
         $xml[$i]['value'] = $log['value'];
     }
     $txt = OC_OCS::generatexml($format, 'ok', 100, '', $xml, 'privatedata', 'full', 2, count($xml), 0);
     //TODO: replace 'privatedata' with 'attribute' once a new libattice has been released that works with it
     echo $txt;
 }