Commit 86185302 authored by nyloth's avatar nyloth

[MOD] prefs and user prefs: $prefs array deployement in php + some small fixes

(Preliminary note : This is a deep modification in tikiwiki's prefs code. Please test first and send feedback if you can)

 * Now use the $prefs array everywhere (in php files also) instead of global vars. This will :

	- allow to use prefs the same way in smarty and php ($prefs array),

	- simplify all code parts that modifiy a preference, because when a pref is modified in php's $prefs array, it is also up-to-date in smarty $prefs array (everything is passed by reference now). So, no more need to reassign values in smarty each time,

	- avoid duplication of values in memory,

	- reduce risks of errors (e.g. collision in variables names, forget to add one of the "global $prefname", ...)


 * All user prefs are now retrieved in one query at tiki-setup stage (as site prefs) and also in session vars (when sessions are used). This will :

	- reduce overhead and database queries after the first page


 * User prefs are now overriding $prefs. This will :

	- simplify the whole usage of $prefs, because only one array is used (no more need, in general, to use tikilib's functions to get user prefs),

	- set some $prefs['site_*'] (listed in the $user_overrider_prefs array of lib/setup/user_prefs.php) for some specific site prefs that needs to be accessed in php (for example when sending mails) and that could have been overrided with the corresponding user pref
parent fd24b6d6
......@@ -1061,4 +1061,4 @@ class ADORecordSet_postgres64 extends ADORecordSet{
}
}
?>
\ No newline at end of file
?>
<?php
// $Header: /cvsroot/tikiwiki/tiki/article_image.php,v 1.17 2007-03-06 19:29:44 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/article_image.php,v 1.18 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -16,7 +16,7 @@ if (!isset($_REQUEST["id"])) {
include_once ('lib/init/initlib.php');
include_once ('tiki-setup_base.php');
$topiccachefile = $tikilib->get_preference("tmpdir", "temp");
$topiccachefile = $prefs['tmpDir'];
if ($tikidomain) { $topiccachefile.= "/$tikidomain"; }
$topiccachefile.= "/article.".$_REQUEST["id"];
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/banner_image.php,v 1.15 2007-03-06 19:29:44 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/banner_image.php,v 1.16 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -17,7 +17,7 @@ include_once ('db/tiki-db.php');
include_once ('lib/tikilib.php');
$tikilib = new Tikilib($dbTiki);
$bannercachefile = $tikilib->get_preference("tmpdir", "temp");
$bannercachefile = $prefs['tmpDir'];
if ($tikidomain) { $bannercachefile.= "/$tikidomain"; }
$bannercachefile.= "/banner.".$_REQUEST["id"];
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/categorize.php,v 1.24 2007-08-28 11:52:00 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/categorize.php,v 1.25 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -13,9 +13,9 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
}
require_once('tiki-setup.php');
global $feature_categories;
global $prefs;
if ($feature_categories == 'y') {
if ($prefs['feature_categories'] == 'y') {
global $categlib; include_once('lib/categories/categlib.php');
$smarty->assign('cat_categorize', 'n');
......@@ -33,8 +33,8 @@ if ($feature_categories == 'y') {
$categlib->update_object_categories($_REQUEST['cat_categories'], $cat_objid, $cat_type, $cat_desc, $cat_name, $cat_href);
$cats = $categlib->get_object_categories($cat_type, $cat_objid);
if (isset($section) && $section == 'wiki' && $feature_wiki_mandatory_category > 0)
$categories = $categlib->list_categs($feature_wiki_mandatory_category);
if (isset($section) && $section == 'wiki' && $prefs['feature_wiki_mandatory_category'] > 0)
$categories = $categlib->list_categs($prefs['feature_wiki_mandatory_category']);
else
$categories = $categlib->list_categs();
$num_categories = count($categories);
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/categorize_list.php,v 1.29 2007-09-12 10:12:34 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/categorize_list.php,v 1.30 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -13,10 +13,10 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
exit;
}
require_once('tiki-setup.php');
global $feature_categories, $userlib;
global $prefs, $userlib;
$smarty->assign('mandatory_category', '-1');
if ($feature_categories == 'y') {
if ($prefs['feature_categories'] == 'y') {
global $categlib, $user; include_once ('lib/categories/categlib.php');
$smarty->assign('cat_categorize', 'n');
......@@ -28,12 +28,12 @@ if ($feature_categories == 'y') {
if ($cat_type == 'wiki page' || $cat_type == 'blog' || $cat_type == 'image gallery' || $cat_type == 'mypage') {
$ext = ($cat_type == 'wiki page')? 'wiki':str_replace(' ', '_', $cat_type);
$pref = 'feature_'.$ext.'_mandatory_category';
global $$pref;
if ($$pref > 0)
$all_categories = $categlib->list_categs($$pref);
else
if ($prefs[$pref] > 0) {
$all_categories = $categlib->list_categs($prefs[$pref]);
} else {
$all_categories = $categlib->list_categs();
$smarty->assign('mandatory_category', $$pref);
}
$smarty->assign('mandatory_category', $prefs[$pref]);
} else
$all_categories = $categlib->list_categs();
$categories = array();
......
......@@ -2,7 +2,7 @@
// $start_time = microtime(true);
// $Header: /cvsroot/tikiwiki/tiki/comments.php,v 1.79 2007-09-27 17:02:45 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/comments.php,v 1.80 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -33,12 +33,12 @@ $handled_requests = array('comments_per_page', 'thread_style', 'thread_sort_mode
// First override existing values (e.g. coming from forum specific settings) by user specific requests if we allow them
// (we empty those user specific requests if they are denied)
if ( $forum_thread_user_settings == 'y' ) {
if ( $prefs['forum_thread_user_settings'] == 'y' ) {
foreach ( $handled_requests as $request_name ) {
if ( isset($_REQUEST[$request_name]) ) {
$$request_name = $_REQUEST[$request_name];
$smarty->assign($request_name.'_param', '&amp;'.$request_name.'='.$_REQUEST[$request_name]);
if ( $forum_thread_user_settings_keep == 'y' ) $_SESSION['forums_'.$request_name] = $_REQUEST[$request_name];
if ( $prefs['forum_thread_user_settings_keep'] == 'y' ) $_SESSION['forums_'.$request_name] = $_REQUEST[$request_name];
}
}
} else foreach ( $handled_requests as $request_name ) unset($_REQUEST[$request_name]);
......@@ -47,7 +47,7 @@ if ( $forum_thread_user_settings == 'y' ) {
if ( isset($forum_mode) && $forum_mode == 'y' ) {
// If we are in a forum thread
if ( $forum_thread_user_settings == 'y' && $forum_thread_user_settings_keep == 'y' ) {
if ( $prefs['forum_thread_user_settings'] == 'y' && $prefs['forum_thread_user_settings_keep'] == 'y' ) {
// If 'forum_thread_user_settings' is enabled (allow user to change thread display settings)
// and if the 'forum_thread_user_settings_keep' is enabled (keep user settings for all forums during his session)
// ... we check session vars
......@@ -64,9 +64,9 @@ if ( isset($forum_mode) && $forum_mode == 'y' ) {
// !! Global value is not used when there is an explicit user request !!
foreach ( $handled_requests as $request_name )
if ( ( ! isset($$request_name) || $$request_name == '' || $forum_thread_defaults_by_forum != 'y' )
if ( ( ! isset($$request_name) || $$request_name == '' || $prefs['forum_thread_defaults_by_forum'] != 'y' )
&& ! isset($_REQUEST[$request_name])
) $$request_name = ${'forum_'.$request_name};
) $$request_name = $prefs['forum_'.$request_name];
}
if ( $forum_info['is_flat'] == 'y' ) {
......@@ -210,14 +210,14 @@ $in_reply_to = '';
if ( ($tiki_p_post_comments == 'y' && (!isset($forum_mode) || $forum_mode == 'n'))
|| ($tiki_p_forum_post == 'y' && isset($forum_mode) && $forum_mode == 'y') ) {
if (isset($_REQUEST["comments_postComment"])) {
if (empty($user) && $feature_antibot == 'y' && (!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) {
if (empty($user) && $prefs['feature_antibot'] == 'y' && (!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) {
$smarty->assign('msg',tra("You have mistyped the anti-bot verification code; please try again."));
$smarty->display("error.tpl");
die;
}
$comments_show = 'y';
if (!empty($_REQUEST["comments_title"]) && !empty($_REQUEST["comments_data"]) && !($feature_contribution == 'y' && ((isset($forum_mode) && $forum_mode == 'y' && $feature_contribution_mandatory_forum == 'y') || ((empty($forum_mode) || $forum_mode == 'n') && $feature_contribution_mandatory_comment == 'y')) && empty($_REQUEST['contributions']))) {
if (!empty($_REQUEST["comments_title"]) && !empty($_REQUEST["comments_data"]) && !($prefs['feature_contribution'] == 'y' && ((isset($forum_mode) && $forum_mode == 'y' && $prefs['feature_contribution_mandatory_forum'] == 'y') || ((empty($forum_mode) || $forum_mode == 'n') && $prefs['feature_contribution_mandatory_comment'] == 'y')) && empty($_REQUEST['contributions']))) {
if ( isset($forum_mode) && $forum_mode == 'y' && $forum_info['is_flat'] == 'y' && $_REQUEST["comments_grandParentId"] > 0 ) {
$smarty->assign('msg', tra("This forum is flat and doesn't allow replies to other replies"));
......@@ -377,7 +377,7 @@ if ( ($tiki_p_post_comments == 'y' && (!isset($forum_mode) || $forum_mode == 'n'
$commentslib->register_forum_post($_REQUEST["forumId"], $_REQUEST["comments_parentId"]);
}
if (($feature_user_watches == 'y') && ($wiki_watch_comments == 'y') && (isset($_REQUEST["page"]))) {
if (($prefs['feature_user_watches'] == 'y') && ($prefs['wiki_watch_comments'] == 'y') && (isset($_REQUEST["page"]))) {
include_once ('lib/webmail/tikimaillib.php');
$nots = $commentslib->get_event_watches('wiki_page_changed', $_REQUEST["page"]);
$isBuilt = false;
......@@ -395,7 +395,7 @@ if ( ($tiki_p_post_comments == 'y' && (!isset($forum_mode) || $forum_mode == 'n'
$nots[] = array("user"=>"", "hash"=>"", "email"=>$email);
}
foreach ($nots as $not) {
if ($wiki_watch_editor != 'y' && $not['user'] == $user)
if ($prefs['wiki_watch_editor'] != 'y' && $not['user'] == $user)
break;
if (!$isBuilt) {
$isBuilt = true;
......@@ -416,8 +416,8 @@ if ( ($tiki_p_post_comments == 'y' && (!isset($forum_mode) || $forum_mode == 'n'
$smarty->assign('mail_machine_raw', $tikilib->httpPrefix(). implode('/', $parts));
$mail = new TikiMail();
}
global $language;// TODO: optimise by grouping user by language
$languageEmail = $tikilib->get_user_preference($not['user'], "language", $language);
global $prefs;// TODO: optimise by grouping user by language
$languageEmail = $tikilib->get_user_preference($not['user'], "language", $prefs['site_language']);
$mail->setUser($not['user']);
$mail_data = $smarty->fetchLang($languageEmail, 'mail/user_watch_wiki_page_changed_subject.tpl');
$mail->setSubject(sprintf($mail_data, $_REQUEST["page"]));
......@@ -433,7 +433,7 @@ if ( ($tiki_p_post_comments == 'y' && (!isset($forum_mode) || $forum_mode == 'n'
if (empty($_REQUEST["comments_title"]) || empty($_REQUEST["comments_data"])) {
$msgError = tra("Missing title or body when trying to post a comment");
}
if ($feature_contribution == 'y' && empty($_REQUEST['contributions'])) {
if ($prefs['feature_contribution'] == 'y' && empty($_REQUEST['contributions'])) {
if ($msgError)
$msgError .= '<br />';
$msgError .= tra("A contribution is mandatory");
......@@ -475,7 +475,7 @@ if (($tiki_p_remove_comments == 'y' && (!isset($forum_mode) || $forum_mode == 'n
|| (isset($forum_mode) && $forum_mode =='y' && $tiki_p_admin_forum == 'y' ) ) {
if (isset($_REQUEST["comments_remove"]) && isset($_REQUEST["comments_threadId"])) {
$area = 'delcomment';
if ($feature_ticketlib2 != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$comments_show = 'y';
$commentslib->remove_comment($_REQUEST["comments_threadId"]);
......@@ -510,9 +510,9 @@ if ($_REQUEST["comments_threadId"] > 0) {
// Re-enabled by rlpowell; my users rely on this. If you want to disable it, put an option in the forums or something.
// However, I re-enabled it *working*, instead of broken. -rlpowell
// check to see if QUOTE plugin or > should be used -Terence
global $feature_forum_parse, $feature_use_quoteplugin;
global $prefs;
if ( $comment_info["data"] != '' ) {
if ( $feature_forum_parse == 'y' && $feature_use_quoteplugin == 'y' ) {
if ( $prefs['feature_forum_parse'] == 'y' && $prefs['feature_use_quoteplugin'] == 'y' ) {
$comment_info["data"] = "\n{QUOTE()}" . $comment_info["data"] . '{QUOTE}';
} else {
$comment_info["data"] = preg_replace( '/\n/', "\n> ", $comment_info["data"] ) ;
......@@ -683,7 +683,7 @@ if (!empty($_REQUEST['post_reply'])) {
$smarty->assign('edit_reply', $_REQUEST['edit_reply']);
}
if ($feature_contribution == 'y') {
if ($prefs['feature_contribution'] == 'y') {
$contributionItemId = $_REQUEST["comments_threadId"];
include_once('contribution.php');
}
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/contribution.php,v 1.8 2007-05-03 11:00:18 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/contribution.php,v 1.9 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
......@@ -19,9 +19,9 @@ if (strpos($_SERVER['SCRIPT_NAME'],basename(__FILE__)) !== FALSE) {
}
require_once('tiki-setup.php');
global $feature_contribution;
global $prefs;
if ($feature_contribution == 'y') {
if ($prefs['feature_contribution'] == 'y') {
global $contributionlib; include_once('lib/contribution/contributionlib.php');
$contributions = $contributionlib->list_contributions();
if (!empty($_REQUEST['contributions'])) {
......@@ -47,13 +47,12 @@ if ($feature_contribution == 'y') {
}
}
if (!empty($oneSelected)) {
if ((isset($section) && $section == 'forum' && $feature_contribution_mandatory_forum != 'y') || ((!isset($section) || $section != 'forum') && $feature_contribution_mandatory_comment != 'y'))
if ((isset($section) && $section == 'forum' && $prefs['feature_contribution_mandatory_forum'] != 'y') || ((!isset($section) || $section != 'forum') && $prefs['feature_contribution_mandatory_comment'] != 'y'))
$contributions['data'][] = array('contributionId'=>0, 'name'=>'');
}
$smarty->assign_by_ref('contributions', $contributions['data']);
global $feature_contributor_wiki;
if ($feature_contributor_wiki == 'y' && !empty($section) && $section == 'wiki page') {
if ($prefs['feature_contributor_wiki'] == 'y' && !empty($section) && $section == 'wiki page') {
$users = $userlib->list_all_users();
$smarty->assign_by_ref('users', $users);
if (!empty($_REQUEST['contributors'])) {
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/copyrights.php,v 1.17 2007-03-06 19:29:45 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/copyrights.php,v 1.18 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -8,7 +8,7 @@
require_once ('tiki-setup.php');
if ($wiki_feature_copyrights != 'y') {
if ($prefs['wiki_feature_copyrights'] != 'y') {
$smarty->assign('msg', tra("The copyright management feature is not enabled."));
$smarty->display("error.tpl");
......@@ -32,7 +32,7 @@ $smarty->assign('page', $_REQUEST["page"]);
$page = $_REQUEST["page"];
if (isset($_REQUEST['addcopyright'])) {
if ($wiki_feature_copyrights == 'y' && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear'])
if ($prefs['wiki_feature_copyrights'] == 'y' && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear'])
&& isset($_REQUEST['copyrightAuthors']) && !empty($_REQUEST['copyrightYear']) && !empty($_REQUEST['copyrightTitle'])) {
$copyrightYear = $_REQUEST['copyrightYear'];
......@@ -46,7 +46,7 @@ if (isset($_REQUEST['addcopyright'])) {
}
if (isset($_REQUEST['editcopyright'])) {
if ($wiki_feature_copyrights == 'y' && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear'])
if ($prefs['wiki_feature_copyrights'] == 'y' && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear'])
&& isset($_REQUEST['copyrightAuthors']) && !empty($_REQUEST['copyrightYear']) && !empty($_REQUEST['copyrightTitle'])) {
$copyrightId = $_REQUEST['copyrightId'];
......@@ -67,7 +67,7 @@ if (isset($_REQUEST['action']) && isset($_REQUEST['copyrightId'])) {
$copyrightslib->down_copyright($_REQUEST['copyrightId']);
} elseif ($_REQUEST['action'] == 'delete') {
$area = 'delcopyright';
if ($feature_ticketlib2 != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$copyrightslib->remove_copyright($_REQUEST['copyrightId']);
} else {
......
<?php // $Header: /cvsroot/tikiwiki/tiki/doc/devtools/parse_tiki.php,v 1.3 2007-02-04 20:09:34 mose Exp $
<?php // $Header: /cvsroot/tikiwiki/tiki/doc/devtools/parse_tiki.php,v 1.4 2007-10-12 07:55:36 nyloth Exp $
// heaviled modified get_strings.php
// dedicated as a tool for use in an eventual test suite
......@@ -6,8 +6,8 @@
require_once('tiki-setup.php');
if($tiki_p_admin != 'y') {
if ($feature_redirect_on_error == 'y') {
header("location: $tikiIndex");
if ($prefs['feature_redirect_on_error'] == 'y') {
header('location: '.$prefs['tikiIndex']);
die;
} else {
die("You need to be admin to run this script");
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/freetag_apply.php,v 1.5 2005-12-17 19:32:51 lfagundes Exp $
// $Header: /cvsroot/tikiwiki/tiki/freetag_apply.php,v 1.6 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -10,10 +10,10 @@
require_once('tiki-setup.php');
$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__));
global $feature_freetags;
global $prefs;
global $tiki_p_freetags_tag;
if ($feature_freetags == 'y' and $tiki_p_freetags_tag == 'y') {
if ($prefs['feature_freetags'] == 'y' and $tiki_p_freetags_tag == 'y') {
global $freetaglib;
if (!is_object($freetaglib)) {
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/freetag_list.php,v 1.4 2005-12-17 19:32:50 lfagundes Exp $
// $Header: /cvsroot/tikiwiki/tiki/freetag_list.php,v 1.5 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -11,10 +11,10 @@
require_once('tiki-setup.php');
$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__));
global $feature_freetags;
global $prefs;
global $tiki_p_view_freetags;
if ($feature_freetags == 'y' and $tiki_p_view_freetags == 'y') {
if ($prefs['feature_freetags'] == 'y' and $tiki_p_view_freetags == 'y') {
global $freetaglib;
if (!is_object($freetaglib)) {
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/help.php,v 1.4 2005-09-08 01:33:00 damosoft Exp $
// $Header: /cvsroot/tikiwiki/tiki/help.php,v 1.5 2007-10-12 07:55:23 nyloth Exp $
// Initialization
require_once ('tiki-setup.php');
......@@ -10,7 +10,7 @@ include_once ('lib/wiki/wikilib.php');
include_once ('lib/structures/structlib.php');
include_once ('lib/notifications/notificationlib.php');
if ($feature_wiki != 'y') {
if ($prefs['feature_wiki'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_wiki");
$smarty->display("error.tpl");
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/index.php,v 1.8 2007-03-06 19:29:45 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/index.php,v 1.9 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
require_once ('tiki-setup.php');
if(!(headers_sent())){
header ("location: $tikiIndex");
if ( ! headers_sent() ) {
header ('location: '.$prefs['tikiIndex']);
}
die("header already sent");
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/jhot.php,v 1.19 2007-03-06 19:29:45 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/jhot.php,v 1.20 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
# $Header: /cvsroot/tikiwiki/tiki/jhot.php,v 1.19 2007-03-06 19:29:45 sylvieg Exp $
# $Header: /cvsroot/tikiwiki/tiki/jhot.php,v 1.20 2007-10-12 07:55:23 nyloth Exp $
include_once ('tiki-setup.php');
include_once ('lib/drawings/drawlib.php');
if (($tiki_p_admin_drawings != 'y') && ($tiki_p_edit_drawings != 'y') && ($feature_drawings != 'y')) {
if (($tiki_p_admin_drawings != 'y') && ($tiki_p_edit_drawings != 'y') && ($prefs['feature_drawings'] != 'y')) {
die;
}
if (isset($_FILES['filepath']) && is_uploaded_file($_FILES['filepath']['tmp_name'])) {
......
......@@ -841,8 +841,8 @@ $lang=Array(
// "No backlinks to this page" => "No backlinks to this page",
// "admin admin tpl" => "admin admin tpl",
// "Use of this feature is NOT recommended. Please use phpMyAdmin or mysqldump instead." => "Use of this feature is NOT recommended. Please use phpMyAdmin or mysqldump instead.",
// "Your image gallery storage is set to \"{\$gal_use_dir}\", you will need to backup this using FTP or SCP." => "Your image gallery storage is set to \"{\$gal_use_dir}\", you will need to backup this using FTP or SCP.",
// "Your file gallery storage is set to \"{\$fgal_use_dir}\", you will need to backup this using FTP or SCP." => "Your file gallery storage is set to \"{\$fgal_use_dir}\", you will need to backup this using FTP or SCP.",
// "Your image gallery storage is set to \"{\$prefs['gal_use_dir']}\", you will need to backup this using FTP or SCP." => "Your image gallery storage is set to \"{\$prefs['gal_use_dir']}\", you will need to backup this using FTP or SCP.",
// "Your file gallery storage is set to \"{\$prefs['fgal_use_dir']}\", you will need to backup this using FTP or SCP." => "Your file gallery storage is set to \"{\$prefs['fgal_use_dir']}\", you will need to backup this using FTP or SCP.",
// "Note: if you want to use images please save the post first and you\r\nwill be able to edit/post images. Use the &lt;img&gt; snippet to include uploaded images in the textarea editor\r\nor use the image URL to include images using the WYSIWYG editor. " => "Note: if you want to use images please save the post first and you\r\nwill be able to edit/post images. Use the &lt;img&gt; snippet to include uploaded images in the textarea editor\r\nor use the image URL to include images using the WYSIWYG editor. ",
// "admin the category system" => "admin the category system",
// "Trackers Items" => "Trackers Items",
......
......@@ -287,7 +287,7 @@ class AdminLib extends TikiLib {
}
function remove_tag($tagname) {
global $wikiHomePage;
global $prefs;
$query = "delete from `tiki_tags` where `tagName`=?";
$result = $this->query($query,array($tagname));
......@@ -312,7 +312,7 @@ class AdminLib extends TikiLib {
// This function can be used to store the set of actual pages in the "tags"
// table preserving the state of the wiki under a tag name.
function create_tag($tagname, $comment = '') {
global $wikiHomePage;
global $prefs;
$query = "select * from `tiki_pages`";
$result = $this->query($query,array());
......@@ -336,7 +336,7 @@ class AdminLib extends TikiLib {
// This funcion recovers the state of the wiki using a tagName from the
// tags table
function restore_tag($tagname) {
global $wikiHomePage;
global $prefs;