From 12fd93447130059dc43d9815848182e187334db3 Mon Sep 17 00:00:00 2001 From: z0rglub Date: Mon, 26 Jan 2004 23:29:52 +0000 Subject: moving the synchronization between data and calculated after the real update of the category status (still if changed) git-svn-id: http://piwigo.org/svn/branches/release-1_3@322 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/cat_modify.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'admin/cat_modify.php') diff --git a/admin/cat_modify.php b/admin/cat_modify.php index 76e952ab9..2eb9d5fdf 100644 --- a/admin/cat_modify.php +++ b/admin/cat_modify.php @@ -40,22 +40,6 @@ if ( isset( $_POST['submit'] ) ) $query.= ' WHERE id = '.$_GET['cat']; $query.= ';'; $row = mysql_fetch_array( mysql_query( $query ) ); - - if ( $_POST['status'] != $row['status'] ) - { - // deletion of all access for groups concerning this category - $query = 'DELETE'; - $query.= ' FROM '.PREFIX_TABLE.'group_access'; - $query.= ' WHERE cat_id = '.$_GET['cat']; - mysql_query( $query ); - // deletion of all access for users concerning this category - $query = 'DELETE'; - $query.= ' FROM '.PREFIX_TABLE.'user_access'; - $query.= ' WHERE cat_id = '.$_GET['cat']; - mysql_query( $query ); - // resynchronize all users - synchronize_all_users(); - } $query = 'UPDATE '.PREFIX_TABLE.'categories'; @@ -87,6 +71,22 @@ if ( isset( $_POST['submit'] ) ) $query.= ';'; mysql_query( $query ); + if ( $_POST['status'] != $row['status'] ) + { + // deletion of all access for groups concerning this category + $query = 'DELETE'; + $query.= ' FROM '.PREFIX_TABLE.'group_access'; + $query.= ' WHERE cat_id = '.$_GET['cat']; + mysql_query( $query ); + // deletion of all access for users concerning this category + $query = 'DELETE'; + $query.= ' FROM '.PREFIX_TABLE.'user_access'; + $query.= ' WHERE cat_id = '.$_GET['cat']; + mysql_query( $query ); + // resynchronize all users + synchronize_all_users(); + } + // checking users favorites $query = 'SELECT id'; $query.= ' FROM '.PREFIX_TABLE.'users'; -- cgit v1.2.3