21281 Posts in 5729 Topics by 2600 members
General Questions
SilverStripe Forums » General Questions » What is if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 803 Views |
-
What is if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();

1 May 2010 at 8:03am
What is this?
if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();
It's in Controller.php, on line 78. I had to comment this out to get my site working again after it quit working for some strange reason and kept throwing an error related to that function.
-
Re: What is if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();

1 May 2010 at 9:15am
For reference, the error it throws is:
Fatal error: Call to undefined method BasicAuth::protect_site_if_necessary() in /var/www/vhosts/domain.com/subdomains/subsite/httpdocs/sapphire/core/control/Controller.php on line 78
-
Re: What is if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();

1 May 2010 at 9:37pm
Hmm strange you're using 2.4? I can see the protect_site_if_necessary() function in the BasicAuth.php file. You want to check your BasicAuth.php file to check that function is there. It may not have been updated correctly.
-
Re: What is if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();

2 May 2010 at 4:13am
I'm using 2.3.3
-
Re: What is if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();

3 May 2010 at 9:19pm
Well even my 2.3 site has this, perhaps if you updated the core before (say it was an earlier version) maybe the BasicAuth file didn't get updated.
The function which should be in BasicAuth.php looks like...
/**
* Call {@link BasicAuth::requireLogin()} if {@link BasicAuth::protect_entire_site()} has been called.
* This is a helper function used by Controller.
*/
static function protect_site_if_necessary() {
if(self::$entire_site_protected) {
self::requireLogin("SilverStripe test website. Use your CMS login.", "ADMIN");
}
}You could try (if your missing it) just putting that in the BasicAuth.php file. Also note the 2.3 branch is up to 2.3.7 so your 4 versions behind the latest security updates so if you are worried about it, your site could be compromised.
| 803 Views | ||
|
Page:
1
|
Go to Top |


