[geeklog-cvs] geeklog-1.3/public_html usersettings.php,1.85,1.86
dhaun at geeklog.net
dhaun at geeklog.net
Sat Jan 31 04:22:50 EST 2004
Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory geeklog_prod:/tmp/cvs-serv6532
Modified Files:
usersettings.php
Log Message:
Moved code to delete a user's account to system/lib-user.php
Index: usersettings.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/usersettings.php,v
retrieving revision 1.85
retrieving revision 1.86
diff -C2 -d -r1.85 -r1.86
*** usersettings.php 24 Jan 2004 14:41:38 -0000 1.85
--- usersettings.php 31 Jan 2004 09:22:48 -0000 1.86
***************
*** 35,39 ****
// $Id$
! include_once('lib-common.php');
// Set this to true to have this script generate various debug messages in
--- 35,40 ----
// $Id$
! require_once('lib-common.php');
! require_once($_CONF['path_system'] . 'lib-user.php');
// Set this to true to have this script generate various debug messages in
***************
*** 249,290 ****
global $_CONF, $_TABLES, $_USER;
! if (DB_count ($_TABLES['users'], array ('pwrequestid', 'uid'), array ($form_reqid, $_USER['uid'])) != 1) {
// not found - abort
return COM_refresh ($_CONF['site_url'] . '/index.php');
}
! $uid = $_USER['uid'];
!
! // log the user out
! SESS_endUserSession ($_USER['uid']);
!
! // Ok, delete everything related to this user
!
! // first, remove from all security groups
! DB_delete ($_TABLES['group_assignments'], 'ug_uid', $uid);
!
! // remove user information and preferences
! DB_delete ($_TABLES['userprefs'], 'uid', $uid);
! DB_delete ($_TABLES['userindex'], 'uid', $uid);
! DB_delete ($_TABLES['usercomment'], 'uid', $uid);
! DB_delete ($_TABLES['userinfo'], 'uid', $uid);
!
! // Call custom account profile delete function if enabled and exists
! if ($_CONF['custom_registration'] AND function_exists (custom_userdelete)) {
! custom_userdelete ($uid);
}
-
- // let plugins update their data for this user
- PLG_deleteUser ($uid);
-
- // avoid having orphand stories/comments by making them anonymous posts
- DB_query ("UPDATE {$_TABLES['comments']} SET uid = 1 WHERE uid = $uid");
- DB_query ("UPDATE {$_TABLES['stories']} SET uid = 1 WHERE uid = $uid");
-
- // delete personal events
- DB_delete ($_TABLES['personal_events'], 'uid', $uid);
-
- // now delete the user itself
- DB_delete ($_TABLES['users'], 'uid', $uid);
return COM_refresh ($_CONF['site_url'] . '/index.php?msg=57');
--- 250,262 ----
global $_CONF, $_TABLES, $_USER;
! if (DB_count ($_TABLES['users'], array ('pwrequestid', 'uid'),
! array ($form_reqid, $_USER['uid'])) != 1) {
// not found - abort
return COM_refresh ($_CONF['site_url'] . '/index.php');
}
! if (!USER_deleteAccount ($_USER['uid'])) {
! return COM_refresh ($_CONF['site_url'] . '/index.php');
}
return COM_refresh ($_CONF['site_url'] . '/index.php?msg=57');
More information about the geeklog-cvs
mailing list