<?php
/**
 * @package tikiwiki
 */
// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id: tiki-user_notifications.php 68531 2018-12-12 11:59:47Z xavidp $

$section = 'mytiki';
require_once('tiki-setup.php');

$auto_query_args = ['userId', 'view_user'];

$access->check_user($user);
$access->check_feature('feature_user_watches');

$headerlib->add_map();

if (isset($_REQUEST['user_calendar_watch_editor']) && $_REQUEST['user_calendar_watch_editor'] == true) {
	$tikilib->set_user_preference($user, 'user_calendar_watch_editor', 'y');
} else {
	$tikilib->set_user_preference($user, 'user_calendar_watch_editor', 'n');
}

if (isset($_REQUEST['user_article_watch_editor']) && $_REQUEST['user_article_watch_editor'] == true) {
	$tikilib->set_user_preference($user, 'user_article_watch_editor', 'y');
} else {
	$tikilib->set_user_preference($user, 'user_article_watch_editor', 'n');
}

if (isset($_REQUEST['user_wiki_watch_editor']) && $_REQUEST['user_wiki_watch_editor'] == true) {
	$tikilib->set_user_preference($user, 'user_wiki_watch_editor', 'y');
} else {
	$tikilib->set_user_preference($user, 'user_wiki_watch_editor', 'n');
}

if (isset($_REQUEST['user_blog_watch_editor']) && $_REQUEST['user_blog_watch_editor'] == true) {
	$tikilib->set_user_preference($user, 'user_blog_watch_editor', 'y');
} else {
	$tikilib->set_user_preference($user, 'user_blog_watch_editor', 'n');
}

if (isset($_REQUEST['user_tracker_watch_editor']) && $_REQUEST['user_tracker_watch_editor'] == true) {
	$tikilib->set_user_preference($user, 'user_tracker_watch_editor', 'y');
} else {
	$tikilib->set_user_preference($user, 'user_tracker_watch_editor', 'n');
}

if (isset($_REQUEST['user_comment_watch_editor']) && $_REQUEST['user_comment_watch_editor'] == true) {
	$tikilib->set_user_preference($user, 'user_comment_watch_editor', 'y');
} else {
	$tikilib->set_user_preference($user, 'user_comment_watch_editor', 'n');
}

if (isset($_REQUEST['user_category_watch_editor']) && $_REQUEST['user_category_watch_editor'] == true) {
	$tikilib->set_user_preference($user, 'user_category_watch_editor', 'y');
} else {
	$tikilib->set_user_preference($user, 'user_category_watch_editor', 'n');
}

if (isset($_REQUEST['user_plugin_approval_watch_editor']) && $_REQUEST['user_plugin_approval_watch_editor'] == true) {
	$tikilib->set_user_preference($user, 'user_plugin_approval_watch_editor', 'y');
} else {
	$tikilib->set_user_preference($user, 'user_plugin_approval_watch_editor', 'n');
}

header('Location: tiki-user_watches.php');
die;
