Skip to content
Snippets Groups Projects
Commit 637bab3e authored by Till Brehm's avatar Till Brehm
Browse files

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

parent 96b7d78d
No related branches found
No related tags found
No related merge requests found
...@@ -9,10 +9,7 @@ require_once '../../lib/config.inc.php'; ...@@ -9,10 +9,7 @@ require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php'; require_once '../../lib/app.inc.php';
// Check module permissions // Check module permissions
if(!stristr($_SESSION['s']['user']['modules'], 'help')) { $app->auth->check_module_permissions('admin');
header('Location: ../index.php');
die;
}
// Load the form // Load the form
$app->uses('tform_actions'); $app->uses('tform_actions');
......
...@@ -8,10 +8,7 @@ require_once '../../lib/config.inc.php'; ...@@ -8,10 +8,7 @@ require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php'; require_once '../../lib/app.inc.php';
// Check the module permissions and redirect if not allowed. // Check the module permissions and redirect if not allowed.
if(!stristr($_SESSION['s']['user']['modules'], 'help')) { $app->auth->check_module_permissions('admin');
header('Location: ../index.php');
die;
}
// Load the templating and form classes // Load the templating and form classes
$app->uses('tpl,tform,tform_actions'); $app->uses('tpl,tform,tform_actions');
......
...@@ -7,10 +7,7 @@ require_once '../../lib/app.inc.php'; ...@@ -7,10 +7,7 @@ require_once '../../lib/app.inc.php';
$list_def_file = 'list/faq_list.php'; $list_def_file = 'list/faq_list.php';
// Check the module permissions // Check the module permissions
if(!stristr($_SESSION['s']['user']['modules'], 'help')) { $app->auth->check_module_permissions('help');
header('Location: ../index.php');
die();
}
// Loading the class // Loading the class
$app->uses('listform_actions'); $app->uses('listform_actions');
...@@ -31,7 +28,7 @@ $app->listform_actions->SQLExtWhere = "help_faq.hf_section = $hf_section"; ...@@ -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); 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 // 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(); if($hf_section) $app->listform_actions->onLoad();
?> ?>
...@@ -6,7 +6,7 @@ require_once '../../lib/app.inc.php'; ...@@ -6,7 +6,7 @@ require_once '../../lib/app.inc.php';
$list_def_file = "list/faq_manage_questions_list.php"; $list_def_file = "list/faq_manage_questions_list.php";
//* Check permissions for module //* Check permissions for module
$app->auth->check_module_permissions('help'); $app->auth->check_module_permissions('admin');
//* Loading the class //* Loading the class
$app->uses('listform_actions'); $app->uses('listform_actions');
......
...@@ -9,10 +9,7 @@ require_once '../../lib/config.inc.php'; ...@@ -9,10 +9,7 @@ require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php'; require_once '../../lib/app.inc.php';
// Check module permissions // Check module permissions
if(!stristr($_SESSION['s']['user']['modules'], 'help')) { $app->auth->check_module_permissions('admin');
header('Location: ../index.php');
die;
}
// Load the form // Load the form
$app->uses('tform_actions'); $app->uses('tform_actions');
......
...@@ -8,10 +8,7 @@ require_once '../../lib/config.inc.php'; ...@@ -8,10 +8,7 @@ require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php'; require_once '../../lib/app.inc.php';
// Check the module permissions and redirect if not allowed. // Check the module permissions and redirect if not allowed.
if(!stristr($_SESSION['s']['user']['modules'], 'help')) { $app->auth->check_module_permissions('admin');
header('Location: ../index.php');
die;
}
// Load the templating and form classes // Load the templating and form classes
$app->uses('tpl,tform,tform_actions'); $app->uses('tpl,tform,tform_actions');
......
...@@ -7,10 +7,7 @@ require_once '../../lib/app.inc.php'; ...@@ -7,10 +7,7 @@ require_once '../../lib/app.inc.php';
$list_def_file = 'list/faq_sections_list.php'; $list_def_file = 'list/faq_sections_list.php';
// Check the module permissions // Check the module permissions
if(!stristr($_SESSION['s']['user']['modules'], 'help')) { $app->auth->check_module_permissions('admin');
header('Location: ../index.php');
die();
}
// Loading the class // Loading the class
$app->uses('listform_actions'); $app->uses('listform_actions');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment