Re: [Freeipa-devel] Include proposal to contrib (expired user accounts query tool)

2013-11-15 Thread Antti Peltonen
Hi,

Neat little dirty rework but it appears that the framework took all the fun
out of learning Python-LDAP away. ;)

I think I keep the current codebase of my tool as it is and do a fork from
it to run as a IPA plugin. I will on later date submit that for a contrib
review when it is as complete as the standalone version is now.


On 15 November 2013 10:22, Alexander Bokovoy aboko...@redhat.com wrote:

 On Fri, 15 Nov 2013, Antti Peltonen wrote:

 Hi,

 On 14 November 2013 21:06, Dmitri Pal d...@redhat.com wrote:

  A quick look at the tool's command line indicates that it is probably not
 using any of the IPA framework and rather goes over LDAP. I am not sure
 that this is the best approach, let us discuss...


 Could you please point me towards to some documentation on howto implement
 this tool with IPA framework or should I just go and read some code? :)

 You can start with http://abbra.fedorapeople.org/guide.html

 Attached is a simple rewrite of your code that I did in ~30 minutes or
 so. Just drop it into ipalib/plugins (/usr/lib/python2.7/site-
 packages/ipalib/plugins/user_addon.py on my
 Fedora 19 VM) and restart the server. There is a lot to polish there
 (unrelated options need to be masked/removed, better handling of expire
 option, etc.) but it works by providing you a list of users whose passwords
 did expire:

 $ LANG=en_US.utf8 ipa user-find-expire  --expire=2015020100
 -
 1 account matched
 -
   User login: admin
   Full name: Administrator
   Expire date: 20140211151057Z
 
 Number of entries returned 1
 

 Also worth noting, the way IPA framework is built, the same file must
 present at the client where 'ipa' utility is being run -- we do so by
 packaging all ipalib/plugins/* to a freeipa-python subpackage and then
 freeipa-admintools simply requiring it.


 --
 / Alexander Bokovoy




-- 
Antti Peltonen | Homo sapiens | planet Earth
blog http://bcow.me | email antti.peltonen@iki.f antti.pelto...@iki.fii
irc bcow@IRCNet,Freenode
___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

[Freeipa-devel] Include proposal to contrib (expired user accounts query tool)

2013-11-14 Thread Antti Peltonen
Hi all,

I have created the following
https://bitbucket.org/bcow/freeipa-expired-user-accounts-query tool to
mitigate a situation when users in directory never login to servers and
therefore do not receive alerts about expiring passwords. My tool can be
used to query the LDAP directory and list users that have expired passwords
and/or users with passwords about to expire in given amount of days.
External script can then be executed for each matching user to generate a
warning for the user via selected medium, for example by email.

-- 
Antti Peltonen | Homo sapiens | planet Earth
blog http://bcow.me | email antti.peltonen@iki.f antti.pelto...@iki.fii
irc bcow@IRCNet,Freenode
___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Re: [Freeipa-devel] Include proposal to contrib (expired user accounts query tool)

2013-11-14 Thread Antti Peltonen
Hi,

On 14 November 2013 21:06, Dmitri Pal d...@redhat.com wrote:

 A quick look at the tool's command line indicates that it is probably not
 using any of the IPA framework and rather goes over LDAP. I am not sure
 that this is the best approach, let us discuss...



Could you please point me towards to some documentation on howto implement
this tool with IPA framework or should I just go and read some code? :)

-- 
Antti Peltonen | Homo sapiens | planet Earth
blog http://bcow.me | email antti.peltonen@iki.f antti.pelto...@iki.fii
irc bcow@IRCNet,Freenode
___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel