source: trunk/news_admin/inc/class.soacl.inc.php @ 45

Revision 45, 2.1 KB checked in by niltonneto, 17 years ago (diff)

Implementação do FCKEDITOR na edição de artigos no news_admin, para permitir texto rico.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2        /**************************************************************************\
3        * eGroupWare - News                                                        *
4        * http://www.egroupware.org                                                *
5        * --------------------------------------------                             *
6        *  This program is free software; you can redistribute it and/or modify it *
7        *  under the terms of the GNU General Public License as published by the   *
8        *  Free Software Foundation; either version 2 of the License, or (at your  *
9        *  option) any later version.                                              *
10        * --------------------------------------------                             *
11        \**************************************************************************/
12
13        /* $Id$ */
14
15        class soacl
16        {
17                var $db;
18
19                function soacl()
20                {
21                        copyobj($GLOBALS['phpgw']->db,$this->db);
22                }
23
24                function get_rights($location)
25                {
26                        $result = array();
27                        $sql = "SELECT acl_account, acl_rights from phpgw_acl WHERE acl_appname = 'news_admin' AND acl_location = '$location'";
28                        $this->db->query($sql,__LINE__,__FILE__);
29                        while($this->db->next_record())
30                        {
31                                $result[$this->db->f('acl_account')] = $this->db->f('acl_rights');
32                        }
33                        return $result;
34                }
35
36                function remove_location($location)
37                {
38                        $sql = "delete from phpgw_acl where acl_appname='news_admin' and acl_location='$location'";
39                        $this->db->query($sql,__LINE__,__FILE__);
40                }
41
42                function get_permissions($user, $inc_groups)
43                {
44                        $groups = $GLOBALS['phpgw']->acl->get_location_list_for_id('phpgw_group', 1, $user);
45                        $result = array();
46                        $sql  = 'SELECT acl_location, acl_rights FROM phpgw_acl ';
47                        $sql .= "WHERE acl_appname = 'news_admin' ";
48                        if($inc_groups)
49                        {
50                                $sql .= 'AND acl_account IN('. (int)$user;
51                                $sql .= ($groups ? ',' . implode(',', $groups) : '');
52                                $sql .= ')';
53                        }
54                        else
55                        {
56                                $sql .= 'AND acl_account ='. (int)$user;
57                        }
58                        $this->db->query($sql,__LINE__,__FILE__);
59                        while ($this->db->next_record())
60                        {
61                                $result[$this->db->f('acl_location')] |= $this->db->f('acl_rights');
62                        }
63                        return $result;
64                }
65        }
Note: See TracBrowser for help on using the repository browser.