本文整理汇总了PHP中pnRedirect函数的典型用法代码示例。如果您正苦于以下问题:PHP pnRedirect函数的具体用法?PHP pnRedirect怎么用?PHP pnRedirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pnRedirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mediashare_source_zip_view
function mediashare_source_zip_view(&$args)
{
$albumId = mediashareGetIntUrl('aid', $args, 0);
if (isset($_POST['saveButton'])) {
return mediashareSourceZipUpload($args);
}
if (isset($_POST['moreButton']) || isset($_POST['continueButton'])) {
// After upload - update items and then continue to next page
if (!mediashareSourceZipUpdate()) {
return false;
}
}
if (isset($_POST['cancelButton']) || isset($_POST['continueButton'])) {
return pnRedirect(pnModURL('mediashare', 'edit', 'view', array('aid' => $albumId)));
}
if (isset($_POST['moreButton'])) {
return pnRedirect(pnModURL('mediashare', 'edit', 'addmedia', array('aid' => $albumId, 'source' => 'zip')));
}
// FIXME Required globals??
pnModAPILoad('mediashare', 'edit');
$uploadInfo = pnModAPIFunc('mediashare', 'source_zip', 'getUploadInfo');
$render =& pnRender::getInstance('mediashare', false);
$render->assign('imageNum', 1);
$render->assign('uploadFields', array(1));
$render->assign('post_max_size', $uploadInfo['post_max_size']);
$render->assign('upload_max_filesize', $uploadInfo['upload_max_filesize']);
return $render->fetch('mediashare_source_zip_view.html');
}
示例2: mediashare_external_pasteitem
function mediashare_external_pasteitem($args)
{
// FIXME access check
$albumId = mediashareGetIntUrl('aid', $args, 0);
$mediaId = mediashareGetIntUrl('mid', $args, 0);
$mode = FormUtil::getPassedValue('mode');
if (isset($_POST['backButton'])) {
return pnRedirect(pnModUrl('mediashare', 'external', 'finditem', array('aid' => $albumId, 'mid' => $mediaId, 'mode' => $mode)));
}
$mediaItem = pnModAPIFunc('mediashare', 'user', 'getMediaItem', array('mediaId' => $mediaId));
/*
if (!($handler = pnModAPIFunc('mediashare', 'mediahandler', 'loadHandler', array('handlerName' => $mediaItem['mediaHandler'])))) {
return false;
}
*/
$render =& pnRender::getInstance('mediashare', false);
mediashareExternalLoadTheme($render);
$render->assign('albumId', $albumId);
$render->assign('mediaId', $mediaId);
$render->assign('mediaItem', $mediaItem);
if ($mediaItem['mediaHandler'] != 'extapp') {
$mediadir = pnModAPIFunc('mediashare', 'user', 'getRelativeMediadir');
$render->assign('thumbnailUrl', $mediadir . $mediaItem['thumbnailRef']);
$render->assign('previewUrl', $mediadir . $mediaItem['previewRef']);
$render->assign('originalUrl', $mediadir . $mediaItem['originalRef']);
} else {
$render->assign('thumbnailUrl', "{$mediaItem['thumbnailRef']}");
$render->assign('previewUrl', "{$mediaItem['previewRef']}");
$render->assign('originalUrl', "{$mediaItem['originalRef']}");
}
$render->assign('mode', $mode);
echo $render->fetch('mediashare_external_pasteitem.html');
return true;
}
示例3: access_user_login
function access_user_login($uname, $pass, $url, $rememberme)
{
if (pnUserLogIn($uname, $pass, $rememberme)) {
redirect_index(_LOGGINGYOU, $url);
} else {
pnRedirect('user.php?stop=1');
}
}
示例4: admin_menu
function admin_menu($help_file = '')
{
$pntable = pnDBGetTables();
list($newsubs) = db_select_one_row("SELECT count(*) FROM {$pntable['queue']}");
if (!pnSecAuthAction(0, "::", '::', ACCESS_EDIT)) {
// suppress admin display - return to index.
pnRedirect('index.php');
} else {
menu_title('admin.php', _ADMINMENU);
menu_graphic(pnConfigGetVar('admingraphic'));
if ($help_file != '') {
menu_help($help_file, _ONLINEMANUAL);
}
$mods = pnModGetAdminMods();
if ($mods == false) {
// there aren't admin modules
return;
}
foreach ($mods as $mod) {
// Hack until the new news module comes into being
// TODO - remove this at appropriate time
if ($mod['name'] == 'AddStory') {
$mod['name'] = 'Stories';
}
if (pnSecAuthAction(0, "{$mod['name']}::", '::', ACCESS_EDIT)) {
if (file_exists("modules/" . pnVarPrepForOS($mod['directory']) . "/pnadmin.php")) {
$file = "modules/" . pnVarPrepForOS($mod['directory']) . "/pnimages/admin.";
if (file_exists($file . 'gif')) {
$imgfile = $file . 'gif';
} elseif (file_exists($file . 'jpg')) {
$imgfile = $file . 'jpg';
} elseif (file_exists($file . 'png')) {
$imgfile = $file . 'png';
} else {
$imgfile = 'modules/NS-Admin/images/default.gif';
}
menu_add_option(pnVarPrepForDisplay(pnModURL($mod['name'], 'admin')), $mod['displayname'], $imgfile);
} else {
$file = "modules/" . pnVarPrepForOS($mod['directory']) . "/images/admin.";
if (file_exists($file . 'gif')) {
$imgfile = $file . 'gif';
} elseif (file_exists($file . 'jpg')) {
$imgfile = $file . 'jpg';
} elseif (file_exists($file . 'png')) {
$imgfile = $file . 'png';
} else {
$imgfile = 'modules/NS-Admin/images/default.gif';
}
menu_add_option("admin.php?module={$mod['directory']}&op=main", $mod['displayname'], $imgfile);
}
}
}
}
}
示例5: dplink_user_main
function dplink_user_main()
{
$url = trim(pnModGetVar('dplink', 'url'));
$window = pnModGetVar('dplink', 'use_window');
$wrap = pnModGetVar('dplink', 'use_postwrap');
$user_data = array();
$home = pnGetBaseURL();
$home .= 'user.php?op=loginscreen&module=NS-User';
if (!pnUserLoggedIn()) {
pnRedirect($home);
}
// We need to get the user password string from the database
$uid = pnUserGetVar('uid');
list($dbconn) = pnDBGetConn();
$pntables = pnDBGetTables();
$usertable = $pntables['users'];
$usercol =& $pntables['users_column'];
$sql = "SELECT {$usercol['uname']}, {$usercol['pass']}, {$usercol['name']}, {$usercol['email']} " . "FROM {$usertable} WHERE {$usercol['uid']} = {$uid}";
$result = $dbconn->Execute($sql);
if ($dbconn->ErrorNo() != 0) {
die('Could not get user details');
}
if ($result->EOF) {
die('Could not get user detail');
}
list($uname, $password, $user_name, $user_email) = $result->fields;
$result->Close();
$user_data['login'] = $uname;
$user_data['passwd'] = $password;
$user_data['name'] = $user_name;
$user_data['email'] = $user_email;
$parm = serialize($user_data);
$check = md5($parm);
$cparm = gzcompress($parm);
$bparm = urlencode(base64_encode($cparm));
if ($window) {
$url .= '/index.php?login=pn&userdata=' . $bparm . '&check=' . $check;
header('Location: ' . $url);
} else {
$url .= '/index.php?login=pn%26userdata=' . $bparm . '%26check=' . $check;
if ($wrap) {
header('Location: modules.php?op=modload&name=PostWrap&file=index&page=' . $url);
} else {
header('Location: modules.php?op=modload&name=dplink&file=index&url=' . $url);
}
}
exit;
}
示例6: FlashChatBridge_admin_updateconfig
/**
* Update 123FlashChat Settings
*
* @author Tree Florian
* @return mixed true if successful, false if unsuccessful, error string otherwise
*/
function FlashChatBridge_admin_updateconfig()
{
// Security check
if (!SecurityUtil::checkPermission('FlashChatBridge::', '::', ACCESS_ADMIN)) {
return LogUtil::registerPermissionError();
}
// get settings from form - do before authid check
$settings = FormUtil::getPassedValue('settings', null, 'POST');
// if this form wasnt posted to redirect back
if ($settings === NULL) {
return pnRedirect(pnModURL('Settings', 'admin', 'modifyconfig'));
}
/*
// confirm the forms auth key
if (!SecurityUtil::confirmAuthKey()) {
return LogUtil::registerAuthidError();
}
*/
$lastchar = substr($settings['client_path'], -1);
if ($lastchar != "\\" && $lastchar != "/" && $settings['client_path'] != "") {
$settings['client_path'] = $settings['client_path'] . "/";
}
$settings['server_data_path'] = str_replace("\\", "/", $settings['server_data_path']);
$lastchar = substr($settings['server_data_path'], -1);
if ($lastchar != "\\" && $lastchar != "/" && $settings['client_path'] != "") {
$settings['server_data_path'] = $settings['server_data_path'] . "/";
}
$settings['active_chat_standard'] = $settings['active_chat_standard'] == 1 ? 1 : 0;
$settings['active_chat_html'] = $settings['active_chat_html'] == 1 ? 1 : 0;
$settings['active_chat_avatar'] = $settings['active_chat_avatar'] == 1 ? 1 : 0;
$settings['active_chat_live'] = $settings['active_chat_live'] == 1 ? 1 : 0;
$settings['active_chat_pocket'] = $settings['active_chat_pocket'] == 1 ? 1 : 0;
$settings['active_chat_lite'] = $settings['active_chat_lite'] == 1 ? 1 : 0;
$settings['active_chat_banner'] = $settings['active_chat_banner'] == 1 ? 1 : 0;
// Write the vars
//$configvars = pnModGetVar('FlashChatBridge');
foreach ($settings as $key => $value) {
pnModSetVar('FlashChatBridge', $key, $value);
}
//$configvars = pnModGetVar('FlashChatBridge');
// Let any other modules know that the modules configuration has been updated
pnModCallHooks('module', 'updateconfig', 'FlashChatBridge', array('module' => 'FlashChatBridge'));
return pnRedirect(pnModURL('FlashChatBridge', 'admin', 'modifyconfig'));
}
示例7: Meds_user_search
function Meds_user_search($args)
{
// Permission check.
if (!pnSecAuthAction(0, 'Meds::', '::', ACCESS_OVERVIEW)) {
return pnVarPrepHTMLDisplay(_MODULENOAUTH);
}
// Clean any search data.
list($search, $q, $active) = pnVarCleanFromInput('search', 'q', 'active');
if (isset($q)) {
$search[trade] = $q;
$search[type] = "phrase";
}
// Get any results from the database.
$results = pnModAPIFunc('Meds', 'user', 'search_result', array('search' => $search));
$count = count($results);
if (!is_array($results)) {
$count = 0;
}
//a little written summary of what was searched for
if ($active) {
$summary = pnModFunc('Meds', 'user', 'search_summary', array('search' => $search, 'count' => $count));
}
if ($count == 1 && is_array($results) && pnSecAuthAction(0, 'Meds::', '::', ACCESS_READ)) {
pnRedirect(pnModURL('Meds', 'user', 'display', array('search' => $search, 'med_id' => $results[0]['med_id'])));
}
// Start a new output object.
$pnRender =& new pnRender('Meds');
$pnRender->caching = false;
$pnRender->assign('summary', $summary);
$pnRender->assign('search', $search);
$pnRender->assign('results', $results);
$pnRender->assign('count', $count);
$pnRender->assign(pnModAPIFunc('Meds', 'user', 'getall_selects'));
// Return search form.
return $pnRender->fetch('meds_user_search.htm');
}
示例8: switch
}
switch ($op) {
case 'modload':
define("LOADED_AS_MODULE", "1");
include_once 'includes/pnAPI.php';
if (!function_exists('pnsessionsetup')) {
pnInit();
}
include_once 'includes/legacy.php';
// eugenio themeover 20020413
// pnThemeLoad();
// Module not found error msg 08/08/00 Chris Bowler www.aquanuke.com
if (file_exists('modules/' . pnVarPrepForOS($name) . '/' . pnVarPrepForOS($file) . '.php')) {
include 'modules/' . pnVarPrepForOS($name) . '/' . pnVarPrepForOS($file) . '.php';
} else {
pnRedirect('error.php');
}
if (function_exists('session_write_close')) {
session_write_close();
} else {
// Hack for old versions of PHP with bad session save
$sessvars = '';
foreach ($GLOBALS as $k => $v) {
if (preg_match('/^PNSV/', $k) && isset($v)) {
$sessvars .= "{$k}|" . serialize($v);
}
}
pnSessionWrite(session_id(), $sessvars);
}
break;
default:
示例9: Example_admin_updateconfig
/**
* Update the configuration
*
* This is a standard function to update the configuration parameters of the
* module given the information passed back by the modification form
* Modify configuration
*
* @author Jim McDonald
* @param bold print items in bold
* @param itemsperpage number of items per page
*/
function Example_admin_updateconfig()
{
// Security check - important to do this as early as possible to avoid
// potential security holes or just too much wasted processing
if (!pnSecAuthAction(0, 'Example::', '::', ACCESS_ADMIN)) {
return pnVarPrepHTMLDisplay(_MODULENOAUTH);
}
// Get parameters from whatever input we need. All arguments to this
// function should be obtained from pnVarCleanFromInput(), getting them
// from other places such as the environment is not allowed, as that makes
// assumptions that will not hold in future versions of PostNuke
list($bold, $itemsperpage) = pnVarCleanFromInput('bold', 'itemsperpage');
// Confirm authorisation code. This checks that the form had a valid
// authorisation code attached to it. If it did not then the function will
// proceed no further as it is possible that this is an attempt at sending
// in false data to the system
if (!pnSecConfirmAuthKey()) {
pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_BADAUTHKEY));
return pnRedirect(pnModURL('Example', 'admin', 'view'));
}
// Update module variables. Note that depending on the HTML structure used
// to obtain the information from the user it is possible that the values
// might be empty, so it is important to check them all and assign them
// default values if required.
// ** Please note pnVarCleanFromInput will always return a set variable, even
// it's empty so isset() checking is not appropriate.
if (empty($bold)) {
$bold = false;
}
pnModSetVar('Example', 'bold', (bool) $bold);
if (empty($itemsperpage)) {
$itemsperpage = 10;
}
// make sure $itemsperpage is a positive integer
if (!is_integer($itemsperpage) || $itemsperpage < 1) {
pnSessionSetVar('errormsg', pnVarPrepForDisplay(_EXAMPLEITEMSPERPAGE));
$itemsperpage = (int) $itemsperpage;
if ($itemsperpage < 1) {
$itemsperpage = 25;
}
}
pnModSetVar('Example', 'itemsperpage', $itemsperpage);
// The configuration has been changed, so we clear all caches for
// this module.
$pnRender =& new pnRender('Example');
// Please note that by using clear_cache without any parameter,
// we clear all cached pages for this module.
$pnRender->clear_cache();
// the module configuration has been updated successfuly
pnSessionSetVar('statusmsg', _CONFIGUPDATED);
// Let any other modules know that the modules configuration has been updated
pnModCallHooks('module', 'updateconfig', 'Example', array('module' => 'Example'));
// This function generated no output, and so now it is complete we redirect
// the user to an appropriate page for them to carry on their work
return pnRedirect(pnModURL('Example', 'admin', 'view'));
}
示例10: Lenses_user_view
function Lenses_user_view($args)
{
// Security check
if (!pnSecAuthAction(0, 'Lenses::', '::', ACCESS_OVERVIEW)) {
return pnVarPrepHTMLDisplay(_NOTSUBSCRIBED);
}
list($phrase, $q, $display_phrase, $search, $or, $and, $markings, $markings2, $wizard) = pnVarCleanFromInput('phrase', 'q', 'display_phrase', 'search', 'or', 'and', 'markings', 'markings2', 'wizard');
//print_r($or);
//print_r($search);
if (isset($q)) {
$phrase = $q;
}
//echo ("here");
//echo($q);
//echo ($phrase);
/*
The following will require some explanation. I want the search to be very dynamic, and I wanted to be able to take the user's input from the search form and create an SQL query from it. I did this by creating several arrays that will ultimately be passed to the API function. This includes the
*/
//the $or_array will have this structure: =>[field]=array (value, value...), where the key is a database field. The API will eventually parse this to make part of the SQL statement: "...WHERE (key = 'value' OR key='value...)"
$or_array = array();
//the $and_array will have the same structure: =>[field]=array (value, value...), where the key is a database field. The API will eventually parse this to make part of the SQL statement: "...WHERE (key = 'value' AND key='value...)". The only difference is the values will be separated by "AND".
$and_array = array();
//The and_or array. Each array contains an array where the key is a field name and the value is a search value, like this: =>[0] => ([field1]=>value1, [field2]=>value2,..)... This will ultimately be parsed to look like this: "...WHERE (field1 = value1 OR field2=value2...). This is different from the or_array in that different fields can be used.
$and_or_array = array();
//the $select array is a list of database fields for which the user has specified an interest.
//the following values will be defaults to be displayed
$select = array('tid', 'name', 'comp_name', 'discontinued', 'max_minus', 'max_plus', 'toric', 'bifocal', 'cosmetic', 'max_cyl_power', 'max_add');
//if the user is simply searching for a lens by name the $phrase variable will have been passed. Since it may contain multiple words, it will be exploded and all terms will be searched in the names and aliases fields.
if (isset($phrase) && $phrase != "") {
$phrase_array = explode(" ", $phrase);
//print_r($phrase_array);
$i = 0;
foreach ($phrase_array as $value) {
$and_or_array[$i][name] = " LIKE '%{$value}%'";
$and_or_array[$i][aliases] = " LIKE '%{$value}%'";
$i++;
}
//this is just a term to display on the search results page
$display_phrase = "that contain the phrase '" . $phrase . "'";
}
// if a phrase isn't passed to this fuction, assume the more "advanced" search is being requested
// Clean input to this function.
//the search array will be passed with database fields as keys and search criterion as values. The API will eventually parse this into the SQL statement. The values from the $or and $and arrays will be added to the appropriate arrays that will be passed to the API.
foreach ($or as $value) {
$temp = pnVarCleanFromInput($value);
if (is_array($temp)) {
$or_array[$value] = $temp;
$select[] = $value;
}
}
foreach ($and as $value) {
$temp = pnVarCleanFromInput($value);
if (is_array($temp)) {
$and_array[$value] = $temp;
$select[] = $value;
}
}
foreach ($search as $key => $value) {
//echo ($key." : ".$value."<br/>");
if ($value != '0') {
$select[] = $key;
}
}
//check to see if 'markings' was passed - indicates user is searching by toric markings...
//there's gotta be a better way to do this....
if ($markings != "") {
$and_array[markings][0] = $markings;
}
if ($markings2 != "") {
$and_array[markings][1] = $markings2;
}
//die;
// Data called by other modules.
extract($args);
// add these fields to the select array. Some may have already been present, so the weed out the items that are not unique. Then, the array will be reduced to the top 9 items so there aren't too many fields displayed in the search results table
$select = array_values(array_unique($select));
// The API function is called. The arguments to the function are passed in
// as their own arguments array
$items = pnModAPIFunc('Lenses', 'user', 'getlist', array('search' => $search, 'or_array' => $or_array, 'and_array' => $and_array, 'and_or_array' => $and_or_array, 'select' => $select));
//print_r ($items);//die;
// if no items were found and the user was searching for a phrase, will do a full-text search for this phrase and hopefully find something
if (!$items && isset($phrase)) {
$display_phrase = " whose content includes: '{$phrase}'";
$items = pnModAPIFunc('Lenses', 'user', 'getlist', array('search' => $search, 'phrase' => $phrase, 'select' => $select));
}
//count the items.
$count = count($items);
//If there is only one result (and the user has permission), go directly to that lens.
if ($count == 1 && is_array($items) && pnSecAuthAction(0, 'Lenses::', '::', ACCESS_READ)) {
pnRedirect(pnModURL('Lenses', 'user', 'display', array('tid' => $items[0]['tid'])));
}
//just to be thorough, if the user is searching for a lens by a phrase, check to see if there's any company names that match that phrase. This will be displayed with a statement saying something like "were you looking for lenses made by..."
$company_options = pnModAPIFunc('Lenses', 'user', 'getcompany', array('phrase_array' => $phrase_array));
// The return value of the function is checked here, and if the function
// suceeded then an appropriate message is posted.
//if (!$items && !$company_options) return pnVarPrepHTMLDisplay(_LENSESITEMFAILED);
//if the user was searching by company, find the company name by looking at the first lens returned and capturing it's company name (this should work because ALL lenses returned should be manufactured by this company...
if ($display_phrase == "company") {
$display_phrase = " that are manufactured by " . $items[0][comp_name];
}
//.........这里部分代码省略.........
示例11: substr
if (substr($module, 0, 3) == 'NS-') {
$function = substr($module, 3) . '_user_';
} else {
$function = $module . '_user_';
}
$function_op = $function . $op;
$function_main = $function . 'main';
if (function_exists($function_op)) {
$function_op($_REQUEST);
exit;
} elseif (function_exists($function_main)) {
$function_main($_REQUEST);
exit;
} else {
// die("error : user_execute($file,$function_op)");
pnRedirect('index.php');
return true;
}
}
// when we are here, the call is the result of an action
// requested by a (legacy) Your_Account plugin.
// Get all user modules...
$usermods = pnModGetUserMods();
// since the your account module does't have index.php/pnuser.php it
// won't be listed as user_capable hence we need to manually add it to
// our result set. [markwest]
$usermods[] = pnModGetInfo(pnModGetIDFromName('Your_Account'));
// ...and run the requested action (specified by $op)
foreach ($usermods as $usermod) {
if (@is_dir($dir = 'modules/' . $usermod['directory'] . '/user/case/')) {
$casedir = opendir($dir);
示例12: pnRedirect
* http://postcalendar.tv
*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* To read the license please read the docs/license.txt or visit
* http://www.gnu.org/copyleft/gpl.html
*
*/
/*******************************************************
This file is for the old module load routine
You can now link the module in a menu using the
module name enclosed with brackets
(ex: [PostCalendar])
*******************************************************/
if (!defined("LOADED_AS_MODULE")) {
echo 'You may not access this module directly';
} else {
pnRedirect(pnModURL(pnVarCleanFromInput('name'), 'user', 'main'));
}
示例13: user_admin_setConfig
function user_admin_setConfig($var)
{
if (!pnSecConfirmAuthKey()) {
include 'header.php';
echo _BADAUTHKEY;
include 'footer.php';
exit;
}
// Escape some characters in these variables.
// hehe, I like doing this, much cleaner :-)
$fixvars = array();
// todo: make FixConfigQuotes global / replace with other function
foreach ($fixvars as $v) {
// $var[$v] = FixConfigQuotes($var[$v]);
}
// Set any numerical variables that havn't been set, to 0. i.e. paranoia check :-)
$fixvars = array();
foreach ($fixvars as $v) {
if (empty($var[$v])) {
$var[$v] = 0;
}
}
// all variables starting with x are the config vars.
while (list($key, $val) = each($var)) {
if (substr($key, 0, 1) == 'x') {
pnConfigSetVar(substr($key, 1), $val);
}
}
pnRedirect('admin.php');
}
示例14: modules_admin_regenerate
function modules_admin_regenerate()
{
// Security check
if (!pnSecConfirmAuthKey()) {
pnSessionSetVar('errormsg', _BADAUTHKEY);
pnRedirect(pnModURL('Modules', 'admin', 'list'));
return true;
}
// Load in API
pnModAPILoad('Modules', 'admin');
// Regenerate modules
if (pnModAPIFunc('Modules', 'admin', 'regenerate')) {
// Success
pnSessionSetVar('statusmsg', _MODREGENERATED);
}
pnRedirect(pnModURL('Modules', 'admin', 'list'));
return true;
}
示例15: template_admin_updateconfig
/**
* This is a standard function to update the configuration parameters of the
* module given the information passed back by the modification form
*/
function template_admin_updateconfig()
{
// Get parameters from whatever input we need. All arguments to this
// function should be obtained from pnVarCleanFromInput(), getting them
// from other places such as the environment is not allowed, as that makes
// assumptions that will not hold in future versions of PostNuke
$bold = pnVarCleanFromInput('bold');
// Confirm authorisation code. This checks that the form had a valid
// authorisation code attached to it. If it did not then the function will
// proceed no further as it is possible that this is an attempt at sending
// in false data to the system
if (!pnSecConfirmAuthKey()) {
pnSessionSetVar('errormsg', _BADAUTHKEY);
pnRedirect(pnModURL('Template', 'admin', 'view'));
return true;
}
// Update module variables. Note that depending on the HTML structure used
// to obtain the information from the user it is possible that the values
// might be unset, so it is important to check them all and assign them
// default values if required
if (!isset($bold)) {
$bold = 0;
}
pnModSetVar('template', 'bold', $bold);
if (!isset($itemsperpage)) {
$itemsperpage = 10;
}
pnModSetVar('template', 'itemsperpage', $itemsperpage);
// This function generated no output, and so now it is complete we redirect
// the user to an appropriate page for them to carry on their work
pnRedirect(pnModURL('Template', 'admin', 'view'));
// Return
return true;
}