diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2007-06-17 13:53:05 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2007-06-17 13:53:05 +0000 |
| commit | 7ebf474d54b70acee49aa4538db3ed01e430e48a (patch) | |
| tree | 7b4127c20a03a520cf031d95127ffc1abcc0392a | |
| parent | 1aa81279be06c3c4a62864d8e3635434cd1e0d47 (diff) | |
| download | users-7ebf474d54b70acee49aa4538db3ed01e430e48a.tar.gz users-7ebf474d54b70acee49aa4538db3ed01e430e48a.tar.bz2 users-7ebf474d54b70acee49aa4538db3ed01e430e48a.zip | |
update getAllGroups() to not return stuff in ['data'] hashkey. this is still from tikiwiki days and is tedious to deal with.
| -rw-r--r-- | admin/admin_login_inc.php | 7 | ||||
| -rw-r--r-- | admin/assign_user.php | 7 | ||||
| -rw-r--r-- | admin/edit_group.php | 5 | ||||
| -rw-r--r-- | admin/unassigned_perms.php | 4 | ||||
| -rw-r--r-- | auth/ldap/auth.php | 3 | ||||
| -rw-r--r-- | my_groups.php | 25 | ||||
| -rw-r--r-- | register.php | 13 |
7 files changed, 31 insertions, 33 deletions
diff --git a/admin/admin_login_inc.php b/admin/admin_login_inc.php index e629223..08961ee 100644 --- a/admin/admin_login_inc.php +++ b/admin/admin_login_inc.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_users/admin/admin_login_inc.php,v 1.26 2007/04/06 22:56:21 wjames5 Exp $ +// $Header: /cvsroot/bitweaver/_bit_users/admin/admin_login_inc.php,v 1.27 2007/06/17 13:53:04 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. @@ -141,7 +141,7 @@ if( !empty( $_REQUEST["loginprefs"] ) ) { $groupList = $gBitUser->getAllGroups( $listHash ); $in = array(); $out = array(); - foreach ( $groupList['data'] as $gr ) { + foreach ( $groupList as $gr ) { if ($gr['group_id'] == -1) continue; if ( $gr['is_public'] == 'y' && !in_array( $gr['group_id'], $_REQUEST['registration_group_choice'] ) ) // deselect @@ -252,8 +252,7 @@ if( !empty( $_REQUEST["httpprefs"] ) ) { } $listHash = array(); -$groupList = $gBitUser->getAllGroups($listHash); -$gBitSmarty->assign_by_ref('groupList', $groupList['data']); +$gBitSmarty->assign_by_ref( 'groupList', $gBitUser->getAllGroups( $listHash )); $gBitSmarty->assign_by_ref( 'authSettings', BaseAuth::getConfig() ); diff --git a/admin/assign_user.php b/admin/assign_user.php index 8279f07..2d5a217 100644 --- a/admin/assign_user.php +++ b/admin/assign_user.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_users/admin/assign_user.php,v 1.10 2007/04/23 09:36:32 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_users/admin/assign_user.php,v 1.11 2007/06/17 13:53:04 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. @@ -38,10 +38,7 @@ if( isset( $_REQUEST["action"] ) ) { $gBitSmarty->assign_by_ref( 'assignUser', $assignUser ); $listHash = array( 'sort_mode' => 'group_name_asc' ); -$groupList = $gBitUser->getAllGroups( $listHash ); - -// Get users (list of users) -$gBitSmarty->assign('groups', $groupList['data']); +$gBitSmarty->assign('groups', $gBitUser->getAllGroups( $listHash )); $gBitSystem->setBrowserTitle( 'Edit User: '.$assignUser->mUsername ); diff --git a/admin/edit_group.php b/admin/edit_group.php index 7353839..73fd814 100644 --- a/admin/edit_group.php +++ b/admin/edit_group.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_users/admin/edit_group.php,v 1.25 2007/06/17 12:42:48 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_users/admin/edit_group.php,v 1.26 2007/06/17 13:53:04 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. @@ -144,7 +144,7 @@ if( !empty( $_REQUEST['group_id'] ) || (!empty( $_REQUEST["action"] ) && $_REQUE // get grouplist separately from the $users stuff to avoid splitting of data due to pagination $listHash = array( 'sort_mode' => !empty( $_REQUEST['sort_mode'] ) ? $_REQUEST['sort_mode'] : 'group_name_asc' ); } -$groupList = $gBitUser->getAllGroups( $listHash ); +$gBitSmarty->assign('groupList', $gBitUser->getAllGroups( $listHash )); $inc = array(); if( empty( $mid ) ) { @@ -167,7 +167,6 @@ if( empty( $mid ) ) { // $gBitSmarty->assign( 'loadDebug', TRUE ); // Ajax / prototype debug -$gBitSmarty->assign('groupList', $groupList['data']); $gBitSmarty->assign('successMsg',$successMsg); $gBitSmarty->assign('errorMsg',$errorMsg); diff --git a/admin/unassigned_perms.php b/admin/unassigned_perms.php index 42c7d05..ec2ec03 100644 --- a/admin/unassigned_perms.php +++ b/admin/unassigned_perms.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_users/admin/Attic/unassigned_perms.php,v 1.7 2007/06/15 22:07:52 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_users/admin/Attic/unassigned_perms.php,v 1.8 2007/06/17 13:53:04 squareing Exp $ // Initialization require_once( '../../bit_setup_inc.php' ); @@ -8,7 +8,7 @@ $gBitSmarty->assign_by_ref( 'feedback', $feedback = array() ); $listHash = array( 'sort_mode' => 'group_id_asc' ); $groupList = $gBitUser->getAllGroups( $listHash ); -foreach( $groupList['data'] as $group ) { +foreach( $groupList as $group ) { $groupDrop[$group['group_id']] = $group['group_name']; } $gBitSmarty->assign( 'groupDrop', $groupDrop ); diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index c4dde27..3177122 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/auth/ldap/auth.php,v 1.3 2006/10/13 12:47:40 lsces Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/auth/ldap/auth.php,v 1.4 2007/06/17 13:53:05 squareing Exp $ * * @package users */ @@ -114,7 +114,6 @@ class LDAPAuth extends BaseAuth { global $gBitUser; $listHash = array(); $groups = $gBitUser->getAllGroups($listHash); - $groups=$groups['data']; $groupsD =array(); foreach ($groups as $g) { $groupsD[$g['group_id']]= "{$g['group_name']} ( {$g['group_desc']} )"; diff --git a/my_groups.php b/my_groups.php index d7d4f0d..85c6352 100644 --- a/my_groups.php +++ b/my_groups.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/my_groups.php,v 1.14 2007/06/17 12:42:47 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/my_groups.php,v 1.15 2007/06/17 13:53:04 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: my_groups.php,v 1.14 2007/06/17 12:42:47 squareing Exp $ + * $Id: my_groups.php,v 1.15 2007/06/17 13:53:04 squareing Exp $ * @package users * @subpackage functions */ @@ -118,7 +118,7 @@ if ( $gBitUser->hasPermission('p_users_create_personal_groups' ) ) { $gBitSmarty->assign_by_ref('foundUsers', $foundUsers); } elseif (!empty($_REQUEST['assignuser'])) { if( !empty($_REQUEST['group_id'] ) ) { - if ($_REQUEST['group_id'] != -1 && $groupList['data'][$_REQUEST['group_id']]['user_id'] == $gBitUser->mUserId) { + if ($_REQUEST['group_id'] != -1 && $groupList[$_REQUEST['group_id']]['user_id'] == $gBitUser->mUserId) { $gBitUser->addUserToGroup( $_REQUEST['assignuser'], $_REQUEST['group_id'] ); } else { @@ -183,28 +183,31 @@ if ( ( !empty( $_REQUEST['add_public_group'] ) || !empty( $_REQUEST['remove_publ /* Load up public groups and check if the user can join or leave them */ $systemGroups = $gBitUser->getGroups( $gBitUser->mUserId, TRUE ); $gBitSmarty->assign_by_ref( 'systemGroups', $systemGroups); -$listHash = array( 'is_public'=>'y', 'sort_mode'=>array('is_default_asc' , 'group_desc_asc') ); +$listHash = array( + 'is_public'=>'y', + 'sort_mode' => array( 'is_default_asc', 'group_desc_asc' ), +); $publicGroups = $gBitUser->getAllGroups( $listHash ); -if ( $publicGroups['cant'] ) { +if( count( $publicGroups )) { foreach ( $systemGroups as $groupId=>$groupInfo ) { - foreach ( $publicGroups['data'] as $key=>$publicGroup) { - if ( $publicGroups['data'][$key]['group_id'] == $groupId) { - if ($publicGroups['data'][$key]['is_default'] != 'y' ) { + foreach ( $publicGroups as $key=>$publicGroup) { + if ( $publicGroups[$key]['group_id'] == $groupId) { + if ($publicGroups[$key]['is_default'] != 'y' ) { $systemGroups[$groupId]['public'] = 'y'; $canRemovePublic = 'y'; } - $publicGroups['data'][$key]['used'] = 'y'; + $publicGroups[$key]['used'] = 'y'; break; } } } - foreach ( $publicGroups['data'] as $groupInfo) { + foreach ( $publicGroups as $groupInfo) { if ( empty($groupInfo['used'] ) && $groupInfo['is_default'] != 'y' ) { $gBitSmarty->assign( 'canAddPublic' , 'y'); break; } } - $gBitSmarty->assign_by_ref( 'publicGroups', $publicGroups['data'] ); + $gBitSmarty->assign_by_ref( 'publicGroups', $publicGroups ); if (isset($canRemovePublic)) { $gBitSmarty->assign( 'canRemovePublic' , 'y'); } diff --git a/register.php b/register.php index 187b60c..e1442f9 100644 --- a/register.php +++ b/register.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/register.php,v 1.31 2007/04/06 22:56:21 wjames5 Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/register.php,v 1.32 2007/06/17 13:53:04 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: register.php,v 1.31 2007/04/06 22:56:21 wjames5 Exp $ + * $Id: register.php,v 1.32 2007/06/17 13:53:04 squareing Exp $ * @package users * @subpackage functions */ @@ -143,11 +143,12 @@ closedir ($h); sort ($flags); $gBitSmarty->assign('flags', $flags); -$listHash = array( 'is_public'=>'y', 'sort_mode'=>array('is_default_asc' , 'group_desc_asc') ); +$listHash = array( + 'is_public' => 'y', + 'sort_mode' => array( 'is_default_asc', 'group_desc_asc' ), +); $groupList = $gBitUser->getAllGroups( $listHash ); -if ( $groupList['cant'] ) { - $gBitSmarty->assign_by_ref( 'groupList', $groupList['data'] ); -} +$gBitSmarty->assign_by_ref( 'groupList', $groupList ); // include preferences settings from other packages - these will be included as individual tabs |
