summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2011-11-05 16:55:06 +0000
committerfisharebest <fisharebest@gmail.com>2011-11-05 16:55:06 +0000
commit3fdce2e64eb36b26314f468a99a57aa1b1003a96 (patch)
treecc154b80c435dd12e2211bc112e1b6a2bb275d4b
parent7452dab65ef04fb573d7a4c21a97d8828990dd75 (diff)
downloadwebtrees-3fdce2e64eb36b26314f468a99a57aa1b1003a96.tar.gz
webtrees-3fdce2e64eb36b26314f468a99a57aa1b1003a96.tar.bz2
webtrees-3fdce2e64eb36b26314f468a99a57aa1b1003a96.zip
Use new $controller API to check access levels
-rw-r--r--admin_trees_config.php9
-rw-r--r--gedcheck.php7
-rw-r--r--library/WT/Controller/Base.php2
3 files changed, 6 insertions, 12 deletions
diff --git a/admin_trees_config.php b/admin_trees_config.php
index 4065bc232d..a4d4dc1ea5 100644
--- a/admin_trees_config.php
+++ b/admin_trees_config.php
@@ -26,16 +26,13 @@
define('WT_SCRIPT_NAME', 'admin_trees_config.php');
require './includes/session.php';
-require WT_ROOT.'includes/functions/functions_edit.php';
-
-if (!WT_USER_GEDCOM_ADMIN) {
- header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.'admin.php');
- exit;
-}
$controller=new WT_Controller_Base();
+$controller->requireManagerLogin();
$controller->setPageTitle(WT_I18N::translate('Family tree configuration'));
+require WT_ROOT.'includes/functions/functions_edit.php';
+
/**
* find the name of the first GEDCOM file in a zipfile
* @param string $zipfile the path and filename
diff --git a/gedcheck.php b/gedcheck.php
index 92a6c8e0bd..550ec7acd1 100644
--- a/gedcheck.php
+++ b/gedcheck.php
@@ -27,13 +27,8 @@
define('WT_SCRIPT_NAME', 'gedcheck.php');
require './includes/session.php';
-// Must be an admin user to use this module
-if (!WT_USER_GEDCOM_ADMIN) {
- header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.'login.php?url='.WT_SCRIPT_NAME);
- exit;
-}
-
$controller=new WT_Controller_Base();
+$controller->requireManagerLogin();
$controller->setPageTitle('GEDCOM checker').' - '.$GEDCOM);
$controller->pageHeader();
diff --git a/library/WT/Controller/Base.php b/library/WT/Controller/Base.php
index afbfe809fb..729692877f 100644
--- a/library/WT/Controller/Base.php
+++ b/library/WT/Controller/Base.php
@@ -113,6 +113,8 @@ class WT_Controller_Base {
}
// Make a list of inline JavaScript, so we can render them in the footer
+ // NOTE: there is no need to use document.ready(), etc. as the JS won't be
+ // inserted until the very end of the page.
public function addInlineJavaScript($script, $priority=self::JS_PRIORITY_NORMAL) {
if (WT_DEBUG) {
/* Show where the JS was added */