From 68ea287ed7fc6255f583302de8cf07b3937ac32e Mon Sep 17 00:00:00 2001
From: Roeland Jago Douma <roeland@famdouma.nl>
Date: Fri, 26 Aug 2016 15:00:18 +0200
Subject: Remove the core tag routes since they are broken

Private internal stuff that nobody *should* be using anyways.
But on top of that already broken for a long time. So nobody could be
using it even.
---
 core/Tags/Controller.php | 129 -----------------------------------------------
 core/routes.php          |  37 --------------
 2 files changed, 166 deletions(-)
 delete mode 100644 core/Tags/Controller.php

diff --git a/core/Tags/Controller.php b/core/Tags/Controller.php
deleted file mode 100644
index 3cba40636bc..00000000000
--- a/core/Tags/Controller.php
+++ /dev/null
@@ -1,129 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Thomas Tanghus <thomas@tanghus.net>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program.  If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OC\Core\Tags;
-
-class Controller {
-	protected static function getTagger($type) {
-		\OC_JSON::checkLoggedIn();
-		\OC_JSON::callCheck();
-
-		try {
-			$tagger = \OC::$server->getTagManager()->load($type);
-			return $tagger;
-		} catch(\Exception $e) {
-			\OCP\Util::writeLog('core', __METHOD__ . ' Exception: ' . $e->getMessage(), \OCP\Util::ERROR);
-			$l = new \OC_L10n('core');
-			\OC_JSON::error(array('message'=> $l->t('Error loading tags')));
-			exit;
-		}
-	}
-
-	public static function getTags($args) {
-		$tagger = self::getTagger($args['type']);
-		\OC_JSON::success(array('tags'=> $tagger->getTags()));
-	}
-
-	public static function getFavorites($args) {
-		$tagger = self::getTagger($args['type']);
-		\OC_JSON::success(array('ids'=> $tagger->getFavorites()));
-	}
-
-	public static function getIdsForTag($args) {
-		$tagger = self::getTagger($args['type']);
-		\OC_JSON::success(array('ids'=> $tagger->getIdsForTag($_GET['tag'])));
-	}
-
-	public static function addTag($args) {
-		$tagger = self::getTagger($args['type']);
-
-		$id = $tagger->add(strip_tags($_POST['tag']));
-		if($id === false) {
-			$l = new \OC_L10n('core');
-			\OC_JSON::error(array('message'=> $l->t('Tag already exists')));
-		} else {
-			\OC_JSON::success(array('id'=> $id));
-		}
-	}
-
-	public static function deleteTags($args) {
-		$tags = $_POST['tags'];
-		if(!is_array($tags)) {
-			$tags = array($tags);
-		}
-
-		$tagger = self::getTagger($args['type']);
-
-		if(!$tagger->delete($tags)) {
-			$l = new \OC_L10n('core');
-			\OC_JSON::error(array('message'=> $l->t('Error deleting tag(s)')));
-		} else {
-			\OC_JSON::success();
-		}
-	}
-
-	public static function tagAs($args) {
-		$tagger = self::getTagger($args['type']);
-
-		if(!$tagger->tagAs($args['id'], $_POST['tag'])) {
-			$l = new \OC_L10n('core');
-			\OC_JSON::error(array('message'=> $l->t('Error tagging')));
-		} else {
-			\OC_JSON::success();
-		}
-	}
-
-	public static function unTag($args) {
-		$tagger = self::getTagger($args['type']);
-
-		if(!$tagger->unTag($args['id'], $_POST['tag'])) {
-			$l = new \OC_L10n('core');
-			\OC_JSON::error(array('message'=> $l->t('Error untagging')));
-		} else {
-			\OC_JSON::success();
-		}
-	}
-
-	public static function favorite($args) {
-		$tagger = self::getTagger($args['type']);
-
-		if(!$tagger->addToFavorites($args['id'])) {
-			$l = new \OC_L10n('core');
-			\OC_JSON::error(array('message'=> $l->t('Error favoriting')));
-		} else {
-			\OC_JSON::success();
-		}
-	}
-
-	public static function unFavorite($args) {
-		$tagger = self::getTagger($args['type']);
-
-		if(!$tagger->removeFromFavorites($args['id'])) {
-			$l = new \OC_L10n('core');
-			\OC_JSON::error(array('message'=> $l->t('Error unfavoriting')));
-		} else {
-			\OC_JSON::success();
-		}
-	}
-
-}
diff --git a/core/routes.php b/core/routes.php
index dde71245930..b04b0db4ce7 100644
--- a/core/routes.php
+++ b/core/routes.php
@@ -70,43 +70,6 @@ $this->create('search_ajax_search', '/core/search')
 // AppConfig
 $this->create('core_ajax_appconfig', '/core/ajax/appconfig.php')
 	->actionInclude('core/ajax/appconfig.php');
-// Tags
-$this->create('core_tags_tags', '/tags/{type}')
-	->get()
-	->action('OC\Core\Tags\Controller', 'getTags')
-	->requirements(array('type'));
-$this->create('core_tags_favorites', '/tags/{type}/favorites')
-	->get()
-	->action('OC\Core\Tags\Controller', 'getFavorites')
-	->requirements(array('type'));
-$this->create('core_tags_ids_for_tag', '/tags/{type}/ids')
-	->get()
-	->action('OC\Core\Tags\Controller', 'getIdsForTag')
-	->requirements(array('type'));
-$this->create('core_tags_favorite', '/tags/{type}/favorite/{id}/')
-	->post()
-	->action('OC\Core\Tags\Controller', 'favorite')
-	->requirements(array('type', 'id'));
-$this->create('core_tags_unfavorite', '/tags/{type}/unfavorite/{id}/')
-	->post()
-	->action('OC\Core\Tags\Controller', 'unFavorite')
-	->requirements(array('type', 'id'));
-$this->create('core_tags_tag', '/tags/{type}/tag/{id}/')
-	->post()
-	->action('OC\Core\Tags\Controller', 'tagAs')
-	->requirements(array('type', 'id'));
-$this->create('core_tags_untag', '/tags/{type}/untag/{id}/')
-	->post()
-	->action('OC\Core\Tags\Controller', 'unTag')
-	->requirements(array('type', 'id'));
-$this->create('core_tags_add', '/tags/{type}/add')
-	->post()
-	->action('OC\Core\Tags\Controller', 'addTag')
-	->requirements(array('type'));
-$this->create('core_tags_delete', '/tags/{type}/delete')
-	->post()
-	->action('OC\Core\Tags\Controller', 'deleteTags')
-	->requirements(array('type'));
 // oC JS config
 $this->create('js_config', '/core/js/oc.js')
 	->actionInclude('core/js/config.php');
-- 
cgit v1.2.3


From d3b2e4090e5a2ad4e33c5b34b2b2a1b4dc6d2b5f Mon Sep 17 00:00:00 2001
From: Roeland Jago Douma <roeland@famdouma.nl>
Date: Fri, 26 Aug 2016 15:46:58 +0200
Subject: Autoloader update

---
 lib/composer/composer/autoload_classmap.php | 1 -
 lib/composer/composer/autoload_static.php   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index de9da7dc5a7..1363d96349e 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -396,7 +396,6 @@ return array(
     'OC\\Core\\Controller\\TwoFactorChallengeController' => $baseDir . '/core/Controller/TwoFactorChallengeController.php',
     'OC\\Core\\Controller\\UserController' => $baseDir . '/core/Controller/UserController.php',
     'OC\\Core\\Middleware\\TwoFactorMiddleware' => $baseDir . '/core/Middleware/TwoFactorMiddleware.php',
-    'OC\\Core\\Tags\\Controller' => $baseDir . '/core/Tags/Controller.php',
     'OC\\DB\\Adapter' => $baseDir . '/lib/private/DB/Adapter.php',
     'OC\\DB\\AdapterMySQL' => $baseDir . '/lib/private/DB/AdapterMySQL.php',
     'OC\\DB\\AdapterOCI8' => $baseDir . '/lib/private/DB/AdapterOCI8.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 45ac5e35e36..42b6fc83217 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -426,7 +426,6 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
         'OC\\Core\\Controller\\TwoFactorChallengeController' => __DIR__ . '/../../..' . '/core/Controller/TwoFactorChallengeController.php',
         'OC\\Core\\Controller\\UserController' => __DIR__ . '/../../..' . '/core/Controller/UserController.php',
         'OC\\Core\\Middleware\\TwoFactorMiddleware' => __DIR__ . '/../../..' . '/core/Middleware/TwoFactorMiddleware.php',
-        'OC\\Core\\Tags\\Controller' => __DIR__ . '/../../..' . '/core/Tags/Controller.php',
         'OC\\DB\\Adapter' => __DIR__ . '/../../..' . '/lib/private/DB/Adapter.php',
         'OC\\DB\\AdapterMySQL' => __DIR__ . '/../../..' . '/lib/private/DB/AdapterMySQL.php',
         'OC\\DB\\AdapterOCI8' => __DIR__ . '/../../..' . '/lib/private/DB/AdapterOCI8.php',
-- 
cgit v1.2.3