diff options
author | Bart Visscher <bartv@thisnet.nl> | 2011-10-06 21:22:01 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2011-10-06 21:22:01 +0200 |
commit | b0847a61f52b8056365d26b52d23dddab329b62d (patch) | |
tree | e7dbae23e5b7ff6d4388704c4e846bfb6c6e16df /apps/gallery/ajax/createAlbum.php | |
parent | 4786ed321e802f8a63cff2bc4cb36461a3385971 (diff) | |
download | nextcloud-server-b0847a61f52b8056365d26b52d23dddab329b62d.tar.gz nextcloud-server-b0847a61f52b8056365d26b52d23dddab329b62d.zip |
Start using OC_JSON in gallery app
Diffstat (limited to 'apps/gallery/ajax/createAlbum.php')
-rw-r--r-- | apps/gallery/ajax/createAlbum.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/gallery/ajax/createAlbum.php b/apps/gallery/ajax/createAlbum.php index 3a490bdc3bd..610f761b72a 100644 --- a/apps/gallery/ajax/createAlbum.php +++ b/apps/gallery/ajax/createAlbum.php @@ -1,14 +1,11 @@ <?php require_once('../../../lib/base.php'); - -if( !OC_User::isLoggedIn()){ - echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => 'You need to log in.'))); - exit(); -} +OC_JSON::checkLoggedIn(); +OC_JSON::checkAppEnabled('gallery'); $stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES ("'.OC_User::getUser().'", "'.$_GET['album_name'].'")'); $stmt->execute(array()); -echo json_encode(array( 'status' => 'success', 'name' => $_GET['album_name'])); +OC_JSON::success(array('name' => $_GET['album_name'])); ?> |