本文整理汇总了PHP中admin_authenticate函数的典型用法代码示例。如果您正苦于以下问题:PHP admin_authenticate函数的具体用法?PHP admin_authenticate怎么用?PHP admin_authenticate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了admin_authenticate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
<?php
if (!defined('AT_INCLUDE_PATH')) { exit; }
if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }
define('AT_ADMIN_PRIV_MODULES', $this->getAdminPrivilege());
//admin pages
if (admin_authenticate(AT_ADMIN_PRIV_MODULES, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {
$this->_pages[AT_NAV_ADMIN] = array('mods/_core/modules/index.php');
$this->_pages['mods/_core/modules/index.php']['parent'] = AT_NAV_ADMIN;
$this->_pages['mods/_core/modules/index.php']['title_var'] = 'modules';
$this->_pages['mods/_core/modules/index.php']['guide'] = 'admin/?p=modules.php';
$this->_pages['mods/_core/modules/index.php']['children'] = array('mods/_core/modules/install_modules.php');
$this->_pages['mods/_core/modules/details.php']['title_var'] = 'details';
$this->_pages['mods/_core/modules/details.php']['parent'] = 'mods/_core/modules/index.php';
$this->_pages['mods/_core/modules/module_uninstall_step_1.php']['title_var'] = 'module_uninstall';
$this->_pages['mods/_core/modules/module_uninstall_step_1.php']['parent'] = 'mods/_core/modules/index.php';
$this->_pages['mods/_core/modules/module_uninstall_step_1.php']['avail_in_mobile'] = false;
$this->_pages['mods/_core/modules/module_uninstall_step_2.php']['title_var'] = 'module_uninstall';
$this->_pages['mods/_core/modules/module_uninstall_step_2.php']['parent'] = 'mods/_core/modules/index.php';
$this->_pages['mods/_core/modules/module_uninstall_step_2.php']['avail_in_mobile'] = false;
$this->_pages['mods/_core/modules/module_uninstall_step_3.php']['title_var'] = 'module_uninstall';
$this->_pages['mods/_core/modules/module_uninstall_step_3.php']['parent'] = 'mods/_core/modules/index.php';
$this->_pages['mods/_core/modules/module_uninstall_step_3.php']['avail_in_mobile'] = false;
示例2: define
<?php
/************************************************************************/
/* ATutor */
/************************************************************************/
/* Copyright (c) 2002-2010 */
/* Inclusive Design Institute */
/* http://atutor.ca */
/* This program is free software. You can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/************************************************************************/
// $Id$ $
define('AT_INCLUDE_PATH', '../../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
admin_authenticate(AT_ADMIN_PRIV_ADMIN);
if (isset($_POST['cancel'])) {
$msg->addFeedback('CANCELLED');
header('Location: courses.php');
exit;
}
if (isset($_POST['submit'])) {
$side_menu = '';
$_stack_names = array();
foreach ($_stacks as $name => $file) {
$_stack_names[] = $name;
}
$_POST['stack'] = array_unique($_POST['stack']);
$_POST['stack'] = array_intersect($_POST['stack'], $_stack_names);
foreach ($_POST['stack'] as $dropdown) {
if ($dropdown != '') {
示例3: explode
<?php
}
?>
</ul>
</div>
</div>
<div class="logoutbar">
<div id="userlinks">
<?php
if (isset($_SESSION['valid_user']) && $_SESSION['valid_user']) {
?>
<?php
$path_parts = explode("/", $this->current_top_level_page);
$last_path_part = $path_parts[sizeof($path_parts) - 1];
if (!admin_authenticate(AT_ADMIN_PRIV_ADMIN, AT_PRIV_RETURN) && $last_path_part != 'preferences.php') {
?>
<a href="" class="pref_wiz_launcher"><img alt="<?php
echo _AT('preferences') . ' - ' . _AT('new_window');
?>
" title="<?php
echo _AT('preferences') . ' - ' . _AT('new_window');
?>
" src="<?php
echo $this->img;
?>
wand.png" class="img1616" style="margin-bottom:-.5em;"/></a> |
<?php
}
?>
示例4: define
/****************************************************************************/
/* ATutor */
/****************************************************************************/
/* Copyright (c) 2002-2010 */
/* Inclusive Design Institute */
/* http://atutor.ca */
/* */
/* This program is free software. You can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/****************************************************************************/
// $Id$
define('AT_INCLUDE_PATH', '../../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
require AT_INCLUDE_PATH . '../mods/_core/themes/lib/themes.inc.php';
admin_authenticate(AT_ADMIN_PRIV_CATEGORIES);
require AT_INCLUDE_PATH . '../mods/_core/cats_categories/lib/admin_categories.inc.php';
if (isset($_POST['submit'])) {
/* insert or update a category */
$cat_id = intval($_POST['cat_id']);
$cat_parent_id = intval($_POST['cat_parent_id']);
$cat_name = trim($_POST['cat_name']);
$cat_name = $addslashes($cat_name);
$cat_theme = $addslashes($_POST['cat_theme']);
if ($cat_name == '') {
$msg->addError(array('EMPTY_FIELDS', _AT('title')));
}
$cat_name = validate_length($cat_name, 100);
if ($_POST['theme_parent']) {
$sql = "SELECT theme FROM " . TABLE_PREFIX . "course_cats WHERE cat_id={$cat_parent_id}";
$result = mysql_query($sql, $db);
示例5: define
/* Inclusive Design Institute */
/* http://atutor.ca */
/* */
/* This program is free software. You can redistribute it and/or*/
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/****************************************************************/
// $Id$
$_user_location = 'admin';
define('AT_INCLUDE_PATH', '../../../include/');
require(AT_INCLUDE_PATH.'vitals.inc.php');
require(AT_INCLUDE_PATH.'../mods/_core/themes/lib/themes.inc.php');
admin_authenticate(AT_ADMIN_PRIV_THEMES);
$theme = $addslashes($_GET['theme_dir']);
$version = $addslashes($_GET[$theme.'_version']);
if (isset($_GET['export'], $_GET['theme_dir'])) {
export_theme($theme);
} else if (isset($_GET['delete'], $_GET['theme_dir'])) {
header('Location: delete.php?theme_code='.urlencode($theme));
exit;
} else if (isset($_GET['default'], $_GET['theme_dir'])) {
set_theme_as_default($theme, $_GET['type']);
$_config['pref_defaults'] = unserialize($_config['pref_defaults']);
if ($_GET['type']==MOBILE_DEVICE) {
$_config['pref_defaults']['PREF_MOBILE_THEME'] = $theme;
} else {
示例6: define
<?php
/****************************************************************/
/* ATutor */
/****************************************************************/
/* Copyright (c) 2002-2010 */
/* Inclusive Design Institute */
/* http://atutor.ca */
/* */
/* This program is free software. You can redistribute it and/or*/
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/****************************************************************/
// $Id$
define('AT_INCLUDE_PATH', '../../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
admin_authenticate(AT_ADMIN_PRIV_ENROLLMENT);
$course_id = intval($_REQUEST['course_id']);
require AT_INCLUDE_PATH . '../mods/_core/enrolment/html/privileges.inc.php';
exit;
示例7: url_rewrite
/**
* If pretty URL within admin config is switched on. We will apply pretty URL
* to all the links in ATutor. This function will authenticate itself towards the current pages.
* In our definition, admins, login, registration pages shouldn't have pretty url applied. However,
* if one want to use url_rewrite on these pages, please force it by using the third parameter.
* Note: If system config has turned off this feature, $force will have no effect.
* @param string the Url should be a relative link, have to improve this later on, to check if
* it's a relative link, if not, truncate it.
* @param boolean Available values are AT_PRETTY_URL_IS_HEADER, AT_PRETTY_URL_NOT_HEADER(default)
* use AT_PRETTY_URL_IS_HEADER if url_rewrite is used in php header('Location:..'), absolute path is needed for this.
* @param boolean true to force the url_rewrite, false otheriwse. False is the default.
* @author Harris Wong
*/
function url_rewrite($url, $is_rewriting_header = AT_PRETTY_URL_NOT_HEADER, $force = false)
{
global $_config, $db;
$url_parser = new UrlParser();
$pathinfo = $url_parser->getPathArray();
/* If this is any kind of admins, don't prettify the url
* $_SESSION['is_guest'] is used to check against login/register/browse page, the links on this page will
* only be prettified when a user has logged in.
* Had used $_SESSION[valid_user] before but it created this problem:
* http://www.atutor.ca/atutor/mantis/view.php?id=3426
*/
if ($force || isset($_SESSION['course_id']) && $_SESSION['course_id'] > 0) {
//if course id is defined, apply pretty url.
} else {
if (admin_authenticate(AT_ADMIN_PRIV_ADMIN, AT_PRIV_RETURN) || isset($_SESSION['privileges']) && admin_authenticate($_SESSION['privileges'], AT_PRIV_RETURN) || isset($_SESSION['is_guest']) && $_SESSION['is_guest'] == 1) {
return $url;
}
}
//if we allow pretty url in the system
if ($_config['pretty_url'] > 0) {
$course_id = 0;
//If we allow course dir name from sys perf
if ($_config['course_dir_name'] > 0) {
if (preg_match('/bounce.php\\?course=([\\d]+)$/', $url, $matches) == 1) {
// bounce has the highest priority, even if session is set, work on
// bounce first.
$course_id = $url_parser->getCourseDirName($matches[1]);
} elseif (isset($_REQUEST['course'])) {
//jump menu
$course_id = $url_parser->getCourseDirName($_REQUEST['course']);
} elseif (isset($_REQUEST['p_course'])) {
// is set when guests access public course. @see bounce.php
$course_id = $url_parser->getCourseDirName($_REQUEST['p_course']);
} elseif (isset($_SESSION['course_id']) && $_SESSION['course_id'] > 0) {
$course_id = $url_parser->getCourseDirName($_SESSION['course_id']);
}
} else {
if (isset($_SESSION['course_id'])) {
$course_id = $_SESSION['course_id'];
}
}
$url = $pathinfo[1]->convertToPrettyUrl($course_id, $url);
} elseif ($_config['course_dir_name'] > 0) {
//enabled course directory name, disabled pretty url
if (preg_match('/bounce.php\\?course=([\\d]+)$/', $url, $matches) == 1) {
// bounce has the highest priority, even if session is set, work on
// bounce first.
$course_id = $url_parser->getCourseDirName($matches[1]);
} elseif (isset($_REQUEST['course'])) {
$course_id = $url_parser->getCourseDirName($_REQUEST['course']);
} elseif (isset($_REQUEST['p_course'])) {
// is set when guests access public course. @see bounce.php
$course_id = $url_parser->getCourseDirName($_REQUEST['p_course']);
} elseif (isset($_SESSION['course_id']) && $_SESSION['course_id'] > 0) {
$course_id = $url_parser->getCourseDirName($_SESSION['course_id']);
}
$url = $pathinfo[1]->convertToPrettyUrl($course_id, $url);
}
//instead of putting AT_BASE_HREF in all the headers location, we will put it here.
//Abs paths are required for pretty url because otherwise the url location will be appeneded.
//ie. ATutor_161/blogs/CoURSe_rOAd/blogs/view.php/ot/1/oid/1/ instead of
// ATutor_161/CoURSe_rOAd/blogs/view.php/ot/1/oid/1/
if ($is_rewriting_header == true) {
return AT_BASE_HREF . $url;
}
return $url;
}
示例8: array
// ** possible alternative: **
// $this->addStack('social', array('title_var' => 'social', 'file' => './side_menu.inc.php');
/*******
* if this module is to be made available to students on the Home or Main Navigation.
*/
$_group_tool = $_student_tool = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;
$this->_list['social'] = array('title_var'=>'social','file'=>'mods/_standard/social/sublinks.php');
$this->_pages[AT_SOCIAL_BASENAME.'index.php']['icon'] = 'images/home-directory_sm.png';
/*******
* add the admin pages when needed.
*/
if (admin_authenticate(AT_ADMIN_PRIV_SOCIAL, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {
//$this->_pages[AT_NAV_ADMIN] = array('mods/_standard/social/index_admin.php');
$this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['title_var'] = 'social';
$this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['parent'] = 'admin/config_edit.php';
$this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['children'] = array(AT_SOCIAL_BASENAME.'admin/delete_applications.php');
$this->_pages[AT_SOCIAL_BASENAME.'admin/delete_applications.php']['title_var'] = 'delete_applications';
$this->_pages[AT_SOCIAL_BASENAME.'admin/delete_applications.php']['parent'] = AT_SOCIAL_BASENAME.'index_admin.php';
}
/*******
* instructor Manage section:
*/
//$this->_pages[AT_SOCIAL_BASENAME.'index_instructor.php']['title_var'] = 'social';
//$this->_pages[AT_SOCIAL_BASENAME.'index_instructor.php']['parent'] = 'tools/index.php';
示例9: exit
<?php
if (!defined('AT_INCLUDE_PATH')) {
exit;
}
if (!isset($this) || isset($this) && strtolower(get_class($this)) != 'module') {
exit(__FILE__ . ' is not a Module');
}
define('AT_PRIV_ENROLLMENT', $this->getPrivilege());
define('AT_ADMIN_PRIV_ENROLLMENT', $this->getAdminPrivilege());
$this->_stacks['users_online'] = array('title_var' => 'users_online', 'file' => AT_INCLUDE_PATH . 'html/dropdowns/users_online.inc.php');
if (admin_authenticate(AT_ADMIN_PRIV_ENROLLMENT, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {
//$this->_pages[AT_NAV_ADMIN] = array('mods/_core/enrolment/admin/index.php');
$this->_pages['mods/_core/enrolment/admin/index.php']['parent'] = 'mods/_core/courses/admin/courses.php';
$this->_pages['mods/_core/enrolment/admin/index.php']['title_var'] = 'enrollment';
$this->_pages['mods/_core/enrolment/admin/index.php']['parent'] = 'mods/_core/courses/admin/courses.php';
$this->_pages['mods/_core/enrolment/admin/index.php']['guide'] = 'admin/?p=enrollment.php';
$this->_pages['mods/_core/enrolment/admin/enroll_edit.php']['title_var'] = 'enrollment';
$this->_pages['mods/_core/enrolment/admin/enroll_edit.php']['parent'] = 'mods/_core/enrolment/admin/index.php';
$this->_pages['mods/_core/enrolment/admin/privileges.php']['title_var'] = 'privileges';
$this->_pages['mods/_core/enrolment/admin/privileges.php']['parent'] = 'mods/_core/enrolment/admin/index.php';
$this->_pages['mods/_core/enrolment/admin/privileges.php']['guide'] = 'admin/?p=enrollment_privileges.php';
$this->_pages['mods/_core/enrolment/admin/privileges.php']['avail_in_mobile'] = false;
// linked from users.php
$this->_pages['admin/user_enrollment.php']['title_var'] = 'enrollment';
$this->_pages['admin/user_enrollment.php']['parent'] = 'admin/users.php';
}
$this->_pages['mods/_core/enrolment/index.php']['title_var'] = 'enrollment';
$this->_pages['mods/_core/enrolment/index.php']['parent'] = 'tools/index.php';
$this->_pages['mods/_core/enrolment/index.php']['guide'] = 'instructor/?p=enrollment.php';
$this->_pages['mods/_core/enrolment/index.php']['children'] = array('mods/_core/enrolment/export_course_list.php', 'mods/_core/enrolment/import_course_list.php', 'mods/_core/enrolment/create_course_list.php');
示例10: define
* and feedback messages, respectively. Why use "_c" as the prefix?
* because it comes before "_t" and _m" in the alphabet. This lets us
* sort the language by `variable` and limit it to one result. That is
* how the custom language terms are retrieved in place of default
* language.
*
* another oddity is that although custom language text isn't deleted
* upon upgrades, the language definitions are, which means those terms
* cannot be edited until after the language pack is reinstalled.
* this also means that if a term has changed the system might be unaware
* of new replacement tokens and could break.
*
*/
define('AT_INCLUDE_PATH', '../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
admin_authenticate(AT_ADMIN_PRIV_LANGUAGES);
if (defined('AT_DEVEL_TRANSLATE') && AT_DEVEL_TRANSLATE) {
$msg->addWarning('TRANSLATE_ON');
require AT_INCLUDE_PATH . 'header.inc.php';
require AT_INCLUDE_PATH . 'footer.inc.php';
exit;
}
require AT_INCLUDE_PATH . 'header.inc.php';
$_variables = array('template' => '_template', 'feedback' => '_msgs');
$_c_variables = array('template' => '_c_template', 'feedback' => '_c_msgs');
$sql_search = '';
if (isset($_GET['filter'], $_GET['search'])) {
$_GET['search'] = trim($addslashes($_GET['search']));
$words = explode(' ', $_GET['search']);
foreach ($words as $key => $word) {
// search `term` and `text` only
示例11: _AT
<tfoot>
<tr>
<td colspan="<?php
echo 9 + $col_counts;
?>
">
<input type="submit" name="edit" value="<?php
echo _AT('edit');
?>
" />
<input type="submit" name="password" value="<?php
echo _AT('password');
?>
" />
<?php
if (admin_authenticate(AT_ADMIN_PRIV_ENROLLMENT, true)) {
?>
<input type="submit" name="enrollment" value="<?php
echo _AT('enrollment');
?>
" />
<?php
}
?>
<label for="change_status"><?php
echo _AT('more_options');
?>
</label>
<select name="change_status" id="change_status">
<!-- REMOVED FOR MOBILE <option value="-2"><?php
示例12: exit
if (!defined('AT_INCLUDE_PATH')) {
exit;
}
if (!isset($this) || isset($this) && strtolower(get_class($this)) != 'module') {
exit(__FILE__ . ' is not a Module');
}
if (!defined('AT_PRIV_ADMIN')) {
define('AT_PRIV_ADMIN', $this->getPrivilege());
}
if (!defined('AT_ADMIN_PRIV_COURSES')) {
define('AT_ADMIN_PRIV_COURSES', $this->getAdminPrivilege());
}
global $_config, $db;
// for admin
if (admin_authenticate(AT_ADMIN_PRIV_COURSES, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {
//$sql = "SELECT * from ".TABLE_PREFIX."modules WHERE dir_name = '_core/services' && status ='2'";
$sql = "SELECT * from %smodules WHERE dir_name = '_core/services' && status ='2'";
$result = queryDB($sql, array(TABLE_PREFIX), TRUE);
if (count($result) > 0) {
$service_installed = count($result);
}
$this->_pages[AT_NAV_ADMIN] = array('mods/_core/courses/admin/courses.php');
$this->_pages['mods/_core/courses/admin/courses.php']['title_var'] = 'courses';
$this->_pages['mods/_core/courses/admin/courses.php']['parent'] = AT_NAV_ADMIN;
$this->_pages['mods/_core/courses/admin/courses.php']['guide'] = 'admin/?p=courses.php';
if (!$service_installed) {
$this->_pages['mods/_core/courses/admin/courses.php']['children'] = array('mods/_core/enrolment/admin/index.php', 'mods/_core/courses/admin/default_mods.php', 'mods/_core/courses/admin/default_side.php', 'mods/_core/courses/admin/auto_enroll.php', 'mods/_core/courses/admin/create_course.php');
} else {
$this->_pages['mods/_core/courses/admin/courses.php']['children'] = array('mods/_core/enrolment/admin/index.php', 'mods/_core/courses/admin/default_mods.php', 'mods/_core/courses/admin/default_side.php', 'mods/_core/courses/admin/auto_enroll.php');
}
示例13: define
<?php
/****************************************************************/
/* BigBlueButton module for ATutor */
/* https://github.com/nishant1000/BigBlueButton-module-for-ATutor*/
/* */
/* This module allows to search OpenLearn for educational */
/* content. */
/* Author: Nishant Kumar */
/* This program is free software. You can redistribute it and/or*/
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/****************************************************************/
// $Id$
define('AT_INCLUDE_PATH', '../../include/');
require (AT_INCLUDE_PATH.'vitals.inc.php');
admin_authenticate(AT_ADMIN_PRIV_BIGBLUEBUTTON);
require (AT_INCLUDE_PATH.'header.inc.php');
global $_base_href;
?>
<h3><?php echo _AT('bbb_admin_setup'); ?> </h3><br />
<div class="input-form" style="padding:.5em;">
<p><?php echo _AT('bbb_config_text'); ?></p>
<form name="form" action="<?php echo $_base_href; ?>mods/bigbluebutton/change_admin.php" method="post">
<label for="url"><?php echo _AT('bbb_url'); ?></label><br />
<input type="text" name="bbb_url" id="url" class="input" maxlength="60" size="40" value="<?php echo $_config['bbb_url'] ?>" /><br />
<label for="url"><?php echo _AT('bbb_salt'); ?></label><br />
示例14: exit
*/
if (!isset($this) || isset($this) && strtolower(get_class($this)) != 'module') {
exit(__FILE__ . ' is not a Module');
}
if (defined('IS_SUBSITE') && IS_SUBSITE) {
return;
}
/*******
* assign the instructor and admin privileges to the constants.
*/
define('AT_PRIV_PATCHER', $this->getPrivilege());
define('AT_ADMIN_PRIV_PATCHER', $this->getAdminPrivilege());
/*******
* add the admin pages when needed.
*/
if (admin_authenticate(AT_ADMIN_PRIV_PATCHER, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {
$this->_pages[AT_NAV_ADMIN] = array('mods/_standard/patcher/index_admin.php');
$this->_pages['mods/_standard/patcher/index_admin.php']['title_var'] = 'patcher';
$this->_pages['mods/_standard/patcher/index_admin.php']['parent'] = AT_NAV_ADMIN;
$this->_pages['mods/_standard/patcher/index_admin.php']['avail_in_mobile'] = false;
$this->_pages['mods/_standard/patcher/index_admin.php']['children'] = array('mods/_standard/patcher/myown_patches.php', 'mods/_standard/patcher/patch_create.php');
$this->_pages['mods/_standard/patcher/myown_patches.php']['title_var'] = 'myown_patches';
$this->_pages['mods/_standard/patcher/myown_patches.php']['parent'] = 'mods/_standard/patcher/index_admin.php';
$this->_pages['mods/_standard/patcher/myown_patches.php']['children'] = array('mods/_standard/patcher/patch_create.php');
$this->_pages['mods/_standard/patcher/patch_create.php']['title_var'] = 'create_patch';
$this->_pages['mods/_standard/patcher/patch_create.php']['parent'] = 'mods/_standard/patcher/myown_patches.php';
$this->_pages['mods/_standard/patcher/patch_edit.php']['title_var'] = 'edit_patch';
$this->_pages['mods/_standard/patcher/patch_edit.php']['parent'] = 'mods/_standard/patcher/myown_patches.php';
$this->_pages['mods/_standard/patcher/patch_delete.php']['title_var'] = 'delete_patch';
$this->_pages['mods/_standard/patcher/patch_delete.php']['parent'] = 'mods/_standard/patcher/myown_patches.php';
}
示例15: define
<?php
define('AT_INCLUDE_PATH', '../../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
admin_authenticate(AT_ADMIN_PRIV_BASICLTI);
require_once 'forms.php';
if ($_POST['submit']) {
// filter all POST data
$_POST['form_basiclti'] = $addslashes($_POST['form_basiclti']);
$_POST['title'] = $addslashes($_POST['title']);
$_POST['toolid'] = $addslashes($_POST['toolid']);
$_POST['description'] = $addslashes($_POST['description']);
$_POST['toolurl'] = $addslashes($_POST['toolurl']);
$_POST['resourcekey'] = $addslashes($_POST['resourcekey']);
$_POST['password'] = $addslashes($_POST['password']);
$_POST['preferheight'] = intval($_POST['preferheight']);
$_POST['allowpreferheight'] = intval($_POST['allowpreferheight']);
$_POST['launchinpopup'] = intval($_POST['launchinpopup']);
$_POST['debuglaunch'] = intval($_POST['debuglaunch']);
$_POST['sendname'] = intval($_POST['sendname']);
$_POST['sendemailaddr'] = intval($_POST['sendemailaddr']);
$_POST['acceptgrades'] = intval($_POST['acceptgrades']);
$_POST['allowroster'] = intval($_POST['allowroster']);
$_POST['allowsetting'] = intval($_POST['allowsetting']);
$_POST['allowcustomparameters'] = intval($_POST['allowcustomparameters']);
$_POST['customparameters'] = str_replace('\\r\\n', "\r\n", $addslashes($_POST['customparameters']));
$_POST['organizationid'] = $addslashes($_POST['organizationid']);
$_POST['organizationurl'] = $addslashes($_POST['organizationurl']);
// $_POST['organizationdescr'] = $addslashes($_POST['organizationdescr']);
$_POST['submit'] = $addslashes($_POST['submit']);
}