openfactory-ch / whmcs-oath-addon

Google Authenticator (OATH) addon for WHMCS 6+ for admin and client area.
19 stars 20 forks source link

Cant view oath settings view like an custorem #8

Closed asd200 closed 7 years ago

asd200 commented 8 years ago

After I logged in like an customer link index.php?m=oath simply doesn't work. Anny suggestions?

For admins configuration works fine

asd200 commented 8 years ago

I guess that it can be some problem with index.php - it redirects me automaticly to clientarea.php

I also discovered that in adminarea->client profile->profile I can't check "Two-Factor Authentication" checkbutton

Do you have anny sugestions how to fix this?

dionysius commented 7 years ago

Hi, sorry for the late response. What version of WHMCS are you using? We're still using v6.3.1, so if it's a V7 issue, well then I need to update into that soon.

asd200 commented 7 years ago

Hi @dionysius nice to see your response.

I'm also working on WHMCS v6.3.1 and as I said my index.php redirecting me to clientarea.php

dionysius commented 7 years ago

This seems to be pretty difficult to change. While I admit it would be nice not to depend on index.php, because often you have your own primary page.

To do further stuff in clientarea.php, it requires to be already logged in, which this oath module prevents in the first place (ignore the versions mismatch, the workflow is rarely changed significantly):

https://github.com/tje3d/WHMCS-FULL-DECODED-NULLED/blob/master/clientarea.php#L38

Login forced before anything useful can be done with "action" and other params.

https://github.com/tje3d/WHMCS-FULL-DECODED-NULLED/blob/master/includes/classes/class.clientarea.php#L122

whatever way it goes within the login process, it exits hard.

One workaround, without changing this code, is not redirecting the URL /index.php?m=oath, so if you use apache with mod rewrite (no warranty for typos):

RewriteCond %{QUERY_STRING} !^m=oath$
RewriteCond %{REQUEST_URI} ^/index.php$
RewriteRule ^ clientarea.php [R=301, NC, L]

(the idea is to ignore the redirect when m=oath is in the query string)

A real solution would be either

I would really like the last solution also because its like melted into their existing system. But this requires a complete rewrite and we would directly compete a paid solution of the creators in an unwanted manner...

any way, I'll investigate deeper into the first two second option.

Edit: first option completely falls, no alternative there.

dionysius commented 7 years ago

the other options are not suitable, there's no other solution than whitelisting the rewrite