Skip to content

Commit

Permalink
Merge pull request #30062 from nextcloud/backport/30024/stable23
Browse files Browse the repository at this point in the history
[stable23] list.php files are only invoked via ViewController and APIController
  • Loading branch information
nickvergessen authored Dec 2, 2021
2 parents 395e90c + d6bad0c commit 617d742
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 26 deletions.
2 changes: 1 addition & 1 deletion apps/files/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// TODO: move this to the generated config.js
/** @var IManager $shareManager */
$shareManager = \OC::$server->get(IManager::class);
$publicUploadEnabled = $shareManager->shareApiLinkAllowPublicUpload() ? 'yes' : 'no';;
$publicUploadEnabled = $shareManager->shareApiLinkAllowPublicUpload() ? 'yes' : 'no';

$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', false);
$isIE = OC_Util::isIe();
Expand Down
3 changes: 1 addition & 2 deletions apps/files/recentlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Check if we are a user
OC_Util::checkLoggedIn();

$config = \OC::$server->getConfig();
$userSession = \OC::$server->getUserSession();

Expand Down
3 changes: 1 addition & 2 deletions apps/files_external/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
// Check if we are a user
OC_Util::checkLoggedIn();

$config = \OC::$server->getConfig();
$userSession = \OC::$server->getUserSession();

Expand Down
2 changes: 0 additions & 2 deletions apps/files_sharing/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
use OCA\Viewer\Event\LoadViewer;
use OCP\EventDispatcher\GenericEvent;

// Check if we are a user
OC_Util::checkLoggedIn();
$config = \OC::$server->getConfig();
$userSession = \OC::$server->getUserSession();
$legacyEventDispatcher = \OC::$server->getEventDispatcher();
Expand Down
2 changes: 0 additions & 2 deletions apps/files_trashbin/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
// Check if we are a user
OC_Util::checkLoggedIn();

$config = \OC::$server->getConfig();
$userSession = \OC::$server->getUserSession();
Expand Down
17 changes: 0 additions & 17 deletions apps/systemtags/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
// WARNING: this should be moved to proper AppFramework handling
// Check if we are a user
if (!\OC::$server->getUserSession()->isLoggedIn()) {
header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute(
'core.login.showLoginForm',
[
'redirect_url' => \OC::$server->getRequest()->getRequestUri(),
]
)
);
exit();
}
// Redirect to 2FA challenge selection if 2FA challenge was not solved yet
if (\OC::$server->getTwoFactorAuthManager()->needsSecondFactor(\OC::$server->getUserSession()->getUser())) {
header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge'));
exit();
}

$tmpl = new OCP\Template('systemtags', 'list', '');
$tmpl->printPage();

0 comments on commit 617d742

Please sign in to comment.