Changeset 21 for trunk/admin/include/functions.php
- Timestamp:
- Jul 1, 2003, 11:27:20 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r19 r21 102 102 delete_image( $row['id'] ); 103 103 } 104 105 // destruction of the restrictions linked to the category106 $query = 'DELETE FROM '.PREFIX_TABLE.' restrictions';104 105 // destruction of the access linked to the category 106 $query = 'DELETE FROM '.PREFIX_TABLE.'user_access'; 107 107 $query.= ' WHERE cat_id = '.$id; 108 108 $query.= ';'; 109 109 mysql_query( $query ); 110 110 $query = 'DELETE FROM '.PREFIX_TABLE.'group_access'; 111 $query.= ' WHERE cat_id = '.$id; 112 $query.= ';'; 113 mysql_query( $query ); 114 111 115 // destruction of the sub-categories 112 116 $query = 'SELECT id'; … … 119 123 delete_category( $row['id'] ); 120 124 } 121 125 122 126 // destruction of the category 123 127 $query = 'DELETE FROM '.PREFIX_TABLE.'categories'; … … 157 161 // The delete_user function delete a user identified by the $user_id 158 162 // It also deletes : 159 // - all the restrictions linked to this user 163 // - all the access linked to this user 164 // - all the links to any group 160 165 // - all the favorites linked to this user 166 // - all sessions linked to this user 161 167 function delete_user( $user_id ) 162 168 { 163 // destruction of the restrictions linked to the user 164 $query = 'DELETE FROM '.PREFIX_TABLE.'restrictions'; 165 $query.= ' WHERE user_id = '.$user_id; 166 $query.= ';'; 167 mysql_query( $query ); 168 169 // destruction of the access linked to the user 170 $query = 'DELETE FROM '.PREFIX_TABLE.'user_access'; 171 $query.= ' WHERE user_id = '.$user_id; 172 $query.= ';'; 173 mysql_query( $query ); 174 175 // destruction of the group links for this user 176 $query = 'DELETE FROM '.PREFIX_TABLE.'user_group'; 177 $query.= ' WHERE user_id = '.$user_id; 178 $query.= ';'; 179 mysql_query( $query ); 180 169 181 // destruction of the favorites associated with the user 170 182 $query = 'DELETE FROM '.PREFIX_TABLE.'favorites'; 183 $query.= ' WHERE user_id = '.$user_id; 184 $query.= ';'; 185 mysql_query( $query ); 186 187 // destruction of the sessions linked with the user 188 $query = 'DELETE FROM '.PREFIX_TABLE.'sessions'; 171 189 $query.= ' WHERE user_id = '.$user_id; 172 190 $query.= ';'; … … 179 197 mysql_query( $query ); 180 198 } 181 199 200 // delete_group deletes a group identified by its $group_id. 201 // It also deletes : 202 // - all the access linked to this group 203 // - all the links between this group and any user 204 function delete_group( $group_id ) 205 { 206 // destruction of the access linked to the group 207 $query = 'DELETE FROM '.PREFIX_TABLE.'group_access'; 208 $query.= ' WHERE group_id = '.$group_id; 209 $query.= ';'; 210 mysql_query( $query ); 211 212 // destruction of the group links for this group 213 $query = 'DELETE FROM '.PREFIX_TABLE.'user_group'; 214 $query.= ' WHERE group_id = '.$group_id; 215 $query.= ';'; 216 mysql_query( $query ); 217 218 // destruction of the group 219 $query = 'DELETE FROM '.PREFIX_TABLE.'groups'; 220 $query.= ' WHERE id = '.$group_id; 221 $query.= ';'; 222 mysql_query( $query ); 223 } 224 182 225 // The check_favorites function deletes all the favorites of a user if he is 183 226 // not allowed to see them (the category or an upper category is restricted
Note: See TracChangeset
for help on using the changeset viewer.