function biblio_update_6020 in Bibliography Module 6.2
Same name and namespace in other branches
- 6 biblio.install \biblio_update_6020()
Update ...
This update function ...
Return value
array An array of associaive arrays with 'success' and 'query' keys.
File
- ./biblio.install, line 2350 
- Install, update, and uninstall functions for the biblio module.
Code
function biblio_update_6020() {
  // add new 'access biblio content' permission to any role which has 'access content'
  $result = array();
  $dbresult = db_query('SELECT p.* FROM {permission} p');
  while ($role = db_fetch_object($dbresult)) {
    if (strpos($role->perm, 'access content') !== FALSE) {
      $role->perm = 'access biblio content, ' . $role->perm;
      $result[] = update_sql("UPDATE {permission} SET perm = '{$role->perm}' WHERE rid = {$role->rid}");
    }
  }
  return $result;
}