6423241

LoopbackDriverSubscriberEventPolicy

Jan 30th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?><policy xmlns:es="http://www.novell.com/nxsl/ecmascript">
  2. <rule>
  3. <description>FindExpiredGuests</description>
  4. <comment xml:space="preserve">This is to find expired guest accounts</comment>
  5. <comment name="author" xml:space="preserve">CNM</comment>
  6. <conditions>
  7. <and>
  8. <if-operation mode="nocase" op="equal">trigger</if-operation>
  9. <if-op-property mode="nocase" name="source" op="equal">FindExpiredGuests</if-op-property>
  10. </and>
  11. </conditions>
  12. <actions>
  13. <do-trace-message level="1">
  14. <arg-string>
  15. <token-text xml:space="preserve">Policy rule triggered by job 'findExpiredGuests'</token-text>
  16. </arg-string>
  17. </do-trace-message>
  18. <do-set-local-variable disabled="true" name="lv-now" scope="policy">
  19. <arg-string>
  20. <token-time format="!CTIME" tz="UTC"/>
  21. </arg-string>
  22. </do-set-local-variable>
  23. <do-set-local-variable name="listOfExpiredGuests" scope="policy">
  24. <arg-node-set>
  25. <token-query class-name="User" datastore="src" max-result-count="200">
  26. <arg-dn>
  27. <token-global-variable name="idv.dit.data.users"/>
  28. </arg-dn>
  29. <arg-match-attr name="OSUaffiliationList">
  30. <arg-value type="string">
  31. <token-text xml:space="preserve">Guest</token-text>
  32. </arg-value>
  33. </arg-match-attr>
  34. </token-query>
  35. </arg-node-set>
  36. </do-set-local-variable>
  37. <do-append-xml-element expression="." name="ExpiredGuests"/>
  38. <do-set-local-variable disabled="true" name="ldap-filter" scope="policy">
  39. <arg-string>
  40. <token-text xml:space="preserve">(OSUguestExpires&lt;</token-text>
  41. <token-local-variable name="lv-now"/>
  42. </arg-string>
  43. </do-set-local-variable>
  44. <do-set-local-variable name="ldap-filter" scope="policy">
  45. <arg-string>
  46. <token-text xml:space="preserve">(&amp;(OSUaffiliationList=Guest)(OSUguestExpires>=</token-text>
  47. <token-convert-time dest-format="YYYYMMdd000000'Z'" src-format="!CTIME" src-tz="UTC">
  48. <token-time format="!CTIME" tz="UTC"/>
  49. </token-convert-time>
  50. <token-text xml:space="preserve">)(OSUguestExpires&lt;=</token-text>
  51. <token-convert-time dest-format="YYYYMMdd235959'Z'" src-format="!CTIME" src-tz="UTC">
  52. <token-time format="!CTIME" tz="UTC"/>
  53. </token-convert-time>
  54. <token-text xml:space="preserve">))</token-text>
  55. </arg-string>
  56. </do-set-local-variable>
  57. <do-clone-xpath dest-expression="ExpiredGuests" src-expression="es:ldapSearchWithTLS('~NOVLLIBLDAP.host~','~NOVLLIBLDAP.port~','~NOVLLIBLDAP.user~','~NOVLLIBLDAP.password~','~NOVLLIBLDAP.base~','~NOVLLIBLDAP.scope~','~NOVLLIBLDAP.keystore~',$ldap-filter,'cn')"/>
  58. <do-for-each>
  59. <arg-node-set>
  60. <token-xpath expression="*/instance"/>
  61. </arg-node-set>
  62. <arg-actions>
  63. <do-set-local-variable name="userDN" scope="policy">
  64. <arg-string>
  65. <token-xpath expression="$current-node/@src-dn"/>
  66. </arg-string>
  67. </do-set-local-variable>
  68. <do-set-local-variable name="lv-CN" scope="policy">
  69. <arg-string>
  70. <token-parse-dn dest-dn-format="dot" length="-1" src-dn-format="ldap" start="-1">
  71. <token-local-variable name="userDN"/>
  72. </token-parse-dn>
  73. </arg-string>
  74. </do-set-local-variable>
  75. <do-trace-message notrace="true">
  76. <arg-string>
  77. <token-text xml:space="preserve">This is an expired guest.</token-text>
  78. <token-local-variable name="userDN"/>
  79. </arg-string>
  80. </do-trace-message>
  81. <do-trace-message level="1">
  82. <arg-string>
  83. <token-text xml:space="preserve">user account </token-text>
  84. <token-local-variable name="lv-CN"/>
  85. <token-text xml:space="preserve">flagged inactive (userStatus attribute = 0) </token-text>
  86. <token-text xml:space="preserve">based on a guest expiration with today's date</token-text>
  87. </arg-string>
  88. </do-trace-message>
  89. <do-set-src-attr-value class-name="User" disabled="true" name="userStatus">
  90. <arg-dn>
  91. <token-text xml:space="preserve">\ID1\OSUMC\users\</token-text>
  92. <token-local-variable name="lv-CN"/>
  93. </arg-dn>
  94. <arg-value type="string">
  95. <token-text xml:space="preserve">0</token-text>
  96. </arg-value>
  97. </do-set-src-attr-value>
  98. <do-add-src-attr-value class-name="User" disabled="true" name="IWS:User Comment">
  99. <arg-dn>
  100. <token-text xml:space="preserve">\ID1\OSUMC\users\</token-text>
  101. <token-local-variable name="lv-CN"/>
  102. </arg-dn>
  103. <arg-value type="string">
  104. <token-text xml:space="preserve">Account entered inactive status on </token-text>
  105. <token-time format="!MEDIUM.DATETIME"/>
  106. </arg-value>
  107. </do-add-src-attr-value>
  108. </arg-actions>
  109. </do-for-each>
  110. </actions>
  111. </rule>
  112. <rule>
  113. <description>Veto All</description>
  114. <conditions>
  115. <and/>
  116. </conditions>
  117. <actions>
  118. <do-veto/>
  119. </actions>
  120. </rule>
  121. </policy>
Add Comment
Please, Sign In to add comment