Hi,
I'm not that familiar with FEU but...
aerdna wrote:isn't there maybe a way with the existing functions from the module?
I doubt it because the Help file indicates the functionality is deliberately missing to avoid other modules falling over.
when there is a function that sets the user to expired, is it possible to trigger the delete from there?
I don't know but it's the sort of hook I'd expect to see.
Meanwhile, going via cmscli...
Code: Select all
cmscli feu-user-add blackdog1 brilliant-passsword 'Group 001'
cmscli feu-user-add blackdog2 brilliant-passsword 'Group 001'
cmscli feu-user-edit blackdog1 --expires 'yesterday'
cmscli feu-user-edit blackdog2 --expires 'yesterday'
cmscli feu-user-list --expired
6 blackdog2
5 blackdog1
(Use feu-user-list --expired -j for all field values in json format)
How you deal with the output is down to environment but under bash, a bare bones approach might look like this;
Code: Select all
#!/bin/bash
for user in $( cmscli feu-user-list --expired | awk '{print $2}' ); do
echo $user will be destroyed
cmscli feu-user-del "$user"
done
That's throwing a php notice here (CMSCLI 0.5, CMSMS 2.2.8, FEU 2.13, CGExtensions 1.61.5) but the expired users are no more.
Code: Select all
PHP Notice: Undefined index: REMOTE_ADDR in .../htdocs/cmsms2/modules/CGExtensions/lib/class.cge_utils.php on line 421