[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: admin/inc class.boaccounts.inc.php,1.29,1.30 cla
From: |
Bettina Gille <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: admin/inc class.boaccounts.inc.php,1.29,1.30 class.uiaccounts.inc.php,1.31,1.32 hook_admin.inc.php,1.29,1.30 |
Date: |
Wed, 23 Apr 2003 17:52:24 -0400 |
Update of /cvsroot/phpgroupware/admin/inc
In directory subversions:/tmp/cvs-serv12316/inc
Modified Files:
class.boaccounts.inc.php class.uiaccounts.inc.php
hook_admin.inc.php
Log Message:
porting admin to xslt
Index: class.boaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.boaccounts.inc.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** class.boaccounts.inc.php 23 Apr 2003 01:08:31 -0000 1.29
--- class.boaccounts.inc.php 23 Apr 2003 21:52:21 -0000 1.30
***************
*** 79,82 ****
--- 79,100 ----
}
+ function check_rights($action, $access = 'group_access')
+ {
+ switch($action)
+ {
+ case 'view': $right = '8'; break;
+ case 'add': $right = '4'; break;
+ case 'edit': $right = '16'; break;
+ case 'delete': $right = '32'; break;
+ case 'search': $right = '2'; break;
+ }
+
+ if
(!$GLOBALS['phpgw']->acl->check($access,$right,'admin'))
+ {
+ return True;
+ }
+ return False;
+ }
+
function delete_group($account_id)
{
Index: class.uiaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uiaccounts.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** class.uiaccounts.inc.php 23 Apr 2003 01:08:32 -0000 1.31
--- class.uiaccounts.inc.php 23 Apr 2003 21:52:21 -0000 1.32
***************
*** 66,69 ****
--- 66,71 ----
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'nextmatchs'));
+ /* what should this be for??? this is the same call for both cases! can this
be removed? [ceb] */
+
if
($GLOBALS['phpgw']->acl->check('group_access',2,'admin'))
{
***************
*** 92,129 ****
);
- if (!
$GLOBALS['phpgw']->acl->check('group_access',8,'admin'))
- {
- $can_view = True;
- }
-
- if (!
$GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
- {
- $can_edit = True;
- }
-
- if (!
$GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
- {
- $can_delete = True;
- }
-
while (list($null,$account) = each($account_info))
{
$group_data[] = Array
(
! 'edit_url'
=>
($can_edit?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.edit_group&account_id='
. $account['account_id']):''),
! 'lang_edit'
=> ($can_edit?lang('edit'):''),
! 'lang_edit_statustext' =>
($can_edit?lang('edit this group'):''),
'group_name'
=> (!$account['account_lid']?'':$account['account_lid']),
! 'delete_url'
=>
($can_delete?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_group&account_id='
. $account['account_id']):''),
! 'lang_delete_statustext' =>
($can_delete?lang('delete this group'):''),
! 'lang_delete'
=> ($can_delete?lang('delete'):'')
);
}
- if (!
$GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
- {
- $add_access = 'yes';
- }
-
$group_add = array
(
--- 94,111 ----
);
while (list($null,$account) = each($account_info))
{
$group_data[] = Array
(
! 'edit_url'
=>
($this->bo->check_rights('edit')?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.edit_group&account_id='
. $account['account_id']):''),
! 'lang_edit'
=> ($this->bo->check_rights('edit')?lang('edit'):''),
! 'lang_edit_statustext' =>
($this->bo->check_rights('edit')?lang('edit this group'):''),
'group_name'
=> (!$account['account_lid']?'':$account['account_lid']),
! 'delete_url'
=>
($this->bo->check_rights('delete')?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_group&account_id='
. $account['account_id']):''),
! 'lang_delete_statustext' =>
($this->bo->check_rights('delete')?lang('delete this group'):''),
! 'lang_delete'
=> ($this->bo->check_rights('delete')?lang('delete'):'')
);
}
$group_add = array
(
***************
*** 134,145 ****
'lang_done_statustext' => lang('return to
admin mainscreen'),
'done_url' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.mainscreen'),
! 'add_access' => $add_access,
);
- if (!
$GLOBALS['phpgw']->acl->check('group_access',2,'admin'))
- {
- $search_access = 'yes';
- }
-
$data = array
(
--- 116,122 ----
'lang_done_statustext' => lang('return to
admin mainscreen'),
'done_url' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.mainscreen'),
! 'add_access' =>
($this->bo->check_rights('add')?'yes':''),
);
$data = array
(
***************
*** 155,163 ****
'query'
=> $query,
'lang_search'
=> lang('search'),
- 'lang_groups'
=> lang('user groups'),
'group_header'
=> $group_header,
'group_data'
=> $group_data,
'group_add'
=> $group_add,
! 'search_access'
=> $search_access
);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('group_list' => $data));
--- 132,139 ----
'query'
=> $query,
'lang_search'
=> lang('search'),
'group_header'
=> $group_header,
'group_data'
=> $group_data,
'group_add'
=> $group_add,
! 'search_access'
=> ($this->bo->check_rights('search')?'yes':'')
);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('group_list' => $data));
***************
*** 196,214 ****
$sort = 'ASC';
}
!
! unset($GLOBALS['phpgw_info']['flags']['noheader']);
! unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
! $GLOBALS['phpgw']->common->phpgw_header();
!
! $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
!
! $p->set_file(
! Array(
! 'accounts' => 'accounts.tpl'
! )
! );
! $p->set_block('accounts','list','list');
! $p->set_block('accounts','row','row');
! $p->set_block('accounts','row_empty','row_empty');
if
($GLOBALS['phpgw']->acl->check('account_access',2,'admin'))
--- 172,183 ----
$sort = 'ASC';
}
!
! $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('administration') . ': ' . lang('list users');
!
!
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data','users',
!
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'search_field',
!
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'nextmatchs'));
!
! /* the same like in groups... we really should remove this... :) [ceb] */
if
($GLOBALS['phpgw']->acl->check('account_access',2,'admin'))
***************
*** 223,321 ****
}
! $url =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users');
!
! $var = Array(
! 'bg_color' =>
$GLOBALS['phpgw_info']['theme']['bg_color'],
! 'th_bg' =>
$GLOBALS['phpgw_info']['theme']['th_bg'],
! 'left_next_matchs' =>
$this->nextmatchs->left($url,$start,$total,'menuaction=admin.uiaccounts.list_users'),
! 'lang_user_accounts' => lang('user accounts'),
! 'right_next_matchs' =>
$this->nextmatchs->right($url,$start,$total,'menuaction=admin.uiaccounts.list_users'),
! 'lang_loginid' =>
$this->nextmatchs->show_sort_order($sort,'account_lid',$order,$url,lang('LoginID')),
! 'lang_lastname' =>
$this->nextmatchs->show_sort_order($sort,'account_lastname',$order,$url,lang('last
name')),
! 'lang_firstname' =>
$this->nextmatchs->show_sort_order($sort,'account_firstname',$order,$url,lang('first
name')),
! 'lang_edit' => lang('edit'),
! 'lang_delete' => lang('delete'),
! 'lang_view' => lang('view'),
! 'actionurl' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.add_user'),
! 'accounts_url' => $url,
! 'lang_search' => lang('search'),
! 'lang_done' => lang('Done'),
! 'doneurl' =>
$GLOBALS['phpgw']->link('/admin/index.php')
);
- $p->set_var($var);
! if (!
$GLOBALS['phpgw']->acl->check('account_access',4,'admin'))
{
! $p->set_var('input_add','<input type="submit"
value="' . lang('Add') . '">');
}
! if (!
$GLOBALS['phpgw']->acl->check('account_access',2,'admin'))
! {
! $p->set_var('input_search',lang('Search') .
' <input type="text" name="query">');
! }
! if (!count($account_info) || !$total)
! {
! $p->set_var('message',lang('No matches found'));
! $p->parse('rows','row_empty',True);
! }
! else
! {
! if (!
$GLOBALS['phpgw']->acl->check('account_access',8,'admin'))
! {
! $can_view = True;
! }
!
! if (!
$GLOBALS['phpgw']->acl->check('account_access',16,'admin'))
! {
! $can_edit = True;
! }
!
! if (!
$GLOBALS['phpgw']->acl->check('account_access',32,'admin'))
! {
! $can_delete = True;
! }
!
! while (list($null,$account) =
each($account_info))
! {
!
$this->nextmatchs->template_alternate_row_color($p);
!
! $var = array(
! 'row_loginid' =>
$account['account_lid'],
! 'row_firstname' =>
(!$account['account_firstname']?' ':$account['account_firstname']),
! 'row_lastname' =>
(!$account['account_lastname']?' ':$account['account_lastname'])
! );
! $p->set_var($var);
!
! if ($can_edit)
! {
!
$p->set_var('row_edit',$this->row_action('edit','user',$account['account_id']));
! }
! else
! {
!
$p->set_var('row_edit',' ');
! }
!
! if ($can_delete)
! {
!
$p->set_var('row_delete',($GLOBALS['phpgw_info']['user']['userid'] !=
$account['account_lid']?$this->row_action('delete','user',$account['account_id']):' '));
! }
! else
! {
!
$p->set_var('row_delete',' ');
! }
!
! if ($can_view)
! {
!
$p->set_var('row_view',$this->row_action('view','user',$account['account_id']));
! }
! else
! {
!
$p->set_var('row_view',' ');
! }
! $p->parse('rows','row',True);
! }
! } // End else
! $p->pfp('out','list');
}
--- 192,276 ----
}
! $user_header = array
! (
! 'sort_lid' =>
$this->nextmatchs->show_sort_order(array
!
(
!
'sort' => $sort,
!
'var' => 'account_lid',
!
'order' => $order,
!
'extra' => 'menuaction=admin.uiaccounts.list_users'
!
)),
! 'lang_lid' =>
lang('loginid'),
! 'sort_lastname' =>
$this->nextmatchs->show_sort_order(array
!
(
!
'sort' => $sort,
!
'var' => 'account_lastname',
!
'order' => $order,
!
'extra' => 'menuaction=admin.uiaccounts.list_users'
!
)),
! 'lang_lastname' =>
lang('Lastname'),
! 'sort_firstname' =>
$this->nextmatchs->show_sort_order(array
!
(
!
'sort' => $sort,
!
'var' => 'account_firstname',
!
'order' => $order,
!
'extra' => 'menuaction=admin.uiaccounts.list_users'
!
)),
! 'lang_firstname' =>
lang('firstname'),
! 'lang_view' =>
lang('view'),
! 'lang_edit' =>
lang('edit'),
! 'lang_delete' =>
lang('delete'),
! 'lang_sort_statustext' => lang('sort the
entries')
);
! while (list($null,$account) = each($account_info))
{
! $user_data[] = Array
! (
! 'view_url'
=>
($this->bo->check_rights('view','account_access')?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.view_user&account_id='
. $account['account_id']):''),
! 'lang_view'
=> ($this->bo->check_rights('view','account_access')?lang('view'):''),
! 'lang_view_statustext' =>
($this->bo->check_rights('view','account_access')?lang('view this user'):''),
! 'edit_url'
=>
($this->bo->check_rights('edit','account_access')?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.edit_user&account_id='
. $account['account_id']):''),
! 'lang_edit'
=> ($this->bo->check_rights('edit','account_access')?lang('edit'):''),
! 'lang_edit_statustext' =>
($this->bo->check_rights('edit','account_access')?lang('edit this user'):''),
! 'lid'
=> (!$account['account_lid']?'':$account['account_lid']),
! 'firstname'
=> (!$account['account_firstname']?'':$account['account_firstname']),
! 'lastname'
=> (!$account['account_lastname']?'':$account['account_lastname']),
! 'delete_url'
=>
($this->bo->check_rights('delete','account_access')?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_user&account_id='
. $account['account_id']):''),
! 'lang_delete_statustext' =>
($this->bo->check_rights('delete','account_access')?lang('delete this
user'):''),
! 'lang_delete'
=> ($this->bo->check_rights('delete','account_access')?lang('delete'):'')
! );
}
! $user_add = array
! (
! 'lang_add' =>
lang('add'),
! 'lang_add_statustext' => lang('add a user'),
! 'add_url' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.edit_user'),
! 'lang_done' =>
lang('done'),
! 'lang_done_statustext' => lang('return to
admin mainscreen'),
! 'done_url' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.mainscreen'),
! 'add_access' =>
($this->bo->check_rights('add','account_access')?'yes':''),
! );
! $data = array
! (
! 'start_record'
=> $start,
! 'record_limit'
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
! 'num_records'
=> count($account_info),
! 'all_records'
=> $total,
! 'nextmatchs_url'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'),
! 'nextmatchs_img_path' =>
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
! 'select_url'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users'),
! 'lang_searchfield_statustext' => lang('Enter
the search string. To show all entries, empty this field and press the SUBMIT
button again'),
! 'lang_searchbutton_statustext' => lang('Submit
the search string'),
! 'query'
=> $query,
! 'lang_search'
=> lang('search'),
! 'user_header'
=> $user_header,
! 'user_data'
=> $user_data,
! 'user_add'
=> $user_add,
! 'search_access'
=> ($this->bo->check_rights('search','account_access')?'yes':'')
! );
!
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('account_list' => $data));
}
Index: hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/hook_admin.inc.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** hook_admin.inc.php 23 Apr 2003 01:08:32 -0000 1.29
--- hook_admin.inc.php 23 Apr 2003 21:52:21 -0000 1.30
***************
*** 9,43 ****
* option) any later version.
*
\**************************************************************************/
-
/* $Id$ */
if (! $GLOBALS['phpgw']->acl->check('site_config_access',1,'admin'))
{
! $file['Site Configuration'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=admin');
}
if (! $GLOBALS['phpgw']->acl->check('peer_server_access',1,'admin'))
{
! $file['Peer Servers'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiserver.list_servers');
}
if (! $GLOBALS['phpgw']->acl->check('account_access',1,'admin'))
{
! $file['User Accounts'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users');
}
if (! $GLOBALS['phpgw']->acl->check('group_access',1,'admin'))
{
! $file['User Groups'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups');
}
if (! $GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
{
! $file['Applications'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list');
}
if (!
$GLOBALS['phpgw']->acl->check('global_categories_access',1,'admin'))
{
! $file['Global Categories'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index');
}
--- 9,42 ----
* option) any later version.
*
\**************************************************************************/
/* $Id$ */
if (! $GLOBALS['phpgw']->acl->check('site_config_access',1,'admin'))
{
! $file['Site Configuration'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=admin');
}
if (! $GLOBALS['phpgw']->acl->check('peer_server_access',1,'admin'))
{
! $file['Peer Servers'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiserver.list_servers');
}
if (! $GLOBALS['phpgw']->acl->check('account_access',1,'admin'))
{
! $file['User Accounts'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_users');
}
if (! $GLOBALS['phpgw']->acl->check('group_access',1,'admin'))
{
! $file['User Groups'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups');
}
if (! $GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
{
! $file['Applications'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list');
}
if (!
$GLOBALS['phpgw']->acl->check('global_categories_access',1,'admin'))
{
! $file['Global Categories'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index');
}
***************
*** 59,63 ****
if (! $GLOBALS['phpgw']->acl->check('error_log_access',1,'admin'))
{
! $file['View Error Log'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uilog.list_log');
}
--- 58,62 ----
if (! $GLOBALS['phpgw']->acl->check('error_log_access',1,'admin'))
{
! $file['View Error Log'] =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uilog.list_log');
}
***************
*** 69,73 ****
if (! $GLOBALS['phpgw']->acl->check('info_access',1,'admin'))
{
! $file['phpInfo'] = "javascript:openwindow('" .
$GLOBALS['phpgw']->link('/admin/phpinfo.php') . "')";
//$GLOBALS['phpgw']->link('/admin/phpinfo.php');
}
--- 68,72 ----
if (! $GLOBALS['phpgw']->acl->check('info_access',1,'admin'))
{
! $file['phpInfo'] = "javascript:openwindow('" .
$GLOBALS['phpgw']->link('/admin/phpinfo.php') . "')";
//$GLOBALS['phpgw']->link('/admin/phpinfo.php');
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: admin/inc class.boaccounts.inc.php,1.29,1.30 class.uiaccounts.inc.php,1.31,1.32 hook_admin.inc.php,1.29,1.30,
Bettina Gille <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: admin/templates/default users.xsl,NONE,1.1 app_data.xsl,1.4,1.5
- Next by Date:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.auth_sql.inc.php,1.13,1.13.4.1
- Previous by thread:
[Phpgroupware-cvs] CVS: admin/templates/default users.xsl,NONE,1.1 app_data.xsl,1.4,1.5
- Next by thread:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.auth_sql.inc.php,1.13,1.13.4.1
- Index(es):