# HG changeset patch # User Jean-Francois Pieronne <jf.pieronne@laposte.net> # Date 1587571520 -7200 # Wed Apr 22 18:05:20 2020 +0200 # Node ID bfb6aa2d338bada366cc1f96d49c856cd30ff518 # Parent 23479c332cced3574f393b139426c314e70470b1 secrules/user_exists.py initial version diff --git a/secrules/user_exists.py b/secrules/user_exists.py new file mode 100644 --- /dev/null +++ b/secrules/user_exists.py @@ -0,0 +1,12 @@ +from vms import starlet +from vms import itemList, uaidef + +def user_exists(u): + itm = [itemList.itemList (code=uaidef.UAI__UIC, dtype=itemList.il_unsignedLong),] + try: + s, uic = starlet.getuai (usrnam=u, itmlst=itm) + uic_g = uic.values()[0] / 65536 + uic_m = uic.values()[0] - (uic_g * 65536) + return uic_g, uic_m + except: + return None, None