]> git.mxchange.org Git - friendica.git/commitdiff
Move mod/nogroup to src/Module/Group
authorPhilipp Holzer <admin@philipp.info>
Fri, 3 May 2019 06:50:17 +0000 (08:50 +0200)
committerPhilipp Holzer <admin@philipp.info>
Fri, 3 May 2019 06:50:17 +0000 (08:50 +0200)
mod/nogroup.php [deleted file]
src/App/Router.php
src/Module/Group.php

diff --git a/mod/nogroup.php b/mod/nogroup.php
deleted file mode 100644 (file)
index 20dbd23..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/**
- * @file mod/nogroup.php
- */
-use Friendica\App;
-use Friendica\Core\L10n;
-
-function nogroup_init(App $a)
-{
-       if (! local_user()) {
-               return;
-       }
-}
-
-function nogroup_content(App $a)
-{
-       if (! local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
-               return '';
-       }
-
-       $a->internalRedirect('group/none');
-}
index 34ca0df3dd1b19b05e92a33397c31790490e6960..6612936e1b250b7448880c5777f28bf3848d6d87 100644 (file)
@@ -129,6 +129,7 @@ class Router
                $this->routeCollector->addRoute(['GET'],         '/magic',               Module\Magic::class);
                $this->routeCollector->addRoute(['GET'],         '/manifest',            Module\Manifest::class);
                $this->routeCollector->addRoute(['GET'],         '/nodeinfo/1.0',        Module\NodeInfo::class);
+               $this->routeCollector->addRoute(['GET'],         '/nogroup',             Module\Group::class);
                $this->routeCollector->addRoute(['GET'],         '/objects/{guid}',      Module\Objects::class);
                $this->routeCollector->addGroup('/oembed', function (RouteCollector $collector) {
                        $collector->addRoute(['GET'], '/[b2h|h2b]',                          Module\Oembed::class);
index acc969c7e025f8bab6fe75bc4a043b1c8d77d502..d8d5fb1c592086e9e2574fb246fbdf8eb08a5992 100644 (file)
@@ -176,7 +176,9 @@ class Group extends BaseModule
 
                $nogroup = false;
 
-               if (($a->argc == 2) && ($a->argv[1] === 'none')) {
+               // @TODO: Replace with parameter from router
+               if (($a->argc == 2) && ($a->argv[1] === 'none') ||
+                       ($a->argc == 1) && ($a->argv[0] === 'nogroup')) {
                        $id = -1;
                        $nogroup = true;
                        $group = [