[geeklog-hg] geeklog: For XMLSitemap Plugin added ping tab security to instal...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Mon Feb 17 14:51:38 EST 2014
changeset 9498:f4fe62e4e893
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/f4fe62e4e893
user: Tom <websitemaster at cogeco.net>
date: Mon Feb 17 14:50:13 2014 -0500
description:
For XMLSitemap Plugin added ping tab security to install and upgrade. On uninstall added removing of xmlsitemap.pings Geeklog variable
diffstat:
plugins/xmlsitemap/autoinstall.php | 6 ++++--
plugins/xmlsitemap/functions.inc | 12 ++++++++++--
plugins/xmlsitemap/sql/mssql_updates.php | 32 ++++++++++++++++++++++++++++++--
plugins/xmlsitemap/sql/mysql_updates.php | 30 +++++++++++++++++++++++++++++-
plugins/xmlsitemap/sql/pgsql_updates.php | 30 +++++++++++++++++++++++++++++-
5 files changed, 102 insertions(+), 8 deletions(-)
diffs (199 lines):
diff -r 86a0f4c9c19d -r f4fe62e4e893 plugins/xmlsitemap/autoinstall.php
--- a/plugins/xmlsitemap/autoinstall.php Mon Feb 17 14:29:17 2014 -0500
+++ b/plugins/xmlsitemap/autoinstall.php Mon Feb 17 14:50:13 2014 -0500
@@ -64,13 +64,15 @@
$features = array(
'config.' . $pi_name . '.tab_main' => 'Access to configure general XMLSitemap settings',
'config.' . $pi_name . '.tab_pri' => 'Access to configure XMLSitemap priorities',
- 'config.' . $pi_name . '.tab_freq' => 'Access to configure XMLSitemap update frequency'
+ 'config.' . $pi_name . '.tab_freq' => 'Access to configure XMLSitemap update frequency',
+ 'config.' . $pi_name . '.tab_ping' => 'Access to configure XMLSitemap pings'
);
$mappings = array(
'config.' . $pi_name . '.tab_main' => array($pi_admin),
'config.' . $pi_name . '.tab_pri' => array($pi_admin),
- 'config.' . $pi_name . '.tab_freq' => array($pi_admin)
+ 'config.' . $pi_name . '.tab_freq' => array($pi_admin),
+ 'config.' . $pi_name . '.tab_ping' => array($pi_admin)
);
$inst_parms = array(
diff -r 86a0f4c9c19d -r f4fe62e4e893 plugins/xmlsitemap/functions.inc
--- a/plugins/xmlsitemap/functions.inc Mon Feb 17 14:29:17 2014 -0500
+++ b/plugins/xmlsitemap/functions.inc Mon Feb 17 14:50:13 2014 -0500
@@ -125,7 +125,14 @@
break;
case '1.0.1':
+ if (isset($_UPDATES[$current_version])) {
+ $_SQL = $_UPDATES[$current_version];
+ foreach ($_SQL as $sql) {
+ DB_query($sql);
+ }
+ }
xmlsitemap_update_ConfValues_1_0_1();
+ xmlsitemap_update_ConfigSecurity_1_0_1();
$current_version = '2.0.0';
break;
@@ -158,11 +165,12 @@
/* give the full name of the feature, as in the db */
'features' => array('config.xmlsitemap.tab_main',
'config.xmlsitemap.tab_pri',
- 'config.xmlsitemap.tab_freq'),
+ 'config.xmlsitemap.tab_freq',
+ 'config.xmlsitemap.tab_ping'),
/* give the full name of the block, including 'phpblock_', etc */
'php_blocks' => array(),
/* give all vars with their name */
- 'vars' => array('xmlsitemap_filename', 'xmlsitemap_mobile'),
+ 'vars' => array('xmlsitemap_filename', 'xmlsitemap_mobile', 'xmlsitemap.pings'),
);
XMLSITEMAP_removeSitemapFiles();
diff -r 86a0f4c9c19d -r f4fe62e4e893 plugins/xmlsitemap/sql/mssql_updates.php
--- a/plugins/xmlsitemap/sql/mssql_updates.php Mon Feb 17 14:29:17 2014 -0500
+++ b/plugins/xmlsitemap/sql/mssql_updates.php Mon Feb 17 14:50:13 2014 -0500
@@ -34,7 +34,7 @@
*/
$_UPDATES = array(
-
+
'1.0.0' => array(
// Set new Tab column to whatever fieldset is
"UPDATE {$_TABLES['conf_values']} SET tab = fieldset WHERE group_name = 'xmlsitemap'",
@@ -42,8 +42,11 @@
"INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_main', 'Access to configure general XMLSitemap settings', 0)",
"INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_pri', 'Access to configure XMLSitemap priorities', 0)",
"INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_freq', 'Access to configure XMLSitemap update frequency', 0)"
+ ),
+ '1.0.1' => array(
+ "INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_freq', 'Access to configure XMLSitemap update ping', 0)"
)
-
+
);
/**
@@ -98,4 +101,29 @@
}
+/**
+ * Add is new security rights for the Group "XMLSitemap Admin"
+ *
+ */
+function xmlsitemap_update_ConfigSecurity_1_0_1()
+{
+ global $_TABLES;
+
+ // Add in security rights for XMLSitemap Admin
+ $group_id = DB_getItem($_TABLES['groups'], 'grp_id',
+ "grp_name = 'XMLSitemap Admin'");
+
+ if ($group_id > 0) {
+ $ft_name = 'config.xmlsitemap.tab_ping';
+
+ $ft_id = DB_getItem($_TABLES['features'], 'ft_id',
+ "ft_name = '$ft_name'");
+ if ($ft_id > 0) {
+ $sql = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($ft_id, $group_id)";
+ DB_query($sql);
+ }
+ }
+
+}
+
?>
diff -r 86a0f4c9c19d -r f4fe62e4e893 plugins/xmlsitemap/sql/mysql_updates.php
--- a/plugins/xmlsitemap/sql/mysql_updates.php Mon Feb 17 14:29:17 2014 -0500
+++ b/plugins/xmlsitemap/sql/mysql_updates.php Mon Feb 17 14:50:13 2014 -0500
@@ -42,7 +42,10 @@
"INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_main', 'Access to configure general XMLSitemap settings', 0)",
"INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_pri', 'Access to configure XMLSitemap priorities', 0)",
"INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_freq', 'Access to configure XMLSitemap update frequency', 0)"
- )
+ ),
+ '1.0.1' => array(
+ "INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_ping', 'Access to configure XMLSitemap ping', 0)"
+ )
);
@@ -98,4 +101,29 @@
}
+/**
+ * Add is new security rights for the Group "XMLSitemap Admin"
+ *
+ */
+function xmlsitemap_update_ConfigSecurity_1_0_1()
+{
+ global $_TABLES;
+
+ // Add in security rights for XMLSitemap Admin
+ $group_id = DB_getItem($_TABLES['groups'], 'grp_id',
+ "grp_name = 'XMLSitemap Admin'");
+
+ if ($group_id > 0) {
+ $ft_name = 'config.xmlsitemap.tab_ping';
+
+ $ft_id = DB_getItem($_TABLES['features'], 'ft_id',
+ "ft_name = '$ft_name'");
+ if ($ft_id > 0) {
+ $sql = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($ft_id, $group_id)";
+ DB_query($sql);
+ }
+ }
+
+}
+
?>
diff -r 86a0f4c9c19d -r f4fe62e4e893 plugins/xmlsitemap/sql/pgsql_updates.php
--- a/plugins/xmlsitemap/sql/pgsql_updates.php Mon Feb 17 14:29:17 2014 -0500
+++ b/plugins/xmlsitemap/sql/pgsql_updates.php Mon Feb 17 14:50:13 2014 -0500
@@ -42,7 +42,10 @@
"INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_main', 'Access to configure general XMLSitemap settings', 0)",
"INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_pri', 'Access to configure XMLSitemap priorities', 0)",
"INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_freq', 'Access to configure XMLSitemap update frequency', 0)"
- )
+ ),
+ '1.0.1' => array(
+ "INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('config.xmlsitemap.tab_freq', 'Access to configure XMLSitemap update ping', 0)"
+ )
);
@@ -98,4 +101,29 @@
}
+/**
+ * Add is new security rights for the Group "XMLSitemap Admin"
+ *
+ */
+function xmlsitemap_update_ConfigSecurity_1_0_1()
+{
+ global $_TABLES;
+
+ // Add in security rights for XMLSitemap Admin
+ $group_id = DB_getItem($_TABLES['groups'], 'grp_id',
+ "grp_name = 'XMLSitemap Admin'");
+
+ if ($group_id > 0) {
+ $ft_name = 'config.xmlsitemap.tab_ping';
+
+ $ft_id = DB_getItem($_TABLES['features'], 'ft_id',
+ "ft_name = '$ft_name'");
+ if ($ft_id > 0) {
+ $sql = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($ft_id, $group_id)";
+ DB_query($sql);
+ }
+ }
+
+}
+
?>
More information about the geeklog-cvs
mailing list