[geeklog-cvs] Geeklog-1.x/sql/updates mysql_1.4.1_to_1.5.0.php, 1.46, 1.47
Dirk Haun
dhaun at qs1489.pair.com
Sun Jan 6 15:44:13 EST 2008
Update of /cvsroot/geeklog/Geeklog-1.x/sql/updates
In directory qs1489.pair.com:/tmp/cvs-serv70631/sql/updates
Modified Files:
mysql_1.4.1_to_1.5.0.php
Log Message:
It is now possible to restrict access to the Webservices to users with 'webservices.atompub' rights
Index: mysql_1.4.1_to_1.5.0.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/sql/updates/mysql_1.4.1_to_1.5.0.php,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** mysql_1.4.1_to_1.5.0.php 6 Jan 2008 11:57:13 -0000 1.46
--- mysql_1.4.1_to_1.5.0.php 6 Jan 2008 20:44:11 -0000 1.47
***************
*** 21,24 ****
--- 21,31 ----
$_SQL[] = "ALTER TABLE {$_TABLES['blocks']} ADD rdf_etag VARCHAR(40) DEFAULT NULL AFTER rdf_last_modified";
+ // new 'webservices.atompub' feature
+ $_SQL[] = "INSERT INTO {$_TABLES['features']} (ft_name, ft_descr, ft_gl_core) VALUES ('webservices.atompub', 'May use Atompub Webservices (if restricted)', 1)";
+
+ // add the 'Webservices Users' group
+ $_SQL[] = "INSERT INTO {$_TABLES['groups']} (grp_name, grp_descr, grp_gl_core) VALUES ('Webservices Users', 'Can use the Webservices API (if restricted)', 0)";
+
+
function create_ConfValues()
{
***************
*** 429,432 ****
--- 436,461 ----
return true;
+ }
+
+ // add the new 'webservices.atompub' feature and the 'Webservices Users' group
+ function upgrade_addWebservicesFeature()
+ {
+ global $_TABLES;
+
+ $ft_id = DB_getItem($_TABLES['features'], 'ft_id',
+ "ft_name = 'webservices.atompub'");
+ $grp_id = DB_getItem($_TABLES['groups'], 'grp_id',
+ "grp_name = 'Webservices Users'");
+ $rootgrp = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Root'");
+
+ if (($grp_id > 0) && ($ft_id > 0)) {
+ // add 'webservices.atompub' feature to 'Webservices Users' group
+ DB_query("INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($ft_id, $grp_id)");
+
+ // make 'Root' members a member of 'Webservices Users'
+ if ($rootgrp > 0) {
+ DB_query("INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid, ug_grp_id) VALUES ($grp_id, NULL, $rootgrp)");
+ }
+ }
}
More information about the geeklog-cvs
mailing list