Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

admin panel is never shown #17

Closed
rightawayai opened this issue Jan 5, 2012 · 10 comments
Closed

admin panel is never shown #17

rightawayai opened this issue Jan 5, 2012 · 10 comments

Comments

@rightawayai
Copy link

I have integrated this plugin with my existing cakephp 1.3 application,

there's only single user with user_id and /forum/users/profile/2 shows it as administrator but when I do /admin/forum it gets redirected to my main application

I followed all the installation steps correctly

I am using WAMP server version 2.2

earlier login issues got fixed with 2.3 version of the forum

@ceeram
Copy link
Contributor

ceeram commented Jan 5, 2012

Do you have admin routing enabled?

Edit: seems as the Session doesnt have the correct value for "Forum.isAdmin"
Make sure you have $this->Session->delete('Forum'); in your login action, and have Auth->autoRedirect = false in your Users/AppController

@milesj
Copy link
Owner

milesj commented Jan 5, 2012

The verifyAdmin() method either redirects to the last page you were on, or the login page. Seems like something else is going on?

https://github.com/milesj/cake-forum/blob/master/controllers/components/toolbar.php#L278

Can you debug the session and make sure Forum.isAdmin is true?

@milesj
Copy link
Owner

milesj commented Jan 11, 2012

Is this still relevant?

@milesj
Copy link
Owner

milesj commented Jan 19, 2012

Going to close this. If the problem persists, I would debug around a bit as no one else can reproduce this.

@milesj milesj closed this as completed Jan 19, 2012
@Gevie
Copy link

Gevie commented Oct 19, 2012

Had the same issue as 100marks (EasyPHP 5.3.9) on Forum v3.2.0 RC3

The issue was here: https://github.com/milesj/cake-forum/blob/master/Controller/Component/ForumToolbarComponent.php#L76

The following change fixed my issue (!==, not !=)
if ($user_id && $this->Controller->Auth->user($this->config['userMap']['status']) !== $this->config['statusMap']['banned']) {

Hope this helps anybody else with this rare problem.

@milesj
Copy link
Owner

milesj commented Oct 19, 2012

!== seems like it would cause more problems, simply because '1' would not equal 1.

@Gevie
Copy link

Gevie commented Oct 22, 2012

I agree, I should probably specify this is a localhost change for me only, I expect != will work on production and it's likely an issue with my EasyPHP 5.3.9

Despite $this->config['userMap']['status'] being '1' and $this->config['statusMap']['banned'] being '2', the above condition would not pass because it believed they were both equal, that is why !== seemed to work oddly.

For now I have made a hack to check if it's localhost then use !== otherwise use != (dirty hack :|), unless you have any other ideas Miles? PS kudos on an awesome plugin.

@milesj
Copy link
Owner

milesj commented Oct 23, 2012

I'll look into it a bit further, quite an unusual scenario.

@milesj milesj reopened this Oct 23, 2012
@milesj
Copy link
Owner

milesj commented Oct 25, 2012

I switched the logic around, can you try this?

https://github.com/milesj/cake-forum/commit/a2bd68eca960baf39e78988ef879957eeb801815

@milesj
Copy link
Owner

milesj commented Nov 7, 2012

Is this still an issue?

@milesj milesj closed this as completed Nov 10, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants