[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] [18598] get_var fixes, alternate_row_color -> alterna
From: |
Caeies |
Subject: |
[Phpgroupware-cvs] [18598] get_var fixes, alternate_row_color -> alternate_row_class fix, others notices fixed. |
Date: |
Wed, 04 Jun 2008 17:46:26 +0000 |
Revision: 18598
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=18598
Author: Caeies
Date: 2008-06-04 17:46:26 +0000 (Wed, 04 Jun 2008)
Log Message:
-----------
get_var fixes, alternate_row_color -> alternate_row_class fix, others notices
fixed. WARNING DONT USE THIS FILE SINCE IT SEEMS BROKEN (or acl system)
Modified Paths:
--------------
trunk/preferences/inc/class.uiaclprefs.inc.php
Modified: trunk/preferences/inc/class.uiaclprefs.inc.php
===================================================================
--- trunk/preferences/inc/class.uiaclprefs.inc.php 2008-06-04 17:44:08 UTC
(rev 18597)
+++ trunk/preferences/inc/class.uiaclprefs.inc.php 2008-06-04 17:46:26 UTC
(rev 18598)
@@ -47,13 +47,14 @@
*/
function index()
{
- $acl_app =
get_var('acl_app',array('POST','GET'));
- $start = get_var('start',array('POST','GET'));
- $query = get_var('query',array('POST','GET'));
- $s_groups =
get_var('s_groups',array('POST','GET'));
- $s_users =
get_var('s_users',array('POST','GET'));
- $owner = get_var('owner',array('POST','GET'));
-
+ $acl_app = phpgw::get_var('acl_app');
+ $start = phpgw::get_var('start', 'int');
+ $query = phpgw::get_var('query');
+ $s_groups = phpgw::get_var('s_groups');
+ $s_users = phpgw::get_var('s_users');
+ $owner = phpgw::get_var('owner', 'int');
+
+ $acl_app_not_passed = false;
if (! $acl_app)
{
$acl_app = 'preferences';
@@ -79,7 +80,7 @@
}
}
- if
($GLOBALS['phpgw_info']['server']['deny_user_grants_access'] &&
!isset($GLOBALS['phpgw_info']['user']['apps']['admin']))
+ if
(isset($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) &&
$GLOBALS['phpgw_info']['server']['deny_user_grants_access'] &&
!isset($GLOBALS['phpgw_info']['user']['apps']['admin']))
{
echo '<center><b>' . lang('Access not
permitted') . '</b></center>';
$GLOBALS['phpgw']->common->phpgw_exit(True);
@@ -115,9 +116,9 @@
$this->acl =
CreateObject('phpgwapi.acl',intval($owner));
$this->acl->read_repository();
- if ($_POST['submit'])
+ if (phpgw::get_var('submit', 'bool', 'POST'))
{
- $processed = $_POST['processed'];
+ $processed = phpgw::get_var('processed',
'string', 'POST', '');
$to_remove = unserialize(urldecode($processed));
for($i=0; $i < count($to_remove); ++$i)
@@ -126,21 +127,24 @@
}
/* Group records */
- $group_variable =
$_POST['g_'.$GLOBALS['phpgw_info']['flags']['currentapp']];
+ $group_variable =
phpgw::get_var('g_'.$GLOBALS['phpgw_info']['flags']['currentapp'], 'array',
'POST', array());
- if (!$group_variable)
- {
- $group_variable = array();
- }
- @reset($group_variable);
+ reset($group_variable);
$totalacl = array();
while(list($rowinfo,$perm) =
each($group_variable))
{
list($group_id,$rights) =
split('_',$rowinfo);
- $totalacl[$group_id] += $rights;
+ if(isset($totalacl[$group_id]))
+ {
+ $totalacl[$group_id] += $rights;
+ }
+ else
+ {
+ $totalacl += array( $group_id
=> $rights );
+ }
}
- @reset($totalacl);
- while(list($group_id,$rights) =
@each($totalacl))
+ reset($totalacl);
+ while(list($group_id,$rights) = each($totalacl))
{
if($is_group)
{
@@ -152,21 +156,24 @@
}
/* User records */
- $user_variable =
$_POST['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']];
+ $user_variable =
phpgw::get_var('u_'.$GLOBALS['phpgw_info']['flags']['currentapp'], 'array',
'POST', array());
- if (!$user_variable)
- {
- $user_variable = array();
- }
- @reset($user_variable);
+ reset($user_variable);
$totalacl = array();
while(list($rowinfo,$perm) =
each($user_variable))
{
list($user_id,$rights) =
split('_',$rowinfo);
- $totalacl[$user_id] += $rights;
+ if(isset($totalacl[$user_id]))
+ {
+ $totalacl[$user_id] += $rights;
+ }
+ else
+ {
+ $totalacl += array( $user_id =>
$rights );
+ }
}
- @reset($totalacl);
- while(list($user_id,$rights) = @each($totalacl))
+ reset($totalacl);
+ while(list($user_id,$rights) = each($totalacl))
{
if($is_group)
{
@@ -236,7 +243,7 @@
$this->template->set_file($templates);
- if ($_POST['submit'])
+ if (phpgw::get_var('submit', 'bool', 'POST'))
{
$this->template->set_var('errors',lang('ACL
grants have been updated'));
}
@@ -254,8 +261,8 @@
$var = Array(
'errors' => '',
'title' => '<br />',
- 'action_url' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='
. $acl_app),
- 'bg_color' =>
$GLOBALS['phpgw_info']['theme']['th_bg'],
+ 'action_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'preferences.uiaclprefs.index', 'acl_app' => $acl_app)),
+ //'bg_color' =>
$GLOBALS['phpgw_info']['theme']['th_bg'],
'submit_lang' => lang('Save'),
'common_hidden_vars_form' => $common_hidden_vars
);
@@ -280,7 +287,7 @@
$this->template->set_var($var,lang($value));
}
}
-
+ $tr_color = 'row_on';
if (intval($s_groups) != count($groups))
{
$this->template->set_var('string',lang('Groups'));
@@ -302,7 +309,7 @@
if($go)
{
- $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
+ $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_class($tr_color);
$this->display_row($tr_color,'g_',$group['account_id'],$group['account_lid'],$is_group);
++$s_groups;
$processed[] =
$group['account_id'];
@@ -321,9 +328,13 @@
{
$this->template->set_var('string',ucfirst(lang('Users')));
$this->template->parse('row','row_colspan',True);
- $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
+ $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_class($tr_color);
for($k=$s_users; ($k < $totalentries)
|| ($k == count($users)); ++$k)
{
+ if(!isset($users[$k]))
+ {
+ continue;
+ }
$user = $users[$k];
//echo '<br />acctid:
'.$user['account_id'];
if ($user['account_id'])
@@ -346,7 +357,7 @@
if($go && $user['account_id']
!= $owner) // Need to be $owner not
$GLOBALS['phpgw_info']['user']['account_id']
{
// or the admin can't
get special grants from a group
- $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
+ $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_class($tr_color);
$this->display_row($tr_color,'u_',$user['account_id'],$GLOBALS['phpgw']->common->display_fullname($user['account_lid'],$user['account_firstname'],$user['account_lastname']),$is_group);
++$s_users;
$processed[] =
$user['account_id'];
@@ -361,10 +372,13 @@
}
$extra_parms = 'menuaction=preferences.uiaclprefs.index'
- . '&acl_app=' . $acl_app
- . '&s_users='.$s_users.'&s_groups='.$s_groups
- . '&maxm=' . $maxm . '&totalentries=' .
$totalentries
- . '&total=' . ($start + $total) .
'&owner='.$owner;
+ . '&acl_app=' .$acl_app
+ . '&s_users=' . $s_users
+ . '&s_groups='. $s_groups
+ . '&maxm='. $maxm
+ . '&totalentries='. $totalentries
+ . '&total=' . ($start + $total)
+ . '&owner=' . $owner;
$var = Array(
'nml' =>
$GLOBALS['phpgw']->nextmatchs->left('/index.php',$start,$totalentries,$extra_parms),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] [18598] get_var fixes, alternate_row_color -> alternate_row_class fix, others notices fixed.,
Caeies <=