Commit 637bab3e authored by Till Brehm's avatar Till Brehm

Cleaned up FAQ module files to use global auth function instead of repeating the code in each file.

parent 96b7d78d
......@@ -9,10 +9,7 @@ require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php';
// Check module permissions
if(!stristr($_SESSION['s']['user']['modules'], 'help')) {
header('Location: ../index.php');
die;
}
$app->auth->check_module_permissions('admin');
// Load the form
$app->uses('tform_actions');
......
......@@ -8,10 +8,7 @@ require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php';
// Check the module permissions and redirect if not allowed.
if(!stristr($_SESSION['s']['user']['modules'], 'help')) {
header('Location: ../index.php');
die;
}
$app->auth->check_module_permissions('admin');
// Load the templating and form classes
$app->uses('tpl,tform,tform_actions');
......
......@@ -7,10 +7,7 @@ require_once '../../lib/app.inc.php';
$list_def_file = 'list/faq_list.php';
// Check the module permissions
if(!stristr($_SESSION['s']['user']['modules'], 'help')) {
header('Location: ../index.php');
die();
}
$app->auth->check_module_permissions('help');
// Loading the class
$app->uses('listform_actions');
......@@ -31,7 +28,7 @@ $app->listform_actions->SQLExtWhere = "help_faq.hf_section = $hf_section";
if($hf_section) $res = $app->db->queryOneRecord("SELECT hfs_name FROM help_faq_sections WHERE hfs_id=?", $hf_section);
// Start the form rendering and action ahndling
echo "<h2>FAQ: ".$res['hfs_name']."</h2>";
echo "<h2>FAQ: ".$app->functions->htmlentities($res['hfs_name'])."</h2>";
if($hf_section) $app->listform_actions->onLoad();
?>
......@@ -6,7 +6,7 @@ require_once '../../lib/app.inc.php';
$list_def_file = "list/faq_manage_questions_list.php";
//* Check permissions for module
$app->auth->check_module_permissions('help');
$app->auth->check_module_permissions('admin');
//* Loading the class
$app->uses('listform_actions');
......
......@@ -9,10 +9,7 @@ require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php';
// Check module permissions
if(!stristr($_SESSION['s']['user']['modules'], 'help')) {
header('Location: ../index.php');
die;
}
$app->auth->check_module_permissions('admin');
// Load the form
$app->uses('tform_actions');
......
......@@ -8,10 +8,7 @@ require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php';
// Check the module permissions and redirect if not allowed.
if(!stristr($_SESSION['s']['user']['modules'], 'help')) {
header('Location: ../index.php');
die;
}
$app->auth->check_module_permissions('admin');
// Load the templating and form classes
$app->uses('tpl,tform,tform_actions');
......
......@@ -7,10 +7,7 @@ require_once '../../lib/app.inc.php';
$list_def_file = 'list/faq_sections_list.php';
// Check the module permissions
if(!stristr($_SESSION['s']['user']['modules'], 'help')) {
header('Location: ../index.php');
die();
}
$app->auth->check_module_permissions('admin');
// Loading the class
$app->uses('listform_actions');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment