I want to let my internal users create a temporary account which is available for a desired amount of days. And after the expiration the account and the created directory will be deleted automatically.It's intended for sharing files with an external comany only for a short time.

The following code is a simple PHP-Site with a dropdown-menu where you can chose the amount of days the account is available. After submitting, the script creates a user with the accordant homedir and with a prefix, the expiredate and a random number in the username (exp. tmp_YYYYMMDD1234)(Sorry, but the comments in the script are in german)