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

When admin logs out and go to frontend to login as a user, login fails and it redirects to admin login page #1913

Closed
dev-101 opened this issue Sep 6, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@dev-101
Copy link
Contributor

dev-101 commented Sep 6, 2015

Hi,

Let's try this once again, this is an ongoing and very old issue still unresolved.
Admin has 2 accounts (main admin & frontend user with different email/paswd):

  1. Admin logs into admin dashboard
  2. Admin logs out, at this point its back to admin login page
  3. Clicks on top left URL/title to go to frontend
  4. Goes to frontend user's login page
  5. log in -> fails -> it gets redirected to admin login page
  6. manually return to frontend page -> nope, admin is still not logged-in (as a user with diff account).

Only way to fix this is restart browser / destroy session / delete cookie. This is confirmed (regardless of the theme) on several clean test setups and even local installation.

Most recent forum discussion here:
http://forums.osclass.org/tips-and-tricks/login-website-returns-to-admin-page-gt-fix/

dev-101 added a commit to dev-101/Osclass that referenced this issue Sep 7, 2015
all credits go to SmaRTeY (Eric)
dev-101 added a commit to dev-101/Osclass that referenced this issue Sep 7, 2015
all credits go to SmaRTeY (Eric)

PS either this file @hotfixes branch or something to do with github online, but there seems to be some tab/space indentation issue. I have set 4 spaces (default) for entire file.
@garciademarina garciademarina added this to the 3.7.0 milestone Nov 4, 2016
@garciademarina garciademarina self-assigned this Nov 21, 2016
@dev-101
Copy link
Contributor Author

dev-101 commented Nov 21, 2016

Hi Carlos,
I think we should avoid using hard-coded 'oc-admin' path (if possible).

(check earlier propositions how to extract path for idea).

Thanks

@garciademarina
Copy link
Member

oc-admin path it's already hardcoded on the core, we will continue using oc-admin as a string for this case.

garciademarina added a commit that referenced this issue Nov 24, 2016
@dev-101
Copy link
Contributor Author

dev-101 commented Nov 24, 2016

Well, I was working on experimental extension that could change that... but now you are complicating things :)

You see, there is a difference when you define something in one place,
but once it is defined, it is natural to use abstract definition of it instead the actual value (which might be changed). It is easy to get a clean path in this case with simple subtraction of 2 previously defined values.

$l = strlen(osc_base_url(false));
$p = str_replace('/', '', substr(osc_admin_base_url(false),-$l));

@garciademarina garciademarina modified the milestones: 4.0, 3.7.0 Nov 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants