Create action upon login

I have seen it somewhere but cannot remember where! How can I create an action upon a webmin user login? I would like to send an email each time a webmin/virtualmin user logs on in account.

Thanks in advance.

Status: 
Closed (fixed)

Comments

There is a way to this, but it isn't very well documented - just edit /etc/webmin/miniserv.conf and add the line :

login_script=/path/to/your/script.sh

then run :

/etc/webmin/restart

There is a way to this, but it isn't very well documented - just edit /etc/webmin/miniserv.conf and add the line :

login_script=/path/to/your/script.sh

then run :

/etc/webmin/restart

Thanks. How can I use virtuamin variables in that script? $DOM $USER and so on...

You can't get the domain, but the parameters passed to script are : username, webmin session ID, remote IP address, local IP address

From the username, you could use the Virtualmin command line API to get the domain ..

a little more help... How do I get the value from variable username? I am new to perl scripting. Thanks in advance.

If this is a perl script, the username can be found in $ARGV[0]

Automatically closed -- issue fixed for 2 weeks with no activity.