/[drupal]/contributions/modules/storm/stormknowledgebase/stormknowledgebase.module
ViewVC logotype

Diff of /contributions/modules/storm/stormknowledgebase/stormknowledgebase.module

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

revision 1.3.4.5, Wed Jul 23 19:37:49 2008 UTC revision 1.3.4.6, Fri Aug 1 08:15:10 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: stormknowledgebase.module,v 1.3.4.4 2008/07/23 14:27:03 robertogerola Exp $  // $Id: stormknowledgebase.module,v 1.3.4.5 2008/07/23 19:37:49 robertogerola Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 93  function stormknowledgebase_access_sql($ Line 93  function stormknowledgebase_access_sql($
93    return storm_rewrite_sql($sql, $where);    return storm_rewrite_sql($sql, $where);
94  }  }
95    
96  function stormknowledgebase_storm_rewrite_where_sql($query, $primary_table ='n', $account = NULL) {  function stormknowledgebase_storm_rewrite_where_sql($query, $primary_table, $account) {
97    static $conds = array();    static $conds = array();
98    
   if (!$account) {  
     global $user;  
     $account = $user;  
   }  
   
99    if ($conds[$account->uid]) {    if ($conds[$account->uid]) {
100      return $conds[$account->uid];      return $conds[$account->uid];
101    }    }
# Line 115  function stormknowledgebase_storm_rewrit Line 110  function stormknowledgebase_storm_rewrit
110    
111      $cond = '';      $cond = '';
112      if (user_access('Storm knowledgebase: view own', $account)) {      if (user_access('Storm knowledgebase: view own', $account)) {
113        $cond .= "${primary_table}.uid=". $account->uid;        $cond .= " ${primary_table}.uid=". $account->uid;
114      }      }
115      if ($cond) {      if ($cond) {
116        $cond = "WHEN 'stormknowledgebase' THEN IF($cond,1,0) ";        $cond = " WHEN 'stormknowledgebase' THEN IF($cond,1,0) ";
117      }      }
118      else {      else {
119        $cond = "WHEN 'stormknowledgebase' THEN 0 ";        $cond = " WHEN 'stormknowledgebase' THEN 0 ";
120      }      }
121    }    }
122    

Legend:
Removed from v.1.3.4.5  
changed lines
  Added in v.1.3.4.6

  ViewVC Help
Powered by ViewVC 1.1.2