Warn when accessing a private page.

This commit is contained in:
Teromene 2017-06-15 11:51:11 +01:00
parent 18c6f0126f
commit 9c78362fd7
1 changed files with 12 additions and 3 deletions

View File

@ -80,6 +80,11 @@ class FB2Bridge extends BridgeAbstract {
if($pageID === null){
echo <<<EOD
Unable to get the page id. You should consider getting the ID by hand, then importing it into FB2Bridge
EOD;
die();
} elseif($pageID == -1) {
echo <<<EOD
This page is not accessible without being logged in.
EOD;
die();
}
@ -242,6 +247,10 @@ EOD;
$pageContent = file_get_contents($page, 0, $context);
if(strpos($pageContent, "signup-button") != false) {
return -1;
}
//Get the page ID if we don't have a captcha
$regex = "/page_id=([0-9]*)&/";
preg_match($regex, $pageContent, $matches);