Sha256: 286782cfc0de909e2f3e999db818967814fcbd4a4bb54db353002e6e38499871

Contents?: true

Size: 739 Bytes

Versions: 35

Compression:

Stored size: 739 Bytes

Contents

#!/usr/bin/ruby

base = File.expand_path(File.join(File.dirname(__FILE__), ".."))
$LOAD_PATH << File.join(base, "lib")
$LOAD_PATH << File.join(base, "examples")

require 'active_ldap'
require 'objects/user'
require 'objects/group'

argv, opts, options = ActiveLdap::Command.parse_options do |opts, options|
  opts.banner += " GROUP_NAME"
end

if argv.size == 1
  name = argv.shift
else
  $stderr.puts opts
  exit 1
end

pwb = Proc.new do |user|
  ActiveLdap::Command.read_password("[#{user}] Password: ")
end

ActiveLdap::Base.setup_connection(:password_block => pwb,
                                  :allow_anonymous => false)


unless Group.exists?(name)
  $stderr.puts("Group #{name} doesn't exist.")
  exit 1
end

Group.destroy(name)

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
activeldap-7.2.1 examples/groupdel
activeldap-7.2.0 examples/groupdel
activeldap-7.0.0 examples/groupdel
activeldap-6.1.0 examples/groupdel
activeldap-6.0.4 examples/groupdel
activeldap-6.0.3 examples/groupdel
activeldap-6.0.2 examples/groupdel
activeldap-6.0.1 examples/groupdel
activeldap-6.0.0 examples/groupdel
activeldap-5.2.4 examples/groupdel
activeldap-5.2.3 examples/groupdel
activeldap-5.2.2 examples/groupdel
activeldap-5.2.1 examples/groupdel
activeldap-5.2.0 examples/groupdel
activeldap-5.1.1 examples/groupdel
activeldap-5.1.0 examples/groupdel
activeldap-3.2.3 examples/groupdel
powerhome-activeldap-3.2.3 examples/groupdel
activeldap-4.0.6 examples/groupdel
activeldap-4.0.5 examples/groupdel