[Pkg-owncloud-commits] [owncloud] 03/67: Disallow users to delete their own accounts

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:10:29 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.5.1
in repository owncloud.

commit cce43652f0a421ed092bfae156566464aa639de1
Author: Lukas Reschke <lukas at statuscode.ch>
Date:   Wed Oct 10 18:05:34 2012 +0200

    Disallow users to delete their own accounts
---
 settings/ajax/removeuser.php |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/settings/ajax/removeuser.php b/settings/ajax/removeuser.php
index 6b11fa5..1e3cd29 100644
--- a/settings/ajax/removeuser.php
+++ b/settings/ajax/removeuser.php
@@ -8,6 +8,11 @@ OCP\JSON::callCheck();
 
 $username = $_POST["username"];
 
+// A user shouldn't be able to delete his own account
+if(OC_User::getUser() === $username) {
+	exit;
+}
+
 if(!OC_Group::inGroup(OC_User::getUser(), 'admin') && !OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) {
 	$l = OC_L10N::get('core');
 	OC_JSON::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
@@ -20,4 +25,4 @@ if( OC_User::deleteUser( $username )) {
 }
 else{
 	OC_JSON::error(array("data" => array( "message" => $l->t("Unable to delete user") )));
-}
+}
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list