aboutsummaryrefslogtreecommitdiffstats
path: root/admin/group_list.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-06-11 14:10:04 +0000
committerplegall <plg@piwigo.org>2005-06-11 14:10:04 +0000
commite851f504acebc9422b79f58da25420666da6e296 (patch)
treef90d0104a9799caa29bcd47d0bd2c6edabcefe79 /admin/group_list.php
parent4fedaac43ac404dc50193d6032307697412bb2c9 (diff)
- errors and informations boxes : management centralized in admin.php,
$errors and $infos arrays replaced by $page['errors'] and $page['infos'], special management for admin/update.php (more complex management) git-svn-id: http://piwigo.org/svn/trunk@792 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/group_list.php22
1 files changed, 6 insertions, 16 deletions
diff --git a/admin/group_list.php b/admin/group_list.php
index cdf123f4e..f789a6b27 100644
--- a/admin/group_list.php
+++ b/admin/group_list.php
@@ -31,7 +31,6 @@ if( !defined("PHPWG_ROOT_PATH") )
include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' );
//-------------------------------------------------------------- delete a group
-$error = array();
if ( isset( $_POST['delete'] ) && isset( $_POST['confirm_delete'] ) )
{
// destruction of the access linked to the group
@@ -57,9 +56,9 @@ elseif ( isset( $_POST['new'] ) )
if ( empty($_POST['newgroup']) || preg_match( "/'/", $_POST['newgroup'] )
or preg_match( '/"/', $_POST['newgroup'] ) )
{
- array_push( $error, $lang['group_add_error1'] );
+ array_push( $page['errors'], $lang['group_add_error1'] );
}
- if ( count( $error ) == 0 )
+ if ( count( $page['errors'] ) == 0 )
{
// is the group not already existing ?
$query = 'SELECT id FROM '.GROUPS_TABLE;
@@ -68,10 +67,10 @@ elseif ( isset( $_POST['new'] ) )
$result = pwg_query( $query );
if ( mysql_num_rows( $result ) > 0 )
{
- array_push( $error, $lang['group_add_error2'] );
+ array_push( $page['errors'], $lang['group_add_error2'] );
}
}
- if ( count( $error ) == 0 )
+ if ( count( $page['errors'] ) == 0 )
{
// creating the group
$query = ' INSERT INTO '.GROUPS_TABLE;
@@ -80,13 +79,13 @@ elseif ( isset( $_POST['new'] ) )
pwg_query( $query );
}
}
-//--------------------------------------------------------------- user management
+//------------------------------------------------------------- user management
elseif ( isset( $_POST['add'] ) )
{
$userdata = getuserdata($_POST['username']);
if (!$userdata)
{
- array_push($error, $lang['user_err_unknown']);
+ array_push($page['errors'], $lang['user_err_unknown']);
}
else
{
@@ -113,15 +112,6 @@ elseif (isset( $_POST['deny_user'] ))
$query.= ') AND group_id = '.$_POST['edit_group_id'];
pwg_query( $query );
}
-//-------------------------------------------------------------- errors display
-if ( sizeof( $error ) != 0 )
-{
- $template->assign_block_vars('errors',array());
- for ( $i = 0; $i < sizeof( $error ); $i++ )
- {
- $template->assign_block_vars('errors.error',array('ERROR'=>$error[$i]));
- }
-}
//----------------------------------------------------------------- groups list
$query = 'SELECT id,name FROM '.GROUPS_TABLE;