Jump to content

Recommended Posts

Posted

Hi there,

we all use this:

		<?php 

	// If the page is editable, then output a link that takes us straight to the page edit screen:
	if($page->editable()) {
		echo "<a class='nav' id='editpage' href='{$config->urls->admin}page/edit/?id={$page->id}'>Edit</a>"; 
	}

	?>

Unfortunately, I always see the edit link, even if I'm  logged out...

Very strange...recently I switched from test mode in a sub-domain (new.mysite.com) to production mode (www.mysite.com).

Could this be an issue?

Posted

Nope. No idea.

Is it cached? Although it wouldn't get cached when logged in. 

Any third party modules modifying Page::editable?

Posted

Have you tried:

    if($page->editable()&& $user->isLoggedin()) { // also check if the user is currently logged in
        echo "<a class='nav' id='editpage' href='{$config->urls->admin}page/edit/?id={$page->id}'>Edit</a>";
    }

to make a double check that the current user is logged in?

  • Like 1
Posted

$user->isLoggedin() shouldn't be necessary here as $page->editable() already checks for various permission etc.

So maybe do you have the guest role given page edit access? What happens if you click the link?

Well I'm waiting for a facepalm here cause it's not possible.

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...