-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apps: Fix URL navigation issues when using a plugin app
- Loading branch information
Jared Hancock
committed
Dec 18, 2015
1 parent
f665f9d
commit 259d3a8
Showing
6 changed files
with
42 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,27 +14,32 @@ | |
vim: expandtab sw=4 ts=4 sts=4: | ||
**********************************************************************/ | ||
# Override staffLoginPage() defined in staff.inc.php to return an | ||
# HTTP/Forbidden status rather than the actual login page. | ||
# XXX: This should be moved to the AjaxController class | ||
function staffLoginPage($msg='Unauthorized') { | ||
Http::response(403,'Must login: '.Format::htmlchars($msg)); | ||
exit; | ||
} | ||
if (basename($_SERVER['SCRIPT_NAME'])==basename(__FILE__)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
bengearig
|
||
die('Access denied'); //Say hi to our friend.. | ||
|
||
require('staff.inc.php'); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
//Clean house...don't let the world see your crap. | ||
ini_set('display_errors','0'); //Disable error display | ||
ini_set('display_startup_errors','0'); | ||
#ini_set('display_errors','0'); //Disable error display | ||
#ini_set('display_startup_errors','0'); | ||
|
||
//TODO: disable direct access via the browser? i,e All request must have REFER? | ||
if(!defined('INCLUDE_DIR')) Http::response(500, 'Server configuration error'); | ||
|
||
require_once INCLUDE_DIR.'/class.dispatcher.php'; | ||
$dispatcher = new Dispatcher(); | ||
|
||
Signal::send('apps.scp', $dispatcher); | ||
$PI = $ost->get_path_info(); | ||
if (strpos(strtolower($PI), '/admin/') === 0) { | ||
require('admin.inc.php'); | ||
$PI = substr($PI, 6); | ||
Signal::send('apps.admin', $dispatcher); | ||
} | ||
else { | ||
Signal::send('apps.scp', $dispatcher); | ||
} | ||
|
||
$nav->setActiveTab('apps'); | ||
|
||
# Call the respective function | ||
print $dispatcher->resolve($ost->get_path_info()); | ||
print $dispatcher->resolve($PI); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This actually breaks all navigation from Applications menu. If a plugin registers staff app with a url of 'apps/myawesomeplugin', Clicking on the link will always result into Access Denied