Web Hosting Talk







View Full Version : Got cpanelmail to work! See attached.


hdezela
05-21-2003, 04:04 AM
Well, after playing around with it for a while, I found three specific problems with this script:

1.- It never actually checked the database to see if the username was taken.

2.- It didn't record the user's password in the database.

3.- It didn't check to see if "Your Name" was entered.

I fixed that and also added a checkbox to act as an "I've read the bla bla and agree to it".

It now first checks the database to see if the user is in there, if not, it goes on with the script, else it gives an alert.

MAKE SURE YOU POPULATE THE DATABASE WITH THE EXISTING USERS, I HAVE NO IDEA WHAT WOULD HAPPEN IF YOU TRIED TO REGISTER SOMEONE WHO IS ALREADY THERE.

Then it checks the form in top-down order, ie:

1.- checkbox
2.- name
3.- alternate email
4.- password match

If all conditions are met, it creates an entry in the database with the user's data and creates an email box for the user.

Also, if my javascript is clunky, it's because this is the first time I have ever played with any programming at all. It's just I'm so proud of myself for gettting it to work that I had to share. :D

The Prohacker
05-21-2003, 11:42 AM
Not a bad script idea..

One thing is, you could use the cpanel username and password for the MySQL connection, as its the mater mysql user for each domain... So a second user isn't generally needed.. You could write a setup script to do the database creation and import.. I beleive :D

Also, another way of doing this without cpanel would be editing /home/usrname/etc/passwd and shadow and make the email directories. But migth be a little more hassle.. :D

Good work none the less :D

hdezela
05-21-2003, 02:28 PM
It wasn't actually my idea, I got it from a post in this forum and just played around with it until it worked. Just wanted to clarify that.

Also...I'm still proud of myself for this :D , although perhaps excessively, I've just realized I created over 40 email accounts on my server playing with it, so I'm gonna have to go through and erase like 38 of those... :o

roby2k
05-21-2003, 04:32 PM
good script this mate... now all we av to do is moan about getting emails to change the passwords lol

roby2k
05-27-2003, 06:07 AM
bump