 # Search controller
 # ---------------------------------------------------------------------------
 
-SearchCtrl = ($scope, pwgAjax, pwgFlash, pwgTimeout) ->
+SearchCtrl = ($scope, pwgAjax, pwgFlash, pwgTimeout, pwgModal) ->
   $scope.searchTerm        = null
   $scope.searchResults     = null
   $scope.searchDescription = true

pwguardApp.controller 'AdminUsersCtrl', ['$scope',
                                         'pwgAjax',
                                         'pwgFlash',
                                         AdminUsersCtrl]

      pwgFlash.error "You can't delete yourself!"

    else
      pwgModal.confirm("Really delete #{u.email}?", "Confirm deletion").then ->
        url = routes.controllers.UserController.delete(u.id).url
        pwgAjax.delete url, ->
          loadUsers()
