radum.git
13 years agoFixed Ruby version requirement in gemspec. master 0.0.3
Shaun Rowland [Sun, 9 Jan 2011 04:10:48 +0000]
Fixed Ruby version requirement in gemspec.

This also includes small changes for RDoc in Ruby 1.9. For some reason
the RDoc here will not work with the default version of RDoc that was
installed with Ruby 1.9.2 on my system, but updating RDoc to the latest
version works fine. This looks like a bug in RDoc.

13 years agoUpdated RDoc to reflect Windows Server 2008 R2 testing status.
Shaun Rowland [Sun, 9 Jan 2011 02:27:10 +0000]
Updated RDoc to reflect Windows Server 2008 R2 testing status.

13 years agoUpdated copyright date and fixed the String#.to_a method.
Shaun Rowland [Sun, 9 Jan 2011 00:32:21 +0000]
Updated copyright date and fixed the String#.to_a method.

13 years agoBumped the gem version number to 0.0.3.
Shaun Rowland [Sun, 9 Jan 2011 00:00:14 +0000]
Bumped the gem version number to 0.0.3.

13 years agoChanged gemspec to require Ruby 1.8.7 or higher and use net-ldap.
Shaun Rowland [Sat, 8 Jan 2011 23:58:34 +0000]
Changed gemspec to require Ruby 1.8.7 or higher and use net-ldap.

The Ruby version is a requirement of net-ldap 0.1.1. I used an exact
version in case behavior changes in future releases. For some reason I
was worried about this before.

13 years agoMerge branch 'master' of shaunrowland.com:radum
Shaun Rowland [Sat, 8 Jan 2011 22:37:02 +0000]
Merge branch 'master' of shaunrowland.com:radum

13 years agoAdded live testing text output file to .gitignore.
Shaun Rowland [Sat, 8 Jan 2011 22:35:33 +0000]
Added live testing text output file to .gitignore.

13 years agoFixes to work with Ruby 1.9 and the new net-ldap gem.
Shaun Rowland [Fri, 7 Jan 2011 07:48:46 +0000]
Fixes to work with Ruby 1.9 and the new net-ldap gem.

13 years agoFixed error messages.
Shaun Rowland [Fri, 27 Aug 2010 23:46:13 +0000]
Fixed error messages.

14 years agoRemoved explicit require 'rubygems' from radum.rb file.
Shaun Rowland [Sat, 24 Oct 2009 21:14:19 +0000]
Removed explicit require 'rubygems' from radum.rb file.

This should never be necessary. Yes, I am using RubyGems, but it should not
be required in that code. I did put that in testing code, but that's fine.

14 years agoAdded notes about the Certificate Authority Web Enrollment role service.
Shaun Rowland [Sun, 30 Aug 2009 23:51:48 +0000]
Added notes about the Certificate Authority Web Enrollment role service.

Mac OS X Snow Leopard requires the Certificate Authority Web Enrollment
role service to be installed on the Active Directory server. This took
me a while to figure out. If that role service is not installed, RADUM
will be _extremely_ slow (totally unusable). This service is probably
a good idea anyway of course. I added a note about that in the comments.

14 years agoAdded easy ruby version support for testing.
Shaun Rowland [Sun, 30 Aug 2009 07:15:46 +0000]
Added easy ruby version support for testing.

Updated the testing scripts to print what version of Ruby is being used
for testing and used /usr/bin/env to find the Ruby currently in the $PATH.

14 years agoFixed name of GUI tool in RDoc.
Shaun Rowland [Thu, 13 Aug 2009 17:22:29 +0000]
Fixed name of GUI tool in RDoc.

Small fix for the name of the "Active Directory Users and Computers" GUI tool.

14 years agoFixed Ruby 1.9 frozen string problem and added explicit Ruby requirement. 0.0.2
Shaun Rowland [Fri, 7 Aug 2009 02:08:00 +0000]
Fixed Ruby 1.9 frozen string problem and added explicit Ruby requirement.

Ruby 1.8.5 or higher is required, so that's been specified. It might work
with versions less than Ruby 1.8.5, but I have not tested it. RADUM will
not work with Ruby 1.9 yet because of ruby-net-ldap, but I did fix a frozen
String problem when using the ENV hash values for later Ruby 1.9 work.

14 years agoFixed a bug with UNIX main group changes and added test case.
Shaun Rowland [Thu, 6 Aug 2009 22:45:37 +0000]
Fixed a bug with UNIX main group changes and added test case.

Fixed a bug with UNIX main group changes. If the UNIX main group is changed
and the UNIXUser is explicitly removed from the old UNIX main group, they
would end up with a membership from the UNIX perspective only. Now that
won't happen. I added a test case that will find this bug.

14 years agoUpdated RDoc and to_s() methods with additional information.
Shaun Rowland [Tue, 4 Aug 2009 03:50:00 +0000]
Updated RDoc and to_s() methods with additional information.

Made a slight RDoc update and modified the Container, Group, UNIXGroup,
User, and UNIXUser to_s() methods to include the @name or @username
explicitly in <> characters.

14 years agoRemoved extra space in debug log message. 0.0.1
Shaun Rowland [Sun, 2 Aug 2009 21:52:13 +0000]
Removed extra space in debug log message.

14 years agoSmall fix for tested operating systems in RDoc comments.
Shaun Rowland [Sun, 2 Aug 2009 21:32:01 +0000]
Small fix for tested operating systems in RDoc comments.

I think that's more along the lines of the proper name for Windows 2003.

14 years agoUpdated RDoc after Windows Server 2003 Standard R2 SP2 testing.
Shaun Rowland [Sun, 2 Aug 2009 21:14:32 +0000]
Updated RDoc after Windows Server 2003 Standard R2 SP2 testing.

Updated documentation to reflect the required domain functional level
and some more information about the nis_domain attribute's use.

14 years agoAdded more RDoc and made some points clearer.
Shaun Rowland [Sun, 2 Aug 2009 07:06:58 +0000]
Added more RDoc and made some points clearer.

Added more RDoc to explain the RADUM::Logger instance, how to use it, and
made some information about group to group memberships to make things clearer.

14 years agoAdded rasing a RuntimeError on an authentication problem.
Shaun Rowland [Sun, 2 Aug 2009 06:26:57 +0000]
Added rasing a RuntimeError on an authentication problem.

If there is an authentication problem that gives the LDAP operation result
code of 49, a RuntimeError is immediately raised to stop further processing.

14 years agoFixed comment and removed redundant test assertion.
Shaun Rowland [Sun, 2 Aug 2009 06:11:39 +0000]
Fixed comment and removed redundant test assertion.

Fixed comment that had the wrong class type and removed an assertion
duplicate.

14 years agoImproved UNIX to Windows conversion log messages.
Shaun Rowland [Sun, 2 Aug 2009 03:59:15 +0000]
Improved UNIX to Windows conversion log messages.

Made the LOG_DEBUG messages for unix_user_to_user() and unix_group_to_group()
follow the previous format used in the AD class.

14 years agoFixed syntax error with last commit.
Shaun Rowland [Fri, 31 Jul 2009 04:47:12 +0000]
Fixed syntax error with last commit.

14 years agoCleaned up live testing script.
Shaun Rowland [Fri, 31 Jul 2009 04:45:29 +0000]
Cleaned up live testing script.

I tried to make the live testing script a little clearer. It is kind of hard
to follow in the conversion testing, but those checks are the hardest.

14 years agoExpanded conversion test in live testing.
Shaun Rowland [Thu, 30 Jul 2009 04:12:02 +0000]
Expanded conversion test in live testing.

Expanded the conversion test in live testing for the :remove_unix_users
and :remove_unix_groups flags. I removed the object removal testing as
it has been tested to some degree in live testing and the new tests in
the AD non-live testing makes sure it works.

14 years agoUpdated AD#destroy_container logic, comments, tests, etc.
Shaun Rowland [Wed, 29 Jul 2009 04:26:49 +0000]
Updated AD#destroy_container logic, comments, tests, etc.

- Expaned AD test suite to test new AD#remove_container and
AD#destroy_container logic. This tests all the other remove/destroy logic
as well through side effects.

- Updated comments for delayed destroy logic after the previous commit
related to that.

- Updated AD#destroy_container to only destroy a Container if possible.

- Removed duplicate user destruction from UNIX main group (should already
do that anyway).

- Removed extra push of user to removed_users array for the UNIX main group
if it was also the user's primary Windows group. The user should not be
pushed to the removed_users array in that case because they do not have
a regular Windows membership there to remove (was a member just because
of primaryGroupID attribute for the user and their UNIX membership was
only through their gidNumber attribute - nothing to do in that case when
the user is removed).

14 years agoAdded TO DO comments and a new testing block to fill in.
Shaun Rowland [Tue, 28 Jul 2009 04:49:57 +0000]
Added TO DO comments and a new testing block to fill in.

Added TO DO comments to make sure the previous commit changes are tested
and that they do what I expect. Added a new testing block for this as well.

14 years agoFixed a bug with UNIXGroup updates and with "destroy" logic.
Shaun Rowland [Tue, 28 Jul 2009 04:33:21 +0000]
Fixed a bug with UNIXGroup updates and with "destroy" logic.

The AD#unix_group_to_group method needed to delete the gidNumber LDAP UNIX
attribute. The AD#update_group method needed to set the GID for newly
converted to UNIXGroup objects. In testing I discovered that the "destroy"
methods were not working how I intended. They were not really removing
references to users and groups - they acted a lot like the "remove" methods
(and in fact, that is how the code used them). However, this would leave old
references in the User/UNIXUser and Group/UNIXGroup object's users/groups
arrays. For example, if you converted a User to a UNIXUser, a group might
still have the old User around because it was not really "destroyed". The
"destroy" logic was updated accordingly, which cased the "remove" logic
to need updating.

In AD#sync I also noticed that I could not destroy users and containers in
the AD#delete_user and AD#delete_container methods. The AD#update_group()
method still needs references to all Container objects to find out who is
no longer in a group via being destroyed. Removing a user from Active Directory
impliciltly takes care of Windows group memberships, but AD#update_group
still needs to know about the objects that were deleted in order to update
the UNIX group membership attributes on what's left (since that's not updated
implicitly).

14 years agoFixed bug with :remove_unix_groups in unix_user_to_user.
Shaun Rowland [Tue, 28 Jul 2009 02:16:13 +0000]
Fixed bug with :remove_unix_groups in unix_user_to_user.

Fixed a bug with AD#unix_user_to_user with respect to the :remove_unix_groups
option. UNIX memberships were not actually removed. Windows memberships were
handled fine.

14 years agoImproved white space handling and fixed delete_container().
Shaun Rowland [Tue, 28 Jul 2009 00:19:36 +0000]
Improved white space handling and fixed delete_container().

Improved the white space handling. Now Container objects can have spaces
in their names, but extraneous white space is removed. White space is stripped
from the username and name arguments for User/UNIXUser and Group/UNIXGroup
objects. The comments were updated to reflect these improvements. The
delete_container() method in the AD object only deletes a Container if it
actually is in Active Directory instead of just resulting in an LDAP error.
That is better behavior.

14 years agoCleaned up live test code.
Shaun Rowland [Mon, 27 Jul 2009 23:20:20 +0000]
Cleaned up live test code.

Cleaned up the live test code to make precedence clearer.

14 years agoCleaned up code and removed AD equality methods.
Shaun Rowland [Mon, 27 Jul 2009 22:59:21 +0000]
Cleaned up code and removed AD equality methods.

Cleaned up the code to make precedence clearer. Added comments about the
UID/GID uniqueness Active Directory "requirement" (not striclty required
possibly, but the GUI tools complain - so something else will probably
break if I allowed it). Removed the AD equality related methods as they
are not used nor make sense really. Fixed a bug with the tc_group.rb
unit test script.

14 years agoFixed require path.
Shaun Rowland [Mon, 27 Jul 2009 07:53:46 +0000]
Fixed require path.

14 years agoUpdated RDoc documentation and fixed domain AD attribute.
Shaun Rowland [Mon, 27 Jul 2009 07:47:31 +0000]
Updated RDoc documentation and fixed domain AD attribute.

Updated the RDoc documentation and made the domain attribute of the AD
class lowercase.

14 years agoUpdated test code and Gem specification.
Shaun Rowland [Mon, 27 Jul 2009 01:07:52 +0000]
Updated test code and Gem specification.

The paths used in the testing code were wrong (fine for the Git checkout
though). Updated the Gem specification file after testing.

14 years agoModified RDoc generation in Makefile and added Gem specification.
Shaun Rowland [Sat, 25 Jul 2009 18:09:56 +0000]
Modified RDoc generation in Makefile and added Gem specification.

Added a radum.gemspec file to create the Gem package and modified the Makefile
to generate the RDoc in a better way. Is is strange that I am working on Ruby
while at the PyOhio conference? :-)

14 years agoAdded usage() method to the live testing script.
Shaun Rowland [Sat, 25 Jul 2009 15:25:13 +0000]
Added usage() method to the live testing script.

Now it explains the environment variables required for live testing.

14 years agoUpdated users/groups array comments to be clearer.
Shaun Rowland [Fri, 24 Jul 2009 04:30:37 +0000]
Updated users/groups array comments to be clearer.

Updated the users/groups array comments to note the implicit membership
nature of users in their primary Windows group and how they won't show
up in those arrays because of that.

14 years agoThrew in some crazy user stuff someone might do.
Shaun Rowland [Fri, 24 Jul 2009 04:25:53 +0000]
Threw in some crazy user stuff someone might do.

Might as well test that too. As expected, it should make no difference,
but it should still be tested to make sure there is no error with internal
logic anyway.

14 years agoAdded more explicit checks to primary group live testing.
Shaun Rowland [Fri, 24 Jul 2009 04:18:42 +0000]
Added more explicit checks to primary group live testing.

14 years agoRemoved confusing comment.
Shaun Rowland [Fri, 24 Jul 2009 04:08:54 +0000]
Removed confusing comment.

That comment was more for myself than an end user.

14 years agoUpdated comments to add more information.
Shaun Rowland [Fri, 24 Jul 2009 04:02:27 +0000]
Updated comments to add more information.

14 years agoAdded group live testing and fixed group handling bug.
Shaun Rowland [Fri, 24 Jul 2009 03:57:03 +0000]
Added group live testing and fixed group handling bug.

Added code to make sure the user does not lose their UNIX membership
in a group when it is made the user's primary Windows group. Before
the Windows membership and UNIX membership was removed. If there
was a previous UNIX group membership, it should not be removed in that
step because the user should still be a UNIX member along with their
implicit Windows membership.

Added code to add a group to a group. This was not well tested and was
not working from the Active Directory perspective.

The code to check if a group is a member of another group was reversed
originally, thus it was fixed.

Modified group remove_user() code to ignore the case where the UNIX main
group is trying to be removed if it is also the primary Windows group.
In that case, we want the group to be removed from the user's groups array
even though it is the UNIX main group as the code handles that internally.

Changed the order of operations in primary_group= for users so that the
primary_group is set before trying to remove_group() the group so that
the UNIXUser will allow removal even if the group is the current UNIX
main group (because it can be determined that it is also the primary
Windows group - thus the special case is caught). This is due to internal
logic handling implicit memberships from the Windows and UNIX perspective.

Added comments to the remove_group() for UNIXUser objects that says it
will not raise the "group is UNIX main group" RuntimeError if the group
is also the primary Windows group to handle the special case where the
group is both.

Updated live testing to test group aspects. This should be about all there
is.

14 years agoUpdated to use the specific version of ruby-net-ldap.
Shaun Rowland [Tue, 21 Jul 2009 03:19:20 +0000]
Updated to use the specific version of ruby-net-ldap.

Updated code to make sure we are using ruby-net-ldap 0.0.4 exactly. I saw
some new Gems out there with different names. I am depending on 0.0.4
behavior though, so I am goin to make this explicit.

14 years agoAdded more testing to conversion live test section.
Shaun Rowland [Tue, 21 Jul 2009 03:08:09 +0000]
Added more testing to conversion live test section.

14 years agoExpanded live conversion testing and updated code to fix bugs.
Shaun Rowland [Mon, 20 Jul 2009 02:46:06 +0000]
Expanded live conversion testing and updated code to fix bugs.

Expanded the live testing with conversions and updated the code to handle
some issues where conversion from a User to UNIXUser was not updating
the uidNumber attribute (which is not normally possible to update, but
because of conversion, it can be).

14 years agoFixed scope of primary Windows group check in conversions.
Shaun Rowland [Mon, 20 Jul 2009 01:14:49 +0000]
Fixed scope of primary Windows group check in conversions.

It is safe to convert a group if it is the primary Windows group of a user
RADUM doesn't know about, but not if it is one that RADUM does know about -
because I have to have that logic for other reasons. Only the UNIX main group
full Active Directory check is necessary beyond what Container#destroy_group
would do in this case.

14 years agoChanged Active Directory full searches for conversions.
Shaun Rowland [Mon, 20 Jul 2009 01:03:43 +0000]
Changed Active Directory full searches for conversions.

Modified the code to allow for more extensive checks for the UNIXGroup/Group
conversion methods. Started writing live test code for conversions. Changed
some of the previous live testing methods to use the "?" format for methods.

14 years agoMade ldap_not_unix_group_member() more straight forward.
Shaun Rowland [Sun, 19 Jul 2009 22:21:56 +0000]
Made ldap_not_unix_group_member() more straight forward.

14 years agoRemoved unnecessary initialization.
Shaun Rowland [Sun, 19 Jul 2009 22:16:08 +0000]
Removed unnecessary initialization.

14 years agoUNIXUser/UNIXGroup live testing updates and fixes.
Shaun Rowland [Sun, 19 Jul 2009 22:02:37 +0000]
UNIXUser/UNIXGroup live testing updates and fixes.

- Added an ldap attribute to the AD object for easy external use if needed.

- Fixed a bug with load_next_uid and load_next_gid when UIDs/GIDs were in AD
and Active Directory so appeared twice in the search array built that ensures
UIDs/GIDs not yet syncrhonized are accounted for. The algorithm assumed that
there were only unique values in the search array generated. Now that is the
case.

- Misc. logger message fixes.

- Fixed Active Directory LDAP attribute vs. object attribute value comparisons.
Most values returned from an LDAP query are String values, but they are really
used as integers. In the code they are stored as integers, so the comparison
was not always accurate. This did not cause a problem, except for updates
when not needed (only for the UNIXUser object that had the shadow file
attributes always being updated). Now the comparision is done as String
values. This even works when comparing the primary Windows group since it
has a working to_s() method. There are some other cases where binary values
are returned from Active Directory LDAP queries, but let's pretend I didn't
mention that (those would not be compared by me any time soon).

- Modified the previous primary Windows group delayed membership handling
in AD#update_group() to only check when the object "item" is a User or
UNIXUser object (it could be a Group or UNIXGroup object in that code). This
is a cleaner version that is easier to understand... for me anyway.

- Added code to AD#update_user() to handle UNIX main group changes when
necessary because implicit UNIX group membership rules are a little different
than Windows group memberships. This is an easy way to deal with that problem,
at least with the code the way it is and the rules I put in place.

- Fixed a precedence bug in User#member_of?().

- Updated the live testing script with extensive UNIXUser/UNIXGroup testing,
which is the reason for all of these updates. And here I thought things
were mostly fine before I started testing UNIX stuff!

14 years agoModified all removed logic and fixed UNIXGroup bug.
Shaun Rowland [Sun, 19 Jul 2009 05:30:33 +0000]
Modified all removed logic and fixed UNIXGroup bug.

Modified the previous removed attribute logic. It used to be possible to
add removed objects back into the RADUM environment, but there was a problem
with this when it came to the loaded status because adding the object back
would try to update it instead of create it if AD#sync had been called between
the removal and addition back. There is really no use for this feature, so
it was itself removed. If an object is removed, it can't be added back into
the system. I also added many more tests for trying to pass in removed
(and by extension destroyed) objects where I was not checking before. This
caused a lot of other changes in tests and main body code too. In making
the removed changes, I accidently removed setting the unix_password for
UNIXGroup objects, which caused them not to get created properly. That
was fixed.

The live test was updated with the first step of UNIXUser testing.

14 years agoUpdated "removed" logic and updated live test.
Shaun Rowland [Sun, 19 Jul 2009 01:35:40 +0000]
Updated "removed" logic and updated live test.

I changed the system so that one cannot add objects that were removed or
destroyed back into the system. This also changes the logic in the initialize()
methods. I also was adding the unix_main_group to the Container for some reason
even though it has to already be there anyway.

14 years agoAdded primary_group tests and fixed primary_group order bug.
Shaun Rowland [Sat, 18 Jul 2009 23:47:38 +0000]
Added primary_group tests and fixed primary_group order bug.

Added testing for primary_group changes. In testing I discovered a slight
bug with the order of operations. Since we update the RADUM enviornment to
reflect the intention and groups are updated before users, the code would
try to add the user as a member of their old primary Windows group before
the primary group was changed for the user himself. The code actually worked,
but an LDAP error was returned. Instead, the new code checks if the user
in LDAP has had their primaryGroupID changed yet. If not, and it matches
the group being updated, we don't add them as a member. They will be added
as a member implicitly when AD#update_user() is called.

14 years agoUpdated must_change_passwd? logic and added live tests.
Shaun Rowland [Sat, 18 Jul 2009 21:05:17 +0000]
Updated must_change_passwd? logic and added live tests.

I updated the system to handle setting the must_change_password? attribute
correctly when loading and updating, plus allow the attribute to be cleared.
I added the live test script which tests against Active Directory.

14 years agoFixed LDAP name attribute handing for users and groups.
Shaun Rowland [Sat, 18 Jul 2009 20:17:49 +0000]
Fixed LDAP name attribute handing for users and groups.

The LDAP name attribute is based off of the LDAP cn attribute and cannot
be modified. I also added updating the LDAP description and displayName
attributes to update_user() - this is how I discovered the mistake in fact :-)

14 years agoAdded test for dn modification and initials handling in update_user().
Shaun Rowland [Sat, 18 Jul 2009 19:31:31 +0000]
Added test for dn modification and initials handling in update_user().

Added a test for the RuntimeError raised if the distinguished_name is
modified after a User or UNIXUser is loaded. Added updating the initials
attribute when modified. I also removed RDoc for methods that should
only be called internally.

14 years agoAdded notes and updated description and displayName handling.
Shaun Rowland [Sat, 18 Jul 2009 17:45:23 +0000]
Added notes and updated description and displayName handling.

Added notes to explain the difference between using RADUM and using the
Active Directory Users and Computers GUI tool to create accounts. Updated
the description and displayName LDAP attribute value generation to use
the new initials attribute instead of middle_name to better match what
Windows does by default.

14 years agoAdded middle initials handing for user and fixed dn bug.
Shaun Rowland [Sat, 18 Jul 2009 17:17:33 +0000]
Added middle initials handing for user and fixed dn bug.

Added the middle initials attribute as that is usually what is set instead
of middle_name. I fixed a bug with the distinguished_name attribute. It is
not safe to assume the defaults I had for users who are created with the
GUI tools. More testing has to be done here as well anyway.

14 years agoFixed common_name bug.
Shaun Rowland [Thu, 16 Jul 2009 01:41:55 +0000]
Fixed common_name bug.

Obviously, the cn attribute cannot be modified. Not sure why I had that in
there :-)

14 years agoAdded User to UNIXUser conversion and vice-versa. Fixed bugs.
Shaun Rowland [Wed, 15 Jul 2009 04:50:26 +0000]
Added User to UNIXUser conversion and vice-versa. Fixed bugs.

Added the ability to convert a User to a UNIXUser and a UNIXUser to a User.
This still needs to be tested! I also fixed some comment bugs and a bug
with the Group/UNIXGroup conversions not getting the group memberships
correctly for the conversions.

14 years agoI hate extra white space :-)
Shaun Rowland [Wed, 15 Jul 2009 03:55:00 +0000]
I hate extra white space :-)

14 years agoAdded a check for removed groups.
Shaun Rowland [Wed, 15 Jul 2009 03:28:42 +0000]
Added a check for removed groups.

Groups and UNIXGroups cannot be converted back and forth if they have
already been removed.

14 years agoChanged default for removing UNIXUser objects in unix_group_to_group.
Shaun Rowland [Tue, 14 Jul 2009 04:57:44 +0000]
Changed default for removing UNIXUser objects in unix_group_to_group.

This default made more sense, and I added an explicit check for the value
of the :remove_unix_users argument.

14 years agoFixed minor bugs with AD#load and AD#update_group and added new methods.
Shaun Rowland [Tue, 14 Jul 2009 04:45:15 +0000]
Fixed minor bugs with AD#load and AD#update_group and added new methods.

I fixed a bug in AD#load where it would not handle managing adding users
to new groups if they do not already exist in Active Directory. It is
possible to create a group before calling AD#load, so we can't depend on
the member attribute actually existing at that point.

In AD#update_group the member and msSFU30PosixMember attributes were not
being updated in the case where they did not already have a value.

I added methods to convert a Group to a UNIXGroup and a UNIXGroup to a Group.
Even if these changes are dropped, the other two fixes are important.

14 years agoFixed logic concerning using Domain Users.
Shaun Rowland [Thu, 9 Jul 2009 03:54:16 +0000]
Fixed logic concerning using Domain Users.

I fixed some logic in using Domain Users where I assume AD#load() was
called first. Even though that is normally the way things would work,
it is possible to just jam new accounts (that don't already exist of
course - and groups) into AD by just making them and syncing. Now
that is possible, but still, do yourself a favor and call AD#load first
anyway. I also made sure that groups that the system attempted to create,
but already existed, have their RID values discovered and modified.

14 years agoAdded the "Home folder" part of the Profile tab.
Shaun Rowland [Tue, 7 Jul 2009 02:44:23 +0000]
Added the "Home folder" part of the Profile tab.

Added a way to set either the "Local path" or "Connect ... To" parts of
the Home folder section of the Profile tab in the Active Directory Users
and Computers tool. This gets a little confusing because these options
are mutually exclusive, but there are two instance variables (and two
LDAP attributes) that represent them. I tried to explain this well, but
I will need to add a serious example. This should work right - provided
others know what I'm talking about based on the documentation.

14 years agoAdded logon script and profile paths.
Shaun Rowland [Mon, 6 Jul 2009 02:38:02 +0000]
Added logon script and profile paths.

Added a way to set the logon script (scriptPath) and Windows profile
(profilePath) path settings.

14 years agoPut in cn=Users safety measure.
Shaun Rowland [Wed, 17 Jun 2009 03:42:41 +0000]
Put in cn=Users safety measure.

Made AD#destroy_container also refuse to delete the Users container as a
saftey measure.

14 years agoAdded user destruction in delete_user private method.
Shaun Rowland [Tue, 16 Jun 2009 06:26:03 +0000]
Added user destruction in delete_user private method.

I forgot to actually destroy the user once it was removed from Active Directory
during an AD#sync call.

14 years agoUpdated AD#load and AD#sync logic.
Shaun Rowland [Tue, 16 Jun 2009 06:15:22 +0000]
Updated AD#load and AD#sync logic.

It is now possible to load multiple times. Anything previously loaded will
be ignored. Calling AD#sync is smoother and safe (which is probably was before)
to call more than once. There is logic to destroy things that were removed
from Active Directory properly. The set_loaded() methods were updated so they
can be called after an initial load and do the same thing. The set_loaded
methods are not meant to be called by the consumer, but they need to be there
for the AD object.

14 years agoUpdated RDoc for class method new() and with general usage notes.
Shaun Rowland [Tue, 16 Jun 2009 04:19:03 +0000]
Updated RDoc for class method new() and with general usage notes.

Updated RDoc to specify new() as a class method and noted the general pattern
for using RADUM.

14 years agoUpdated User/UNIXUser new() method arguments.
Shaun Rowland [Mon, 15 Jun 2009 05:45:54 +0000]
Updated User/UNIXUser new() method arguments.

Updated the User and UNIXUser new methods to take a hash of arguments. This
should be easier to deal with in the code. Fixed a bug where the initialize()
method for the UNIXUser class would always attempt to make the user a member
of their unix_main_group even if it was equal to their primary_group. That
should not happen.

14 years agoFixed RDoc.
Shaun Rowland [Mon, 15 Jun 2009 04:11:38 +0000]
Fixed RDoc.

Fixed some very small RDoc issues.

14 years agoUpdated find_user* and find_group* methods.
Shaun Rowland [Mon, 15 Jun 2009 03:41:23 +0000]
Updated find_user* and find_group* methods.

I updated the find_user* and find_group* methods to dry up the code by using
yield if a block is given to the base methods. This makes the code a little
cleaner. I also updated the Group and UNIXGroup creation in the AD#load
method.

14 years agoCleaned up users/removed_users and groups/removed_groups in AD class.
Shaun Rowland [Sun, 14 Jun 2009 18:13:02 +0000]
Cleaned up users/removed_users and groups/removed_groups in AD class.

There is no reason to iterate and push into the new array.

14 years agoSmall fix for instance variable.
Shaun Rowland [Sun, 14 Jun 2009 11:02:23 +0000]
Small fix for instance variable.

This isn't strictly necessary, but it follows the previous conventions.

14 years agoMisc RDoc fixes.
Shaun Rowland [Sun, 14 Jun 2009 09:58:15 +0000]
Misc RDoc fixes.

Improved RDoc with some minor changes.

14 years agoUpdated Group/UNIXGroup new() method arguments.
Shaun Rowland [Sun, 14 Jun 2009 09:14:44 +0000]
Updated Group/UNIXGroup new() method arguments.

Updated the Group and UNIXGroup new() method arguments to use a Hash. This
should make it easier to use in code.

14 years agoUpdated Container new() method arguments.
Shaun Rowland [Sun, 14 Jun 2009 08:26:54 +0000]
Updated Container new() method arguments.

Updated the Container new() method to take a Hash of arguments. This sould
be easier to code with.

14 years agoUpdated AD new() method arguments.
Shaun Rowland [Sun, 14 Jun 2009 08:02:15 +0000]
Updated AD new() method arguments.

Converted the AD new() method to use a Hash for arguments. This should make
it easier to code.

14 years agoFixed spacing for Logger constants.
Shaun Rowland [Fri, 12 Jun 2009 04:46:12 +0000]
Fixed spacing for Logger constants.

Added spacing for RDoc Logger constants.

14 years agoAdded more RDoc to output_file().
Shaun Rowland [Fri, 12 Jun 2009 04:35:13 +0000]
Added more RDoc to output_file().

Added information to the Logger#output_file() method to indicate the mode used
when opening the file.

14 years agoImproved AD class logging and added output filename capability.
Shaun Rowland [Fri, 12 Jun 2009 04:32:08 +0000]
Improved AD class logging and added output filename capability.

Added logging to the right places in the AD class. Replaced puts calls to
be logger.log calls (using LOG_NORMAL for things like warnings). Added the
ability to specify an output file that's always appended to, but created if
necessary.

14 years agoLimited logging.
Shaun Rowland [Fri, 12 Jun 2009 02:13:44 +0000]
Limited logging.

Logging every method is fairly crazy, so I am going to just log complicated,
critical areas.

14 years agoAdded more logging.
Shaun Rowland [Thu, 11 Jun 2009 06:16:47 +0000]
Added more logging.

Added more logging statements and made adjusted the format.

14 years agoAdded RADUM Logger class.
Shaun Rowland [Wed, 10 Jun 2009 06:03:58 +0000]
Added RADUM Logger class.

I added a Logger class to the RADUM module and put initial LOG_DEBUG statements
in the the other classes. There is more work to do.

14 years agoAdded destroy_user and destroy_group to Container.
Shaun Rowland [Wed, 10 Jun 2009 03:37:54 +0000]
Added destroy_user and destroy_group to Container.

Added the ability to destroy a User, UNIXUser, Group, or UNIXGroup in the
Container class. This is different than removing because removing causes
the object to be deleted from Active Directory. Deleting just removes all
references to the object from the RADUM system.

14 years agoFixed a group member addition bug and added @min_uid and @min_gid.
Shaun Rowland [Tue, 9 Jun 2009 06:12:24 +0000]
Fixed a group member addition bug and added @min_uid and @min_gid.

I fixed a bug where a new group with no AD member attribute failed to add
users (Windows group membership). I also added @min_uid and @min_gid to
return a reasonable minimum value for each if none are currently in Active
Directory.

14 years agoRemoved debug comment.
Shaun Rowland [Tue, 9 Jun 2009 05:08:28 +0000]
Removed debug comment.

Searching was spelled wrong anyway...

14 years agoFixed a bug with removed_users and removed_groups in AD.
Shaun Rowland [Tue, 9 Jun 2009 04:21:52 +0000]
Fixed a bug with removed_users and removed_groups in AD.

We need to check the removed Container objects for removed users and groups
too, since removing a container removes all of the users and groups for that
container (but previously it would be ignored in the past implementation).

14 years agoComment update.
Shaun Rowland [Mon, 8 Jun 2009 05:31:08 +0000]
Comment update.

Updated comments to reflect what is actually happening.

14 years agoExpanded Container removal.
Shaun Rowland [Mon, 8 Jun 2009 05:23:19 +0000]
Expanded Container removal.

Added code that handles Container removal properly. All users are also removed,
all groups are removed (if possible from what is known), and all Containers
are checked for a Container inside the target Container. If none of these fail,
the Container itself is removed. If one condition cannot be met, everything that
can be removed is removed. I renamed the private AD methods for removal to use
the word "delete" instead so that it is clearer and so there is no conflict
with the public remove_container method. I fixed a bug with the Container
remove_group() method.

14 years agoConverted to a Git repository.
Shaun Rowland [Sun, 7 Jun 2009 18:20:32 +0000]
Converted to a Git repository.

I converted RADUM to a Git repository because most Ruby projects use Git.

14 years agoSmall comments fix.
Shaun Rowland [Fri, 5 Jun 2009 05:09:38 +0000]
Small comments fix.

Fixed my "has" which was supposed to be "hash" while reading the code tonight.

14 years agoFixed user removed check.
Shaun Rowland [Sun, 31 May 2009 09:34:15 +0000]
Fixed user removed check.

I made the check in UNIXUser's remove_group() method match the corresponding
check in UNIXGroup's remove_user() check.

14 years agoAdded UNIXGroup membership handling and updated tests.
Shaun Rowland [Sun, 31 May 2009 09:19:51 +0000]
Added UNIXGroup membership handling and updated tests.

UNIXGroup membership handling is complicated because the @groups and @users
arrays in User/UNIXUser and Group/UNIXGroup objects really represents Windows
group membership. These are the "RADUM Rules for Users and Groups":

1. A user is not a member of their primary Windows group.

2. A user is a member of their UNIX main group:
     a. From the Windows perspective.
     b. Not from the UNIX perspective.

Since the view from a User/UNIXUser or Group/UNIXGroup object shows the
Windows group memberships, special handling is required when a UNIXUser
has their UNIX main group changed (does not remove Windows group mebership)
and then they are also removed from the UNIXGroup (would normally remove
then from UNIX group membership). Because the UNIX main group doesn't normally
have the UNIXUser as a member anyway, the second remove would cause an attempt
to remove the UNIXUser when they were not already a member anyway.

I also changed the code so that a UNIXUser could not be removed from their
UNIX main group and their UNIX main group could not be removed either. This
automatic Windows group and UNIX group management when the @groups and @users
arrays really represent Windows group membership makes things very complicated
in the RADUM module (though this should mostly be hidden from the customer).

14 years agoAdded main UNIX group check to remove_group() method.
Shaun Rowland [Sun, 31 May 2009 06:14:09 +0000]
Added main UNIX group check to remove_group() method.

A group should not be removed if it is the main UNIX group for any user
account. This is similar to the primary Windows group check and was added
in the same place.

14 years agoAdded user and group removal.
Shaun Rowland [Sun, 31 May 2009 05:54:46 +0000]
Added user and group removal.

Added the first sync() steps that remove users, then remove groups. Users
need to be removed first in case any of them have a removed group as their
primary Windows group. There still needs to be a check for any main UNIX
group members as well. The search in remove_group() needs to check all
users in Active Directory since some might not be known about in the RADUM
system at any given point. This is inefficient, but removing groups is not
a usual action in my experience. Even so, it should not be too bad.