/[drupal]/contributions/modules/gmap/gmap_macro_builder.install
ViewVC logotype

Contents of /contributions/modules/gmap/gmap_macro_builder.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Mon Nov 24 17:49:55 2008 UTC (12 months ago) by bdragon
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, DRUPAL-6--1-1-RC1, HEAD
Branch point for: DRUPAL-5
File MIME type: text/x-php
#338511, reported by goba: Rename "create macro" permission to "create gmap macro".
1 <?php
2 // $Id$
3
4 /**
5 * @file
6 * Install / update routines for gmap_macro_builder.
7 */
8
9 /**
10 * Rename 'create macro' permission.
11 */
12 function gmap_macro_builder_update_6100() {
13 $ret = array();
14 $result = db_query('SELECT pid, perm FROM {permission}');
15 while ($row = db_fetch_object($result)) {
16 // We leave "create macro" in for now just in case someone else already had that permission.
17 // It should get removed automatically the next time an admin tweaks the permissions.
18 $permissions = explode(', ', $row->perm);
19 if (in_array('create macro', $permissions) && !in_array('create gmap macro', $permissions)) {
20 $permissions[] = 'create gmap macro';
21 }
22 $permissions = implode(', ', $permissions);
23 db_query("UPDATE {permission} SET perm = '%s' WHERE pid = %d", $permissions, $row->pid);
24 }
25 return $ret;
26 }

  ViewVC Help
Powered by ViewVC 1.1.2