require_once('../../../lib/base.php');
+OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
function handleRename($oldname, $newname) {
- OC_JSON::checkLoggedIn();
OC_Gallery_Album::rename($oldname, $newname, OC_User::getUser());
OC_Gallery_Album::changeThumbnailPath($oldname, $newname);
}
function handleRemove($name) {
- OC_JSON::checkLoggedIn();
$album_id = OC_Gallery_Album::find(OC_User::getUser(), $name);
$album_id = $album_id->fetchRow();
$album_id = $album_id['album_id'];
}
function handleGetThumbnails($albumname) {
- OC_JSON::checkLoggedIn();
$photo = new OC_Image();
$photo->loadFromFile(OC::$CONFIG_DATADIRECTORY.'/../gallery/'.$albumname.'.png');
$offset = 3600 * 24; // 24 hour
}
function handleGalleryScanning() {
- OC_JSON::checkLoggedIn();
OC_Gallery_Scanner::cleanup();
OC_JSON::success(array('albums' => OC_Gallery_Scanner::scan('/')));
}
function handleFilescan($cleanup) {
- OC_JSON::checkLoggedIn();
if ($cleanup) OC_Gallery_Album::cleanup();
$root = OC_Preferences::getValue(OC_User::getUser(), 'gallery', 'root', '').'/';
$pathlist = OC_Gallery_Scanner::find_paths($root);
}
function handlePartialCreate($path) {
- OC_JSON::checkLoggedIn();
if (empty($path)) OC_JSON::error(array('cause' => 'No path specified'));
if (!OC_Filesystem::is_dir($path)) OC_JSON::error(array('cause' => 'Invalid path given'));
}
function handleStoreSettings($root, $order) {
- OC_JSON::checkLoggedIn();
if (!OC_Filesystem::file_exists($root)) {
OC_JSON::error(array('cause' => 'No such file or directory'));
return;