/home/accounts/usermanage/ contains a number of scripts to manage accounts. Must be root or sudo accounts to access. NOTE: Always run as accounts.
/home/accounts/usermanage/adduser/adduser.pl scripts setting up the account. Note you need a username, password and id number for the account to be setup.
Points to note:
ID number can be left blank in the case of clubs and societies.
Don't Use capitals in account names. May cause problems elsewhere in the system (unconfirmed).
usermanage/adduser/showaccounts.pl -u username Shows if a username is already in use.
apg is a good package to generate random passwords complete with english translation.
/home/accounts/usermanage/adduser/showaccounts.pl [options] Options: -u User Name -t User Type [U|P|S|A|C|T|L|D] --help|-h Brief Help Page -m Manual Page
/home/accounts/usermanage/adduser/userpaid.pl [options] Options: -u User Name -l Lifetime member -t Ten Year Member --help|-h Brief Help Page -m Manual Page
So to just renew an acocunt for a year:
userpaid.pl -u $USERNAME_TO_RENEW
To change an account from one type to another (1 year, 10 year, etc.) do: userpaid.pl --help to list the options required.
For example a 10 year account is:
userpaid.pl -u $USERNAME_TO_RENEW -t
Still a manual process. Until a script is written you must: Movw the record from tblDisusered to tblUsers, add the ldif of the account to LDAP and restoring the home dir or creating a new one. usersOfType() in common/dbhandle.pl has some of the SQL involved.
If you want to get rid of the tblDisusered entry manually, just do this in mySQL: mysql -u $DBUSERNAME -p$DBPASSWORD -h db.csn.ul.ie -e "DELETE FROM tblDisusered WHERE txtUsername = '$ACCTORESTORE'" $DATABASE where:
$DBUSERNAME = username for the accounts database
$DBPASSWORD = password fo the accounts database
$ACCTORESTORE = username to restore
$DATABASE = name of the accounts database
Delete the ldap and db records, the home dir and mail spool.
Things to Do
Write An account Delete Script that works.
Write a working Restore script.
Hack the adduser script to convert any inputted username to all lowercase _before_ checking its availability.