Git Product home page Git Product logo

Comments (10)

ceeram avatar ceeram commented on May 18, 2024

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

from forum.

milesj avatar milesj commented on May 18, 2024

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?

from forum.

milesj avatar milesj commented on May 18, 2024

Is this still relevant?

from forum.

milesj avatar milesj commented on May 18, 2024

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

from forum.

Gevie avatar Gevie commented on May 18, 2024

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.

from forum.

milesj avatar milesj commented on May 18, 2024

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

from forum.

Gevie avatar Gevie commented on May 18, 2024

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.

from forum.

milesj avatar milesj commented on May 18, 2024

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

from forum.

milesj avatar milesj commented on May 18, 2024

I switched the logic around, can you try this?

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

from forum.

milesj avatar milesj commented on May 18, 2024

Is this still an issue?

from forum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.