fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [17448] add local admin


From: sigurdne
Subject: [Fmsystem-commits] [17448] add local admin
Date: Sat, 16 Dec 2017 11:39:05 -0500 (EST)

Revision: 17448
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17448
Author:   sigurdne
Date:     2017-12-16 11:39:04 -0500 (Sat, 16 Dec 2017)
Log Message:
-----------
add local admin

Modified Paths:
--------------
    trunk/admin/inc/class.menu.inc.php
    trunk/booking/setup/default_records.inc.php
    trunk/phpgwapi/inc/class.acl.inc.php
    trunk/phpgwapi/inc/functions.inc.php

Modified: trunk/admin/inc/class.menu.inc.php
===================================================================
--- trunk/admin/inc/class.menu.inc.php  2017-12-15 17:32:57 UTC (rev 17447)
+++ trunk/admin/inc/class.menu.inc.php  2017-12-16 16:39:04 UTC (rev 17448)
@@ -73,7 +73,7 @@
                                                        'location_id' => 
$GLOBALS['phpgw']->locations->get_id('admin', 'vfs_filedata')
                                                )
                                        )
-                               );      
+                               );
 
                                $menus['admin']['file_attribs'] = array
                                (
@@ -113,8 +113,8 @@
                                                                
array('menuaction' => 'admin.uiaccounts.global_message'))
                                );
                        }
-                        
-                        if ( $GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin'))
+
+                       if ( $GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin'))
                        {
                                $menus['admin']['home_screen_message'] = array
                                (

Modified: trunk/booking/setup/default_records.inc.php
===================================================================
--- trunk/booking/setup/default_records.inc.php 2017-12-15 17:32:57 UTC (rev 
17447)
+++ trunk/booking/setup/default_records.inc.php 2017-12-16 16:39:04 UTC (rev 
17448)
@@ -242,14 +242,14 @@
                $account->lid = 'booking_group';
                $account->firstname = 'Booking';
                $account->lastname = 'Group';
-               $rental_group = $GLOBALS['phpgw']->accounts->create($account, 
array(), array(), $modules);
+               $booking_group = $GLOBALS['phpgw']->accounts->create($account, 
array(), array(), $modules);
        }
        else
        {
-               $rental_group = 
$GLOBALS['phpgw']->accounts->name2id('booking_group');
+               $booking_group = 
$GLOBALS['phpgw']->accounts->name2id('booking_group');
        }
 
-       $aclobj->set_account_id($rental_group, true);
+       $aclobj->set_account_id($booking_group, true);
        $aclobj->add('booking', '.office', 7);
        $aclobj->add('booking', 'run', 1);
        $aclobj->add('property', '.', 1);
@@ -258,3 +258,28 @@
        $aclobj->add('preferences', '.', 1);
        $aclobj->add('preferences', 'run', 1);
        $aclobj->save_repository();
+
+       if (!$GLOBALS['phpgw']->accounts->exists('booking_admin'))
+       {
+               $account = new phpgwapi_group();
+               $account->lid = 'booking_admin';
+               $account->firstname = 'Booking Admin';
+               $account->lastname = 'Group';
+               $booking_admin = $GLOBALS['phpgw']->accounts->create($account, 
array(), array(), $modules);
+       }
+       else
+       {
+               $booking_admin = 
$GLOBALS['phpgw']->accounts->name2id('booking_admin');
+       }
+
+       $aclobj->set_account_id($booking_admin, true);
+       $aclobj->add('booking', 'admin', 15);
+       $aclobj->add('booking', '.office', 15);
+       $aclobj->add('booking', 'run', 1);
+       $aclobj->add('property', 'admin', 15);
+       $aclobj->add('property', '.', 1);
+       $aclobj->add('property', 'run', 1);
+       $aclobj->add('preferences', 'changepassword', 1);
+       $aclobj->add('preferences', '.', 1);
+       $aclobj->add('preferences', 'run', 1);
+       $aclobj->save_repository();

Modified: trunk/phpgwapi/inc/class.acl.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.acl.inc.php        2017-12-15 17:32:57 UTC (rev 
17447)
+++ trunk/phpgwapi/inc/class.acl.inc.php        2017-12-16 16:39:04 UTC (rev 
17448)
@@ -1172,11 +1172,13 @@
                        $rights = 0;
                        $apps = array();
 
-                       $sql = 'SELECT phpgw_applications.app_name, 
phpgw_acl.acl_rights FROM phpgw_acl'
+                       $sql = 'SELECT DISTINCT phpgw_applications.app_name, 
phpgw_acl.acl_rights FROM phpgw_acl'
                                . " {$this->_join} phpgw_locations ON 
phpgw_acl.location_id = phpgw_locations.location_id"
                                . " {$this->_join} phpgw_applications ON 
phpgw_locations.app_id = phpgw_applications.app_id"
+                               . " {$this->_left_join}  phpgw_group_map ON 
(phpgw_acl.acl_account = phpgw_group_map.group_id)"
                                . " WHERE phpgw_locations.name = '{$location}'"
-                                       . " AND acl_account = {$account_id}";
+                               . " AND (acl_account = {$account_id} OR 
account_id = {$account_id})";
+
                        $this->_db->query($sql, __LINE__, __FILE__);
 
                        while ($this->_db->next_record())

Modified: trunk/phpgwapi/inc/functions.inc.php
===================================================================
--- trunk/phpgwapi/inc/functions.inc.php        2017-12-15 17:32:57 UTC (rev 
17447)
+++ trunk/phpgwapi/inc/functions.inc.php        2017-12-16 16:39:04 UTC (rev 
17448)
@@ -943,7 +943,7 @@
                        if (!$GLOBALS['phpgw']->acl->check('run', 
PHPGW_ACL_READ, $GLOBALS['phpgw_info']['flags']['currentapp']))
                        {
                                $_access = false;
-                               if 
($GLOBALS['phpgw_info']['flags']['currentapp'] == 'admin' && 
$GLOBALS['phpgw']->acl->get_app_list_for_id('admin', phpgwapi_acl::ADD, 
$GLOBALS['phpgw_info']['user']['userid']))
+                               if 
($GLOBALS['phpgw_info']['flags']['currentapp'] == 'admin' && 
$GLOBALS['phpgw']->acl->get_app_list_for_id('admin', phpgwapi_acl::ADD, 
$GLOBALS['phpgw_info']['user']['account_id']))
                                {
                                        $_access = true;
                                }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]