aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-01-26 23:29:52 +0000
committerz0rglub <z0rglub@piwigo.org>2004-01-26 23:29:52 +0000
commit12fd93447130059dc43d9815848182e187334db3 (patch)
tree8e37531552674ff6a7e7ee305e5fcb69c558f340
parent0fed5786eac35592b141d310879faa31e6243ed2 (diff)
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
-rw-r--r--admin/cat_modify.php32
1 files changed, 16 insertions, 16 deletions
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';