Kleine Pimmel Scripts


Another attempt in favor of Mailcow’s “Have SOGo as root and admin panel under /admin #393” issue.

Following are changes to the files! DO NOT REPLACE THE ENTIRE CONTENT OF THE FILES WITH THIS!


/opt/mailcow-dockerized/data/web/index.php:


<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';

if ($_SESSION['_want'] === 'admin' || $_POST['logout'] == '' && !empty($_POST['csrf_token'])) {
        } else {
                header('Location: /SOGo');
        }

/opt/mailcow-dockerized/data/web/admin.php:


<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';

$_SESSION['_want'] = 'admin';

By default / will redirect to /SOGo. Now go to /admin and you’ll see the login untill you logout, then / will redirect to /SOGo again.