From: Jiri Tomasek <jtomasek(a)redhat.com>
This patch fixes BZ717533
---
src/app/controllers/users_controller.rb | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/app/controllers/users_controller.rb
b/src/app/controllers/users_controller.rb
index 16c514d..efebe39 100644
--- a/src/app/controllers/users_controller.rb
+++ b/src/app/controllers/users_controller.rb
@@ -113,7 +113,12 @@ class UsersController < ApplicationController
def destroy
require_privilege(Privilege::MODIFY, User)
- User.destroy(params[:id])
+ user = User.find(params[:id])
+ if user == current_user
+ flash[:warning] = "Cannot delete #{user.login}: you are logged in as this
user"
+ else
+ user.destroy
+ end
respond_to do |format|
format.html { redirect_to users_path }
--
1.7.4.2