Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin page Access Denied (admin.php missing) #46

Open
YasserAntonio opened this issue Sep 2, 2020 · 11 comments
Open

Admin page Access Denied (admin.php missing) #46

YasserAntonio opened this issue Sep 2, 2020 · 11 comments

Comments

@YasserAntonio
Copy link

Issue while using the last armv7 image version with nosql tag.

After installing Ampache with the community version I logged in with my admin account (had to restart db to make it work by the way) and i wanted to reach the admin page but I have a message saying me access denied :

Capture d’écran 2020-09-02 à 20 10 22

here are the error.log :

H00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.26.3. Set the 'ServerName' directive globally to suppress this message
[Wed Sep 02 17:50:26.156782 2020] [mpm_prefork:notice] [pid 14] AH00163: Apache/2.4.38 (Debian) configured -- resuming normal operations
[Wed Sep 02 17:50:26.157200 2020] [core:notice] [pid 14] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
[Wed Sep 02 17:53:00.392643 2020] [authz_core:error] [pid 20] [client 10.0.0.2:35000] AH01630: client denied by server configuration: /var/www/lib/components/bootstrap/fonts/glyphicons-halflings-regular.woff2, referer: http://ampache.ln/lib/components/bootstrap/css/bootstrap.min.css
[Wed Sep 02 17:55:20.398168 2020] [php7:error] [pid 19] [client 10.0.0.2:35046] script '/var/www/admin.php' not found or unable to stat

Seems like it's missing because I checked in /var/www/ and admin.php wasn't there but I did find an admin folder :
Capture d’écran 2020-09-02 à 20 17 46

@lachlan-00
Copy link
Member

there's not an admin.php in the root, it's all in the subfolder. you can't access the admin pages from the sidebar?

@YasserAntonio
Copy link
Author

YasserAntonio commented Sep 3, 2020

nope :
Capture d’écran 2020-09-03 à 11 01 51

there is some chances that it's linked to my next issue #47 : /var/www/login (None could be negotiated)

@lachlan-00
Copy link
Member

That picture in 47 looks like you don't have use_auth set in your config

@YasserAntonio
Copy link
Author

in which file / page the use_auth must be set ?

@lachlan-00
Copy link
Member

config/ampache.cfg.php

Screenshot_20200903-195505_ConnectBot.jpg

@YasserAntonio
Copy link
Author

It did it thanks !

@lachlan-00
Copy link
Member

I think I need to put a warning up for this config option. Thanks for keeping abreast of your issues.

@YasserAntonio
Copy link
Author

nothing comparing to all your work ! Thanks for maintaining this cool project.

@kuzi-moto
Copy link
Member

@lachlan-00 Last I looked at the code, there appeared to be some logic that would show a login button at the top of the page when the current user was logged in. Looks like that code was broken at some point, because I could never get it to show. But sometimes I can login as admin by manually navigating to the login page when use_auth was off. Though for whatever reason it wouldn't always work.

Ideally you should still be able to login, even when use_auth is off.

@lachlan-00
Copy link
Member

I've put a little lock to notify that admin is disabled. (disabled with simple_user_mode in the conf)
image

The login thing is related to getting the globals for user here, i think because default level is 5 and this is looking at less than it's never going to show up. putting <= in there now

    public static function is_registered()
    {
        if (!Core::get_global('user')->id) {
            return false;
        }

        if (!AmpConfig::get('use_auth') && Core::get_global('user')->access < 5) {
            return false;
        }

        return true;
    }

@lachlan-00
Copy link
Member

reverted the is_registered change.

the use_auth issue will eventually get solved but it's a bit too convoluted for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants