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
This commit is contained in:
parent
0fed5786ea
commit
12fd934471
1 changed files with 16 additions and 16 deletions
|
@ -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';
|
||||
|
|
Loading…
Add table
Reference in a new issue