Help - Search - Members - Calendar
Full Version: Perl Script
Linuxhelp > Support > Technical Support
euromail
My first post here, so hello everyone smile.gif

I'm working on a webmail system and would like to know how to create unix users from a registration page, I'm assuming I'll need to use perl?

Anybody got ANY ideas? I've tried a quick trawl of google and hotscripts.com to no avail

Any help would be really appreciated wink.gif
Hemant
i can do that in PHP any takers...?????? biggrin.gif biggrin.gif biggrin.gif
Hemant
Well...it seems that there are no takers for PHP script. mad.gif mad.gif

So...i will tell you how you can do it in perl...I am not a perl master..But i thing adding users via registration page should be simple(..could be dangerous also from security point of view).

All you have to do is to execute the command useradd and pass the arguments provided by the user.there must be some way in perl which allows..you to execute command...Likesystem function of C.

Just use that function and pass the arguments to the function and execute useradd and it will work.If you don't know that..and you are a complete noob in perl then i will check out and reply soon.
Termina
I too made a PHP script for that. wink.gif Well, a PHP script that uses a bash script. XD It asks for a username, password, and description. It then makes sure that the user owns their own folder, and that nobody is the group owner (so that people can view your public_html dir, if you have one).

There's probally an easier way to do this, but I'm far too lazy to figure out another way. happy.gif

#!/bin/bash
sudo useradd $1 -m -p $2 -s /bin/bash
echo "$3" > /home/$1/.plan
sudo /bin/chown -R $1 /home/$1
sudo /bin/chgrp -R nobody /home/$1
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.