Commit c5efa91d authored by changi67's avatar changi67

[MOD] Only Identation

parent 78c5abb9
This diff is collapsed.
This diff is collapsed.
<?php
// $Id: /cvsroot/tikiwiki/tiki/tiki-admin_banners.php,v 1.13.2.1 2007-11-04 22:08:04 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.
// Initialization
require_once ('tiki-setup.php');
if ($prefs['feature_banners'] != 'y') {
$smarty->assign('msg', tra('This feature is disabled').': feature_banners');
$smarty->display('error.tpl');
die;
$smarty->assign('msg', tra('This feature is disabled') . ': feature_banners');
$smarty->display('error.tpl');
die;
}
if($tiki_p_admin_banners != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg',tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
if ($tiki_p_admin_banners != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
// Display the template
$smarty->assign('mid', 'tiki-edit_banner.tpl');
$smarty->display("tiki.tpl");
<?php
// 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');
include_once ('lib/ban/banlib.php');
if ($prefs['feature_banning'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_banning");
$smarty->display("error.tpl");
die;
$smarty->assign('msg', tra("This feature is disabled") . ": feature_banning");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_admin_banning != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("Permission denied"));
$smarty->display("error.tpl");
die;
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("Permission denied"));
$smarty->display("error.tpl");
die;
}
if (isset($_REQUEST['banId'])) {
$info = $banlib->get_rule($_REQUEST['banId']);
$info = $banlib->get_rule($_REQUEST['banId']);
} else {
$_REQUEST['banId'] = 0;
$info['sections'] = array();
$info['title'] = '';
$info['mode'] = 'user';
$info['ip1'] = 255;
$info['ip2'] = 255;
$info['ip3'] = 255;
$info['ip4'] = 255;
$info['use_dates'] = 'n';
$info['date_from'] = $tikilib->now;
$info['date_to'] = $tikilib->now + 7 * 24 * 3600;
$info['message'] = '';
$_REQUEST['banId'] = 0;
$info['sections'] = array();
$info['title'] = '';
$info['mode'] = 'user';
$info['ip1'] = 255;
$info['ip2'] = 255;
$info['ip3'] = 255;
$info['ip4'] = 255;
$info['use_dates'] = 'n';
$info['date_from'] = $tikilib->now;
$info['date_to'] = $tikilib->now + 7 * 24 * 3600;
$info['message'] = '';
}
$smarty->assign('banId', $_REQUEST['banId']);
$smarty->assign_by_ref('info', $info);
if (isset($_REQUEST['remove'])) {
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$banlib->remove_rule($_REQUEST['remove']);
} else {
key_get($area);
}
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$banlib->remove_rule($_REQUEST['remove']);
} else {
key_get($area);
}
}
if (isset($_REQUEST['del']) && isset($_REQUEST['delsec'])) {
check_ticket('admin-banning');
foreach (array_keys($_REQUEST['delsec'])as $sec) {
$banlib->remove_rule($sec);
}
check_ticket('admin-banning');
foreach(array_keys($_REQUEST['delsec']) as $sec) {
$banlib->remove_rule($sec);
}
}
if (isset($_REQUEST['save'])) {
check_ticket('admin-banning');
$_REQUEST['use_dates'] = isset($_REQUEST['use_dates']) ? 'y' : 'n';
$_REQUEST['date_from'] = $tikilib->make_time(0, 0, 0, $_REQUEST['date_fromMonth'], $_REQUEST['date_fromDay'], $_REQUEST['date_fromYear']);
$_REQUEST['date_to'] = $tikilib->make_time(0, 0, 0, $_REQUEST['date_toMonth'], $_REQUEST['date_toDay'], $_REQUEST['date_toYear']);
$sections = array_keys($_REQUEST['section']);
$banlib->replace_rule($_REQUEST['banId'], $_REQUEST['mode'], $_REQUEST['title'], $_REQUEST['ip1'], $_REQUEST['ip2'],
$_REQUEST['ip3'], $_REQUEST['ip4'], $_REQUEST['userreg'], $_REQUEST['date_from'], $_REQUEST['date_to'], $_REQUEST['use_dates'],
$_REQUEST['message'], $sections);
$info['sections'] = array();
$info['title'] = '';
$info['mode'] = 'user';
$info['ip1'] = 255;
$info['ip2'] = 255;
$info['ip3'] = 255;
$info['ip4'] = 255;
$info['use_dates'] = 'n';
$info['date_from'] = $tikilib->now;
$info['date_to'] = $tikilib->now + 7 * 24 * 3600;
$info['message'] = '';
$smarty->assign_by_ref('info', $info);
check_ticket('admin-banning');
$_REQUEST['use_dates'] = isset($_REQUEST['use_dates']) ? 'y' : 'n';
$_REQUEST['date_from'] = $tikilib->make_time(0, 0, 0, $_REQUEST['date_fromMonth'], $_REQUEST['date_fromDay'], $_REQUEST['date_fromYear']);
$_REQUEST['date_to'] = $tikilib->make_time(0, 0, 0, $_REQUEST['date_toMonth'], $_REQUEST['date_toDay'], $_REQUEST['date_toYear']);
$sections = array_keys($_REQUEST['section']);
$banlib->replace_rule($_REQUEST['banId'], $_REQUEST['mode'], $_REQUEST['title'], $_REQUEST['ip1'], $_REQUEST['ip2'], $_REQUEST['ip3'], $_REQUEST['ip4'], $_REQUEST['userreg'], $_REQUEST['date_from'], $_REQUEST['date_to'], $_REQUEST['use_dates'], $_REQUEST['message'], $sections);
$info['sections'] = array();
$info['title'] = '';
$info['mode'] = 'user';
$info['ip1'] = 255;
$info['ip2'] = 255;
$info['ip3'] = 255;
$info['ip4'] = 255;
$info['use_dates'] = 'n';
$info['date_from'] = $tikilib->now;
$info['date_to'] = $tikilib->now + 7 * 24 * 3600;
$info['message'] = '';
$smarty->assign_by_ref('info', $info);
}
$where = '';
$wheres = array();
if (isset($_REQUEST['where'])) {
$where = $_REQUEST['where'];
$where = $_REQUEST['where'];
}
if (!isset($_REQUEST["sort_mode"])) {
$sort_mode = 'created_desc';
$sort_mode = 'created_desc';
} else {
$sort_mode = $_REQUEST["sort_mode"];
$sort_mode = $_REQUEST["sort_mode"];
}
if (!isset($_REQUEST["offset"])) {
$offset = 0;
$offset = 0;
} else {
$offset = $_REQUEST["offset"];
$offset = $_REQUEST["offset"];
}
$smarty->assign_by_ref('offset', $offset);
if (isset($_REQUEST["find"])) {
$find = $_REQUEST["find"];
$find = $_REQUEST["find"];
} else {
$find = '';
$find = '';
}
$smarty->assign('find', $find);
$smarty->assign('where', $where);
$smarty->assign_by_ref('sort_mode', $sort_mode);
$items = $banlib->list_rules($offset, $maxRecords, $sort_mode, $find, $where);
$smarty->assign('cant', $items['cant']);
$smarty->assign_by_ref('cant_pages', $items["cant"]);
$smarty->assign_by_ref('items', $items["data"]);
$smarty->assign('sections', $sections_enabled);
ask_ticket('admin-banning');
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
$smarty->assign('mid', 'tiki-admin_banning.tpl');
$smarty->display("tiki.tpl");
<?php
include_once ('lib/admin/magiclib.php');
if ($prefs['feature_magic'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_magic");
$smarty->display("error.tpl");
die;
$smarty->assign('msg', tra("This feature is disabled") . ": feature_magic");
$smarty->display("error.tpl");
die;
}
$headerlib->add_cssfile('css/spanky.css');
$feature = $smarty->get_template_vars('feature');
// If the feature hasn't been set, try get it from the query string.
if ($feature == null && isset($_REQUEST['featurechain'])) {
$featureChain = $_REQUEST['featurechain'];
$featureChain = $_REQUEST['featurechain'];
} else {
$featureChain = $feature['feature_path'];
$featureChain = $feature['feature_path'];
}
$featurePage = explode('/', $featureChain);
$featureId = $featurePage[count($featurePage) - 1];
if (isset($featurePage[2])) {
$topLevelId = $featurePage[2];
$topLevelId = $featurePage[2];
} else {
$topLevelId = '';
$topLevelId = '';
}
$smarty->assign('toplevel', $topLevelId);
if (count($featurePage) > 3) {
$secondLevelId = $featurePage[3];
$smarty->assign('secondlevelId', $secondLevelId);
$secondLevelId = $featurePage[3];
$smarty->assign('secondlevelId', $secondLevelId);
}
if (count($featurePage) > 4) {
$thirdLevelId = $featurePage[4];
$smarty->assign('thirdlevelId', $thirdLevelId);
$thirdLevelId = $featurePage[4];
$smarty->assign('thirdlevelId', $thirdLevelId);
}
$topLevelFeatures = $magiclib->get_child_features(1, 'containers');
if ($topLevelId != '' && is_numeric($topLevelId)) {
$secondLevelFeatures = $magiclib->get_child_features($topLevelId, 'containers');
$secondLevelFeatures = $magiclib->get_child_features($topLevelId, 'containers');
} else {
$secondLevelFeatures = '';
$secondLevelFeatures = '';
}
if (isset($secondLevelId) && $secondLevelId != '' && is_numeric($secondLevelId)) {
$thirdLevelFeatures = $magiclib->get_child_features($secondLevelId, 'containers');
$thirdLevelFeatures = $magiclib->get_child_features($secondLevelId, 'containers');
} else {
$thirdLevelFeatures = '';
$thirdLevelFeatures = '';
}
$smarty->assign_by_ref('toplevelfeatures', $topLevelFeatures);
$smarty->assign_by_ref('secondlevel', $secondLevelFeatures);
$smarty->assign_by_ref('thirdlevel', $thirdLevelFeatures);
This diff is collapsed.
This diff is collapsed.
<?php
// $Id: /cvsroot/tikiwiki/tiki/tiki-admin_chart_items.php,v 1.19 2007-10-14 15:17:16 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');
include_once ('lib/charts/chartlib.php');
if ($prefs['feature_charts'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_charts");
$smarty->display("error.tpl");
die;
$smarty->assign('msg', tra("This feature is disabled") . ": feature_charts");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_admin_charts != 'y' and $tiki_p_suggest_chart_item != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("Permission denied"));
$smarty->display("error.tpl");
die;
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("Permission denied"));
$smarty->display("error.tpl");
die;
}
if (!isset($_REQUEST['chartId'])) {
$smarty->assign('msg', tra("No chart indicated"));
$smarty->display("error.tpl");
die;
$smarty->assign('msg', tra("No chart indicated"));
$smarty->display("error.tpl");
die;
}
if (!isset($_REQUEST['itemId']))
$_REQUEST['itemId'] = 0;
if (!isset($_REQUEST['itemId'])) $_REQUEST['itemId'] = 0;
if ($_REQUEST["itemId"]) {
$info = $chartlib->get_chart_item($_REQUEST["itemId"]);
$info = $chartlib->get_chart_item($_REQUEST["itemId"]);
} else {
$info = array(
'title' => '',
'description' => '',
'created' => 0,
'URL' => '',
'votes' => 0,
'points' => 0,
'average' => 0
);
$info = array(
'title' => '',
'description' => '',
'created' => 0,
'URL' => '',
'votes' => 0,
'points' => 0,
'average' => 0
);
}
$smarty->assign_by_ref('item_info', $info);
$smarty->assign('chartId', $_REQUEST['chartId']);
$smarty->assign('itemId', $_REQUEST['itemId']);
$smarty->assign('info', $info);
if (isset($_REQUEST["delete"])) {
check_ticket('admin-chart-items');
foreach (array_keys($_REQUEST["item"])as $item) {
$chartlib->remove_chart_item($item);
}
check_ticket('admin-chart-items');
foreach(array_keys($_REQUEST["item"]) as $item) {
$chartlib->remove_chart_item($item);
}
}
if (isset($_REQUEST['save'])) {
check_ticket('admin-chart-items');
$vars = array();
$vars['chartId'] = $_REQUEST['chartId'];
$_REQUEST['created'] = $tikilib->now;
foreach (array_keys($info)as $key) {
if (isset($_REQUEST[$key])) {
$vars[$key] = $_REQUEST[$key];
}
}
$itemId = $chartlib->replace_chart_item($_REQUEST['itemId'], $vars);
$info = array(
'title' => '',
'description' => '',
'created' => 0,
'URL' => '',
'votes' => 0,
'points' => 0,
'average' => 0
);
$_REQUEST['itemId'] = 0;
$smarty->assign('itemId', 0);
$smarty->assign('info', $info);
check_ticket('admin-chart-items');
$vars = array();
$vars['chartId'] = $_REQUEST['chartId'];
$_REQUEST['created'] = $tikilib->now;
foreach(array_keys($info) as $key) {
if (isset($_REQUEST[$key])) {
$vars[$key] = $_REQUEST[$key];
}
}
$itemId = $chartlib->replace_chart_item($_REQUEST['itemId'], $vars);
$info = array(
'title' => '',
'description' => '',
'created' => 0,
'URL' => '',
'votes' => 0,
'points' => 0,
'average' => 0
);
$_REQUEST['itemId'] = 0;
$smarty->assign('itemId', 0);
$smarty->assign('info', $info);
}
// the $where is unused for now i think, but beware of using it in the template
// it's a security problem in list_chart_items().
$where = 'chartId = '.$_REQUEST['chartId'];
$where = 'chartId = ' . $_REQUEST['chartId'];
$wherekey = 'chartId';
$whereval = $_REQUEST['chartId'];
if (!isset($_REQUEST["sort_mode"])) {
$sort_mode = 'created_desc';
$sort_mode = 'created_desc';
} else {
$sort_mode = $_REQUEST["sort_mode"];
$sort_mode = $_REQUEST["sort_mode"];
}
if (!isset($_REQUEST["offset"])) {
$offset = 0;
$offset = 0;
} else {
$offset = $_REQUEST["offset"];
$offset = $_REQUEST["offset"];
}
$smarty->assign_by_ref('offset', $offset);
if (isset($_REQUEST["find"])) {
$find = $_REQUEST["find"];
$find = $_REQUEST["find"];
} else {
$find = '';
$find = '';
}
$smarty->assign('find', $find);
$smarty->assign('where', $where);
$smarty->assign_by_ref('sort_mode', $sort_mode);
$items = $chartlib->list_chart_items($offset, $maxRecords, $sort_mode, $find, $wherekey,$whereval);
$items = $chartlib->list_chart_items($offset, $maxRecords, $sort_mode, $find, $wherekey, $whereval);
$smarty->assign('cant', $items['cant']);
$cant_pages = ceil($items["cant"] / $maxRecords);
$smarty->assign_by_ref('cant_pages', $cant_pages);
$smarty->assign('actual_page', 1 + ($offset / $maxRecords));
if ($items["cant"] > ($offset + $maxRecords)) {
$smarty->assign('next_offset', $offset + $maxRecords);
$smarty->assign('next_offset', $offset + $maxRecords);
} else {
$smarty->assign('next_offset', -1);
$smarty->assign('next_offset', -1);
}
if ($offset > 0) {
$smarty->assign('prev_offset', $offset - $maxRecords);
$smarty->assign('prev_offset', $offset - $maxRecords);
} else {
$smarty->assign('prev_offset', -1);
$smarty->assign('prev_offset', -1);
}
$smarty->assign_by_ref('items', $items["data"]);
$sameurl_elements = array(
'offset',
'sort_mode',
'where',
'find',
'chartId',
'itemId'
'offset',
'sort_mode',
'where',
'find',
'chartId',
'itemId'
);
ask_ticket('admin-chart-items');
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
$smarty->assign('mid', 'tiki-admin_chart_items.tpl');
$smarty->display("tiki.tpl");
<?php
// $Id: /cvsroot/tikiwiki/tiki/tiki-admin_charts.php,v 1.19 2007-10-14 15:17:16 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');
include_once('lib/charts/chartlib.php');
require_once ('tiki-setup.php');
include_once ('lib/charts/chartlib.php');
if ($prefs['feature_charts'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_charts");
$smarty->display("error.tpl");
die;
$smarty->assign('msg', tra("This feature is disabled") . ": feature_charts");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_admin_charts != 'y') {
$smarty->assign('msg', tra("Permission denied"));
$smarty->display("error.tpl");
die;
$smarty->assign('msg', tra("Permission denied"));
$smarty->display("error.tpl");
die;
}
if (!isset($_REQUEST['chartId']))
$_REQUEST['chartId'] = 0;
if (!isset($_REQUEST['chartId'])) $_REQUEST['chartId'] = 0;
if ($_REQUEST["chartId"]) {
$info = $chartlib->get_chart($_REQUEST["chartId"]);
$info = $chartlib->get_chart($_REQUEST["chartId"]);
} else {
$info = array(
'title' => '',
'description' => '',
'singleItemVotes' => 'y',
'singleChartVotes' => 'n',
'suggestions' => 'y',
'autoValidate' => 'n',
'topN' => 10,
'maxVoteValue' => 10,
'frequency' => 0,
'isActive' => 'y',
'showAverage' => 'y',
'showVotes' => 'y',
'useCookies' => 'n',
'lastChart' => 0,
'voteAgainAfter' => 7,
'created' => 0
);
$info = array(
'title' => '',
'description' => '',
'singleItemVotes' => 'y',
'singleChartVotes' => 'n',
'suggestions' => 'y',
'autoValidate' => 'n',
'topN' => 10,
'maxVoteValue' => 10,
'frequency' => 0,
'isActive' => 'y',
'showAverage' => 'y',
'showVotes' => 'y',
'useCookies' => 'n',
'lastChart' => 0,
'voteAgainAfter' => 7,
'created' => 0
);
}
$smarty->assign('chartId', $_REQUEST['chartId']);
$smarty->assign('info', $info);
if (isset($_REQUEST["delete"])) {
if (isset($_REQUEST["chart"]))
if (is_array($_REQUEST["chart"])) {
check_ticket('admin-charts');
foreach (array_keys($_REQUEST["chart"])as $item) {
$chartlib->remove_chart($item);
}
}
if (isset($_REQUEST["chart"])) if (is_array($_REQUEST["chart"])) {
check_ticket('admin-charts');
foreach(array_keys($_REQUEST["chart"]) as $item) {
$chartlib->remove_chart($item);
}
}
}
if (isset($_REQUEST['save'])) {
check_ticket('admin-charts');
$vars = array();
$_REQUEST['singleItemVotes'] = isset($_REQUEST['singleItemVotes']) ? 'y' : 'n';
$_REQUEST['isActive'] = isset($_REQUEST['isActive']) ? 'y' : 'n';
$_REQUEST['singleChartVotes'] = isset($_REQUEST['singleChartVotes']) ? 'y' : 'n';
$_REQUEST['suggestions'] = isset($_REQUEST['suggestions']) ? 'y' : 'n';
$_REQUEST['autoValidate'] = isset($_REQUEST['autoValidate']) ? 'y' : 'n';
$_REQUEST['showAverage'] = isset($_REQUEST['showAverage']) ? 'y' : 'n';
$_REQUEST['showVotes'] = isset($_REQUEST['showVotes']) ? 'y' : 'n';
$_REQUEST['useCookies'] = isset($_REQUEST['useCookies']) ? 'y' : 'n';
$_REQUEST['lastChart'] = 0;
$_REQUEST['created'] = $tikilib->now;
$_REQUEST['hits'] = 0;
foreach (array_keys($info)as $key) {
$vars[$key] = $_REQUEST[$key];
}
$chartId = $chartlib->replace_chart($_REQUEST['chartId'], $vars);
$info = array(
'title' => '',
'description' => '',
'singleItemVotes' => 'y',
'singleChartVotes' => 'n',
'suggestions' => 'y',
'autoValidate' => 'n',
'isActive' => 'y',
'topN' => 10,
'maxVoteValue' => 10,
'frequency' => 0,
'showAverage' => 'y',
'showVotes' => 'y',
'useCookies' => 'n',
'lastChart' => 0,
'voteAgainAfter' => 0,
'created' => 0
);
$_REQUEST['chartId'] = 0;
$smarty->assign('chartId', 0);
$smarty->assign('info', $info);
check_ticket('admin-charts');
$vars = array();
$_REQUEST['singleItemVotes'] = isset($_REQUEST['singleItemVotes']) ? 'y' : 'n';
$_REQUEST['isActive'] = isset($_REQUEST['isActive']) ? 'y' : 'n';
$_REQUEST['singleChartVotes'] = isset($_REQUEST['singleChartVotes']) ? 'y' : 'n';
$_REQUEST['suggestions'] = isset($_REQUEST['suggestions']) ? 'y' : 'n';
$_REQUEST['autoValidate'] = isset($_REQUEST['autoValidate']) ? 'y' : 'n';
$_REQUEST['showAverage'] = isset($_REQUEST['showAverage']) ? 'y' : 'n';
$_REQUEST['showVotes'] = isset($_REQUEST['showVotes']) ? 'y' : 'n';
$_REQUEST['useCookies'] = isset($_REQUEST['useCookies']) ? 'y' : 'n';
$_REQUEST['lastChart'] = 0;
$_REQUEST['created'] = $tikilib->now;
$_REQUEST['hits'] = 0;