- replacement of PREFIX_TABLE constant in delete_user function
- deletion of $isadmin variable, replaced by constant IN_ADMIN - small refactoring - in include/common.inc.php, deletion of useless part "Obtain and encode users IP" and corresponding functions encode_ip and decode_ip - definition of $conf['default_language'] deleted from include/config.inc.php : it is already present in database table config - function init_userprefs deleted (useless), all its content moved to include/user.inc.php - admin.lang.php and faq.lang.php are loaded only if current user is in administrative section git-svn-id: http://piwigo.org/svn/trunk@650 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
1d46ea86e9
commit
c19f01d77c
6 changed files with 62 additions and 127 deletions
|
|
@ -330,37 +330,42 @@ DELETE FROM '.IMAGES_TABLE.'
|
|||
// - all the favorites linked to this user
|
||||
// - all sessions linked to this user
|
||||
// - all categories informations linked to this user
|
||||
function delete_user( $user_id )
|
||||
function delete_user($user_id)
|
||||
{
|
||||
// destruction of the access linked to the user
|
||||
$query = 'DELETE FROM '.PREFIX_TABLE.'user_access';
|
||||
$query.= ' WHERE user_id = '.$user_id;
|
||||
$query.= ';';
|
||||
pwg_query( $query );
|
||||
$query = '
|
||||
DELETE FROM '.USER_ACCESS_TABLE.'
|
||||
WHERE user_id = '.$user_id.'
|
||||
;';
|
||||
pwg_query($query);
|
||||
|
||||
// destruction of the group links for this user
|
||||
$query = 'DELETE FROM '.PREFIX_TABLE.'user_group';
|
||||
$query.= ' WHERE user_id = '.$user_id;
|
||||
$query.= ';';
|
||||
pwg_query( $query );
|
||||
$query = '
|
||||
DELETE FROM '.USER_GROUP_TABLE.'
|
||||
WHERE user_id = '.$user_id.'
|
||||
;';
|
||||
pwg_query($query);
|
||||
|
||||
// destruction of the favorites associated with the user
|
||||
$query = 'DELETE FROM '.PREFIX_TABLE.'favorites';
|
||||
$query.= ' WHERE user_id = '.$user_id;
|
||||
$query.= ';';
|
||||
pwg_query( $query );
|
||||
$query = '
|
||||
DELETE FROM '.FAVORITES_TABLE.'
|
||||
WHERE user_id = '.$user_id.'
|
||||
;';
|
||||
pwg_query($query);
|
||||
|
||||
// destruction of the sessions linked with the user
|
||||
$query = 'DELETE FROM '.PREFIX_TABLE.'sessions';
|
||||
$query.= ' WHERE user_id = '.$user_id;
|
||||
$query.= ';';
|
||||
pwg_query( $query );
|
||||
$query = '
|
||||
DELETE FROM '.SESSIONS_TABLE.'
|
||||
WHERE user_id = '.$user_id.'
|
||||
;';
|
||||
pwg_query($query);
|
||||
|
||||
// destruction of the user
|
||||
$query = 'DELETE FROM '.USERS_TABLE;
|
||||
$query.= ' WHERE id = '.$user_id;
|
||||
$query.= ';';
|
||||
pwg_query( $query );
|
||||
$query = '
|
||||
DELETE FROM '.USERS_TABLE.'
|
||||
WHERE id = '.$user_id.'
|
||||
;';
|
||||
pwg_query($query);
|
||||
}
|
||||
|
||||
// delete_group deletes a group identified by its $group_id.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue