summaryrefslogtreecommitdiffstats
path: root/ajax/usersettings.php
blob: 010bb49b82581e19d3c6edf8b0bbab163d1ab3a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/**
* ownCloud - News app
*
* @author Bernhard Posselt
* Copyright (c) 2012 - Bernhard Posselt <nukeawhale@gmail.com>
* 
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file
* 
*/

// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('news');
OCP\JSON::callCheck();

if(isset($_POST['showAll'])) {
    if($_POST['showAll'] === 'false') {
        $showAll = false;
    } else {
        $showAll = true;
    }
    OCP\Config::setUserValue(OCP\USER::getUser(), 'news', 'showAll', $showAll);     
}

OCP\JSON::success();