.htaccess authentification not detected

Asked by Christian Jeske on 2020-09-10

Hello,

I hope my last problem on my way to get QueXF working.

I have .htaccess with 2 groups, admin and users. I get popup to login for users, if I go to admin panel, I need to log in again as I told it only group admin can see it. So, for my understanding it should work.
I also added operators and clients with those Usernames. If I say list operators I see them, if I say assign clients I see those too.
But under admin it still says:

Could not detect user authentication. Please set up web server based authentication. If using apache, see here: Apache authentication

And if I go to verify under the main menu I get asked to log in. So it really does not work.

Maybe related to this is the following:

Configuration options from php.ini:
    post_max_size = 10M Passed
    upload_max_filesize = 10M Passed
    memory_limit = 128M Passed
    max_input_vars = 10000 Recommended minimum: 10000

Found GhostScript version 9.25

Images directory NOT writeable - /images/

Scans upload directory NOT writeable - /forms/

HTPasswd file NOT writeable - /opt/quexf/password
FAILED

Second as you can see it says directory’s NOT writeable. I went and checked with my FTP program and manually set the folder and all sub directories and files below it to be write able by all groups even for public. But error still persists.
For the last one the HTPasswd, I created a folder password under the quexf directory and added a file named HTPasswd with all rights for everybody there. I also created an opt/quexf/password/HTPasswd under the root directory of the server (with ftp) and an opt/quexf/password/HTPasswd in the quexf folder.

But the error also stays up.
Is there any other way to change the rights for folders/files then with the ftp (filezilla, latest version using sftp to log into our webserver) so quexf accepts them?

Thanks again for all your time and fast answers. Helps so much!

Chris

Question information

Language:
English Edit question
Status:
Solved
For:
queXF Edit question
Assignee:
No assignee Edit question
Solved by:
Adam Zammit
Solved:
2020-09-15
Last query:
2020-09-15
Last reply:
2020-09-14
Christian Jeske (cjeske) said : #1

Allright, I was kinda stupid, I changed the location to the htpassword/user location to the absolute location on the web-Server, not the relative it was. Same with the location to Images/Forms.

Database connection succeeded

Could not detect user authentication. Please set up web server based authentication. If using apache, see here: Apache authentication

Configuration options from php.ini:

    post_max_size = 10M Passed
    upload_max_filesize = 10M Passed
    memory_limit = 128M Passed
    max_input_vars = 10000 Recommended minimum: 10000

Found GhostScript version 9.25

Images directory writeable

Scans upload directory writeable

HTPasswd file writeable

Now everything seems to work, except for the:

Could not detect user authentication. Please set up web server based authentication. If using apache, see here: Apache authentication

Not sure where to look for that one or what might be the problem.

Christian Jeske (cjeske) said : #2

Oh and the important part is still, if I go to verify it says, please log in.
Now I found something, if I add a new user (Operator) under the quexf admin menu it will create a new user in the .htaccess and in the group file. And the new group is called verifier!
So I logged in with that new verifier user/password, but still the same error under verify and the same error under the admin panel with Could not detect user authentication.

Christian Jeske (cjeske) said : #3

session_start();

$vid = get_vid();

if($vid == false){ print T_("Please log in"); exit;}

$fid = get_fid($vid);

I think this code in the verify.php is causing the error.

Not that any of this tells me anything unfortunately.

Well I found the VID in the SQL as the verifier ID but my 3 accounts are in there with VID 1,2 and 3.
I’m logged in at VID3, under the table verifierquestionnaire I see QID 2 has the VID 3 assigned to it. And under Supervisor I have ID 1 and 2 assigned to QID 2. The only questionnaire are QID 2 in the DB.

Best Adam Zammit (adamzammit) said : #4

Do you ever get asked for your username and password in the browser?

If not - then you have not configured apache conrectly for basic authentication.

If you do get asked for your username/password but queXF still complains - you may have to follow the advice here:

https://stackoverflow.com/questions/3663520/php-auth-user-not-set

Adam

Christian Jeske (cjeske) said : #5

Yes, I get a popup for PW. If I type something wrong, it gives an error, if I type correct it will log me in. Tried multiple Browsers, Login function seems to work.

I try the link. Thanks!

Christian Jeske (cjeske) said : #6

I just had to add this:

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

at the end of my .htaccess and that solved the Problem.

Thank you for all your help getting Quexf working Adam!

Christian Jeske (cjeske) said : #7

Thanks Adam Zammit, that solved my question.