/** * @NoAdminRequired * @CORS * @NoCSRFRequired */ public function index() { require_once 'ownnote/lib/backend.php'; return json_encode(getListing("Notes")); }
foreach ($data as $key => $value) { AKFactory::set($key, $value); } if ($data['type'] == 'ftp') { $ftp = new AKPostprocFTP(); } else { $ftp = new AKPostprocSFTP(); } $retArray['message'] = $ftp->getError(); $retArray['status'] = empty($retArray['message']); } break; case 'ftpbrowse': if (!empty($json)) { $data = json_decode($json, true); $retArray = getListing($data['directory'], $data['host'], $data['port'], $data['username'], $data['password'], $data['passive'], $data['ssl']); } break; case 'sftpbrowse': if (!empty($json)) { $data = json_decode($json, true); $retArray = getSftpListing($data['directory'], $data['host'], $data['port'], $data['username'], $data['password']); } break; case 'startExtracting': case 'continueExtracting': // Look for configuration values $retArray['status'] = false; if (!empty($json)) { if ($task == 'startExtracting') { AKFactory::nuke();
<?php \OCP\User::checkLoggedIn(); \OCP\App::checkAppEnabled('ownnote'); require_once 'ownnote/lib/backend.php'; echo json_encode(getListing("Notes")); ?>
<?php require 'queries/blogQueries.php'; $PAGE->id = 'blogListGet'; //setup for query $stmt = getListing($DB); if (!$stmt->execute()) { return errorHandler("failed to get this list {$stmt->errno}: {$stmt->error}"); } //format results $data = array(); $stmt->bind_result($data['blogId'], $data['blogDate'], $data['blogName'], $data['blogDesc'], $data['blogTitle'], $data['blogFeature']); /* fetch values */ $listResults = array(); while ($stmt->fetch()) { $row = arrayCopy($data); array_push($listResults, $row); } echo json_encode($listResults); function arrayCopy(array $array) { $result = array(); foreach ($array as $key => $val) { if (is_array($val)) { $result[$key] = arrayCopy($val); } elseif (is_object($val)) { $result[$key] = clone $val; } else { $result[$key] = $val; } }