You are here

function tac_lite_update_6001 in Taxonomy Access Control Lite 6

Same name and namespace in other branches
  1. 7 tac_lite.install \tac_lite_update_6001()

Rename permission from "administer_tac_lite" to "administer tac_lite" for UI consistency.

File

./tac_lite.install, line 62
Installation functions for tac_lite.

Code

function tac_lite_update_6001() {
  $ret = array();
  $result = db_query("SELECT * FROM {permission} WHERE perm LIKE '%administer_tac_lite%'");
  while ($permission = db_fetch_object($result)) {
    $perm = str_replace('administer_tac_lite', 'administer tac_lite', $permission->perm);
    $ret[] = update_sql("UPDATE {permission} SET perm = '" . db_escape_string($perm) . "' WHERE rid =" . $permission->rid);
  }
  return $ret;
}