[geeklog-hg] geeklog: Added More consistency in autotag behaviour with invali...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Jan 26 03:07:31 EST 2014
changeset 9451:b55b45f5bfea
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/b55b45f5bfea
user: Kenji ITO <mystralkk at gmail.com>
date: Sun Jan 26 17:06:17 2014 +0900
description:
Added More consistency in autotag behaviour with invalid ids or ids the user has no access to (feature request #0001115)
diffstat:
plugins/calendar/functions.inc | 46 +++++++++++++++++++-------------------
plugins/links/functions.inc | 2 +-
plugins/polls/functions.inc | 2 +-
plugins/staticpages/functions.inc | 4 +-
system/lib-story.php | 2 +-
5 files changed, 28 insertions(+), 28 deletions(-)
diffs (226 lines):
diff -r ec1bd5197e06 -r b55b45f5bfea plugins/calendar/functions.inc
--- a/plugins/calendar/functions.inc Sat Jan 25 19:54:46 2014 +0900
+++ b/plugins/calendar/functions.inc Sun Jan 26 17:06:17 2014 +0900
@@ -732,7 +732,7 @@
exit;
}
// otherwise non-admin or admin-personal. do personal form or public submission.
-
+
// Loads jQuery UI datepicker
$_SCRIPTS->setJavaScriptLibrary('jquery.ui.datepicker');
$_SCRIPTS->setJavaScriptLibrary('jquery-ui-i18n');
@@ -1183,13 +1183,13 @@
} elseif ($op == 'description') {
return array (
'event' => $LANG_CAL_1['autotag_desc_event']
- );
+ );
} else if ($op == 'parse') {
$eid = COM_applyFilter($autotag['parm1']);
if (! empty($eid)) {
$result = DB_query("SELECT COUNT(*) AS count "
. "FROM {$_TABLES['events']} "
- . "WHERE eid = '$eid'" . COM_getPermSql('AND'));
+ . "WHERE eid = '$eid'");
$A = DB_fetchArray($result);
if ($A['count'] > 0) {
$url = $_CONF['site_url'] . '/calendar/event.php?eid=' . $eid;
@@ -1612,15 +1612,15 @@
// Set new Tab column to whatever fieldset is
$sql = "UPDATE {$_TABLES['conf_values']} SET tab = fieldset WHERE group_name = 'calendar'";
DB_query($sql);
-
+
calendar_update_ConfValues_1_1_1();
}
-
+
calendar_update_ConfigSecurity_1_1_1();
$current_version = '1.1.2';
break;
-
+
case '1.1.2':
if (isset($_UPDATES[$current_version])) {
$_SQL = $_UPDATES[$current_version];
@@ -1635,12 +1635,12 @@
calendar_update_ConfigSecurity_1_1_2();
calendar_update_Zipcode_1_1_2();
-
+
$current_version = '1.1.3';
break;
case '1.1.3':
-
+
$current_version = '1.1.4';
break;
@@ -2176,9 +2176,9 @@
function plugin_getBlocks_calendar($side, $topic='')
{
global $_TABLES, $_CONF, $_CA_CONF, $LANG_CAL_1;
-
+
$retval = array();
-
+
$owner_id = SEC_getDefaultRootUser();
// Check permissions first
@@ -2188,7 +2188,7 @@
if (($side=='left' && $_CA_CONF['block_isleft'] == 1) || ($side=='right' && $_CA_CONF['block_isleft'] == 0)) {
// Create a block
$display = phpblock_calendar();
-
+
$retval[] = array('name' => 'events',
'type' => 'dynamic',
'onleft' => $_CA_CONF['block_isleft'],
@@ -2200,7 +2200,7 @@
}
}
}
-
+
return $retval;
}
@@ -2220,11 +2220,11 @@
function plugin_getBlocksConfig_calendar($side, $topic='')
{
global $_TABLES, $_CONF, $_CA_CONF, $LANG_CAL_1;
-
+
$retval = array();
-
+
$owner_id = SEC_getDefaultRootUser();
-
+
// Check permissions first
if (SEC_hasAccess($owner_id, $_CA_CONF['block_group_id'], $_CA_CONF['block_permissions'][0], $_CA_CONF['block_permissions'][1], $_CA_CONF['block_permissions'][2], $_CA_CONF['block_permissions'][3])) {
if (($side=='left' && $_CA_CONF['block_isleft'] == 1) || ($side=='right' && $_CA_CONF['block_isleft'] == 0)) {
@@ -2243,7 +2243,7 @@
);
}
}
-
+
return $retval;
}
@@ -2259,7 +2259,7 @@
function plugin_group_changed_calendar($grp_id, $mode)
{
global $_TABLES, $_GROUPS, $_CA_CONF;
-
+
if ($mode == 'delete') {
// Change any deleted group ids to Polls Admin if exist, if does not change to root group
$new_group_id = 0;
@@ -2275,21 +2275,21 @@
}
}
}
-
+
// Update Events with new group id
$sql = "UPDATE {$_TABLES['events']} SET group_id = $new_group_id WHERE group_id = $grp_id";
$result = DB_query($sql);
-
+
// Update Events with new group id
$sql = "UPDATE {$_TABLES['personal_events']} SET group_id = $new_group_id WHERE group_id = $grp_id";
$result = DB_query($sql);
-
+
// Update Events Block group if need be
if ($_CA_CONF['block_group_id'] == $grp_id) {
// Now save it to the configuration
$c = config::get_instance();
$c->set('block_group_id', $new_group_id, 'calendar');
-
+
}
}
}
@@ -2338,7 +2338,7 @@
if ($key > 0) {
// Update config
$_CA_CONF['block_topic'][$key] = $id;
-
+
// Now save it to the configuration
$c = config::get_instance();
$c->set('block_topic', $_CA_CONF['block_topic'], 'calendar');
@@ -2366,7 +2366,7 @@
if ($key > 0) {
// delete item from config
unset($_CA_CONF['block_topic'][$key]);
-
+
// Now save it to the configuration
$c = config::get_instance();
$c->set('block_topic', $_CA_CONF['block_topic'], 'calendar');
diff -r ec1bd5197e06 -r b55b45f5bfea plugins/links/functions.inc
--- a/plugins/links/functions.inc Sat Jan 25 19:54:46 2014 +0900
+++ b/plugins/links/functions.inc Sun Jan 26 17:06:17 2014 +0900
@@ -218,7 +218,7 @@
if (! empty($lid)) {
$result = DB_query("SELECT COUNT(*) AS count "
. "FROM {$_TABLES['links']} "
- . "WHERE lid = '$lid'" . COM_getPermSql('AND'));
+ . "WHERE lid = '$lid'");
$A = DB_fetchArray($result);
if ($A['count'] > 0) {
$url = COM_buildUrl($_CONF['site_url']
diff -r ec1bd5197e06 -r b55b45f5bfea plugins/polls/functions.inc
--- a/plugins/polls/functions.inc Sat Jan 25 19:54:46 2014 +0900
+++ b/plugins/polls/functions.inc Sun Jan 26 17:06:17 2014 +0900
@@ -1582,7 +1582,7 @@
if (! empty($pid)) {
$result = DB_query("SELECT COUNT(*) AS count "
. "FROM {$_TABLES['polltopics']} "
- . "WHERE pid = '$pid'" . COM_getPermSql('AND'));
+ . "WHERE pid = '$pid'");
$A = DB_fetchArray($result);
if ($A['count'] > 0) {
switch ($autotag['tag']) {
diff -r ec1bd5197e06 -r b55b45f5bfea plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc Sat Jan 25 19:54:46 2014 +0900
+++ b/plugins/staticpages/functions.inc Sun Jan 26 17:06:17 2014 +0900
@@ -1292,7 +1292,7 @@
if (! empty($sp_id)) {
$result = DB_query("SELECT COUNT(*) AS count "
. "FROM {$_TABLES['staticpage']} "
- . "WHERE sp_id = '$sp_id'" . COM_getPermSql('AND'));
+ . "WHERE sp_id = '$sp_id'");
$A = DB_fetchArray($result);
if ($A['count'] > 0) {
$url = COM_buildUrl($_CONF['site_url']
@@ -1313,7 +1313,7 @@
if (! empty($sp_id)) {
$result = DB_query("SELECT COUNT(*) AS count "
. "FROM {$_TABLES['staticpage']} "
- . "WHERE sp_id = '$sp_id'" . COM_getPermSql('AND'));
+ . "WHERE sp_id = '$sp_id'");
$A = DB_fetchArray($result);
if ($A['count'] > 0) {
if (isset($recursive[$sp_id])) {
diff -r ec1bd5197e06 -r b55b45f5bfea system/lib-story.php
--- a/system/lib-story.php Sat Jan 25 19:54:46 2014 +0900
+++ b/system/lib-story.php Sun Jan 26 17:06:17 2014 +0900
@@ -1494,7 +1494,7 @@
if (! empty($sid)) {
$result = DB_query("SELECT COUNT(*) AS count "
. "FROM {$_TABLES['stories']} "
- . "WHERE sid = '$sid'" . COM_getPermSql('AND'));
+ . "WHERE sid = '$sid'");
$A = DB_fetchArray($result);
if ($A['count'] > 0) {
More information about the geeklog-cvs
mailing list