Account deletion
fix multi user deletion, add confirmation message
This commit is contained in:
parent
21adbad4c1
commit
f36253b7a8
@ -185,6 +185,7 @@ function account_remove($account_id,$local = true,$unset_session=true) {
|
|||||||
$r = q("select * from account where account_id = %d limit 1",
|
$r = q("select * from account where account_id = %d limit 1",
|
||||||
intval($account_id)
|
intval($account_id)
|
||||||
);
|
);
|
||||||
|
$account_email=$r[0]['account_email'];
|
||||||
|
|
||||||
if(! $r) {
|
if(! $r) {
|
||||||
logger('account_remove: No account with id: ' . $account_id);
|
logger('account_remove: No account with id: ' . $account_id);
|
||||||
@ -207,6 +208,7 @@ function account_remove($account_id,$local = true,$unset_session=true) {
|
|||||||
if ($unset_session) {
|
if ($unset_session) {
|
||||||
unset($_SESSION['authenticated']);
|
unset($_SESSION['authenticated']);
|
||||||
unset($_SESSION['uid']);
|
unset($_SESSION['uid']);
|
||||||
|
notice( sprintf(t("User '%s' deleted"),$account_email) . EOL);
|
||||||
goaway(get_app()->get_baseurl());
|
goaway(get_app()->get_baseurl());
|
||||||
}
|
}
|
||||||
return $r;
|
return $r;
|
||||||
|
@ -639,7 +639,7 @@ function admin_page_users_post(&$a){
|
|||||||
if (x($_POST,'page_users_delete')){
|
if (x($_POST,'page_users_delete')){
|
||||||
require_once("include/Contact.php");
|
require_once("include/Contact.php");
|
||||||
foreach($users as $uid){
|
foreach($users as $uid){
|
||||||
account_remove($uid,true);
|
account_remove($uid,true,false);
|
||||||
}
|
}
|
||||||
notice( sprintf( tt("%s user deleted", "%s users deleted", count($users)), count($users)) );
|
notice( sprintf( tt("%s user deleted", "%s users deleted", count($users)), count($users)) );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user