/[drupal]/contributions/modules/forum_access/forum_access.install
ViewVC logotype

Diff of /contributions/modules/forum_access/forum_access.install

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

revision 1.12, Thu Aug 27 23:44:59 2009 UTC revision 1.13, Sun Sep 20 00:10:16 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: forum_access.install,v 1.11 2009/03/18 22:21:29 salvis Exp $  // $Id: forum_access.install,v 1.12 2009/08/27 23:44:59 salvis Exp $
3    
4  /**  /**
5   * Implementation of hook_install().   * Implementation of hook_install().
# Line 7  Line 7 
7  function forum_access_install() {  function forum_access_install() {
8    drupal_install_schema('forum_access');    drupal_install_schema('forum_access');
9    db_query("UPDATE {system} SET weight = 2 WHERE name = 'forum_access'");    db_query("UPDATE {system} SET weight = 2 WHERE name = 'forum_access'");
10    
11      if ($vid = variable_get('forum_nav_vocabulary', FALSE)) {
12        foreach (array(DRUPAL_ANONYMOUS_RID => 0, DRUPAL_AUTHENTICATED_RID => 1) as $rid => $grant_create) {
13          db_query("
14            INSERT INTO {forum_access} (tid, rid, grant_view, grant_update, grant_delete, grant_create, priority)
15            SELECT t.tid, %d, 1, 0, 0, %d, 0
16              FROM {forum_access} fa RIGHT JOIN {term_data} t ON fa.tid = t.tid AND t.vid = %d AND fa.rid <> %d
17                WHERE fa.tid IS NULL",
18            $rid, $grant_create, DRUPAL_AUTHENTICATED_RID, $vid
19          );
20        }
21      }
22  }  }
23    
24  /**  /**

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.2