Let Users create their own accounts (Upgraded for 4.3)

This section contains scripts that hMailServer has contributed with. hMailServer 4 is needed to use these.
hytek
New user
New user
Posts: 5
Joined: 2007-05-29 22:57

Post by hytek » 2007-05-30 05:31

will do..Im also having issues with a password change script and my rouncube plugin. It will be nice once i get it going also. If anyone has this setup running on a windows 2003 server with apache 2.2 , perl 5.2, phpmyadmin etc..I am using the newest version of appserv. Anyways if someone else has this type of setup i would be interested in sharing thoughts..

hytek
New user
New user
Posts: 5
Joined: 2007-05-29 22:57

Post by hytek » 2007-05-30 05:37

Same Probelm message saying i have 26 unallowed characters(spam)..Anyways...

cybergenesis
New user
New user
Posts: 1
Joined: 2007-06-12 09:37

Account activation

Post by cybergenesis » 2007-06-12 09:43

hytek,

Line 15 needs to be: $admin_Default_activate = "1";

So replace "default" with "Default" (case sensitivity issue, its different later in the script).

Activation should work with that.

I might add in one of those various capchas scripts (you know where you type in the characters) so that should reduce the chance of spam.

Let me know if anyone is interesting in me posting this...

hytek
New user
New user
Posts: 5
Joined: 2007-05-29 22:57

Post by hytek » 2007-06-15 04:14

I would Be Interested in that script.

Thanks for the advice i will make changes and let you know.

Cheers!

User avatar
adrianp918
Normal user
Normal user
Posts: 48
Joined: 2007-04-11 15:51
Location: Kettering, Ohio
Contact:

Post by adrianp918 » 2007-08-08 14:16

have a question on this script, my email server is on one machine (hmail) and my webserver is on another machine, would this still work?

User avatar
danny6167
Senior user
Senior user
Posts: 472
Joined: 2007-02-07 15:24
Location: Western Australia
Contact:

Post by danny6167 » 2007-08-08 17:39

This scripts apears to create the accounts by adding to the mysql database.

If your 2nd server can acces the database then yes just set the mysql host user and pass

User avatar
adrianp918
Normal user
Normal user
Posts: 48
Joined: 2007-04-11 15:51
Location: Kettering, Ohio
Contact:

Post by adrianp918 » 2007-08-08 20:11

is this script functional as of now,? this owuld be a really great addition hmail, i am loving this mail server.

User avatar
danny6167
Senior user
Senior user
Posts: 472
Joined: 2007-02-07 15:24
Location: Western Australia
Contact:

Post by danny6167 » 2007-08-09 08:47

it is funtional for hmail 4.3 but i am un shure weather this works for 4.4

User avatar
adrianp918
Normal user
Normal user
Posts: 48
Joined: 2007-04-11 15:51
Location: Kettering, Ohio
Contact:

Post by adrianp918 » 2007-08-09 15:02

LOL man why do i always have to have the versions that seem to have the issues, lol i guess i will see what i can dig into this and find out

User avatar
danny6167
Senior user
Senior user
Posts: 472
Joined: 2007-02-07 15:24
Location: Western Australia
Contact:

Post by danny6167 » 2007-08-09 15:04

can any verify weather this works on newer versions?
Or is there another script.

User avatar
danny6167
Senior user
Senior user
Posts: 472
Joined: 2007-02-07 15:24
Location: Western Australia
Contact:

Post by danny6167 » 2007-08-09 15:16

with vertion 4.4 i get a
"Field 'accountvacationmessage' doesn't have a default value"
error message

User avatar
danny6167
Senior user
Senior user
Posts: 472
Joined: 2007-02-07 15:24
Location: Western Australia
Contact:

Post by danny6167 » 2007-08-09 15:24

after going in to sqlyog and unticking "not NUL" on all the feilds it works. i just need to work out the php errors related to me not setting mail out settings in php.

also i get thease

Notice: Undefined index: name in E:\htdocs\create\index.php on line 21

Notice: Undefined index: user in E:\htdocs\create\index.php on line 22

Notice: Undefined index: domain in E:\htdocs\create\index.php on line 23

Notice: Undefined index: pass1 in E:\htdocs\create\index.php on line 24

on line 21, 22, 23 and 24 i have

$strName = addslashes( $_POST['name'] );
$strUser = addslashes( $_POST['user'] );
$strDomain = addslashes( $_POST['domain'] );
$strPass1 = addslashes( $_POST['pass1'] );
$strMD5Pass = md5( $strPass1 );


ne one know y

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2007-08-09 16:09

I would suggest you use this one by gruenie instead.

http://www.hmailserver.com/forum/viewto ... 5008#45008

User avatar
danny6167
Senior user
Senior user
Posts: 472
Joined: 2007-02-07 15:24
Location: Western Australia
Contact:

Post by danny6167 » 2007-08-09 16:40

thanks Doom but......
Incorrect integer value: '' for column 'accountactive' at row 1

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2007-08-09 17:43

Are you using an external database?

User avatar
danny6167
Senior user
Senior user
Posts: 472
Joined: 2007-02-07 15:24
Location: Western Australia
Contact:

Post by danny6167 » 2007-08-09 17:45

Iv done something stupid, Haven t I?

Using external MySQL on same computer.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2007-08-09 17:50

lol, No I am pretty sure those errors are caused by 'Strict Mode' being enabled. If you turn strict mode off those errors should go away.

User avatar
danny6167
Senior user
Senior user
Posts: 472
Joined: 2007-02-07 15:24
Location: Western Australia
Contact:

Post by danny6167 » 2007-08-09 17:52

umm are you talking about strict mode error reporting?
The script doesnt work at all at least the first one worked.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2007-08-09 18:25

No, MySQL Strict Mode does a lot more validation on values entered into the database.

http://dev.mysql.com/doc/refman/4.1/en/ ... rking.html

As for the first script it should still work. Those notices you reported can be safely ignored. PHP is just complaining because the variables were not defined before they were used.

kenzak
New user
New user
Posts: 1
Joined: 2007-09-14 18:06

Senario: Using this code in a K12 School

Post by kenzak » 2007-09-14 18:42

Greetings,

I can't get my head around this script and were it fits in. I want to use hMailServer and SquirrelMail in a two server setup. The hMailServer box will be hidden behind one of two NICs on the SquirrelMail box. (This will prevent any sending/receiving of off box email.)

My question: Will I place this script (call it signup.php) on the frontend (SquirrelMail Box) with a link to it from the SquirrelMail frontpage? (i.e. To register for your account click here.) AND
How role does phpwebadmin play at this point and will it function from the frontend server?

Thick in the purple haze,
Ken

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-01-29 07:07

I am using the script that gruenie made and am using hmail 4.4. I configured everything, go to register and everything goes well. Except i never recieve an email saying someone is trying to register and if i approve or not. Even if i turn that off it still does not work (it still says it needs to be validated).

Any ideas?

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2008-01-29 10:29

dumb question but did you change

$admin_email = ""; //Administrators email to send notifications)

Does the script just goto a white screen? Are there any errors in your PHP log?

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-01-29 16:13

^DooM^ wrote:dumb question but did you change

$admin_email = ""; //Administrators email to send notifications)

Does the script just goto a white screen? Are there any errors in your PHP log?
Yes I did put an admin email in, I will look at my error logs soon and let you know.

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-01-29 16:17

There are no error logs, and i get the correct message after creating the account.

"Your account has been created but requires activation by administration.Once your application has been approved, you will receive a confirmation message."

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2008-01-29 18:04

Enable SMTP and application logging, create an account through the script and see if it even attempts to send an email.

This could just be a PHP.ini issue where the mail servers IP address has not been set correctly.

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-01-29 19:42

^DooM^ wrote:Enable SMTP and application logging, create an account through the script and see if it even attempts to send an email.

This could just be a PHP.ini issue where the mail servers IP address has not been set correctly.
Alright, I don't believe i have smtp enabled. For the php.ini, i have the mail and web server on the same server/ip address so it should just be set to localhost correct?

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2008-01-30 04:02

try changing it to 127.0.0.1 if it's not working

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-01-30 06:54

I did have smtp enabled. I dont see anywhere where it says that it attempted to send an email. There are no errors in the php error log.

Im a bit stumped...Can i send you my script via pm?(^DooM^)

Edit: The user accounts i tried creating showed up in my hmailserver users list. They are not active though, as in me needing this email...

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2008-01-30 12:32

Ok as a test stick the following line in a php file on your webserver. (Note the mail function should all be on a single line as the forum has wrapped it)

Code: Select all

<?PHP
Mail( "your@emailaddress", "Test Subject.", "Test message", "From: Test Account <your@emailaddress.com>\r\nReply-To: your@emailaddress.com" );
?>
Replace everywhere it says your@emailaddress.com with your domain name and username save and run it.

You "Should" get an email through. If not then there is a configuration error in your PHP.ini

If you do get an email through change the first your@emailaddress.com to a remote email account (Gmail for instance) and run it again.

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-01-30 17:22

That script works perfectly for when i send it to my email(my domain), but when i send it to an outside address (tried gmail and hotmail) it gave me this error.

Warning: mail() [function.mail]: SMTP server response: 550 Delivery is not allowed to this address. in C:\webs\compsnet\test2.php on line 2

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2008-01-30 18:13

That is fine and as it should be. It is showing that your PHP.ini is setup correctly and PHP can email using hMail locally.

Now based on that information the script should work.

I haven't used this particular script. Are you sure there aren't any more PHP errors when using the script?

is there perhaps a space in the admin email address that shouldn't be there?

Is the admin email address a local mail address?

Let me know, then we can proceed from there.

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-01-30 18:25

I am positive there arent any more php errors while using the script.

I checked twice, there is no spaces or errors in the admin email address.

Yes the admin email address is local.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2008-01-30 20:55

Ok. I think I need to test this script out myself.

I won't have chance tonight, I will attempt to test this out tomorrow for you on my own setup.

I will reply to this thread when I have anything to report.

Cheers!

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-01-30 20:57

^DooM^ wrote:Ok. I think I need to test this script out myself.

I won't have chance tonight, I will attempt to test this out tomorrow for you on my own setup.

I will reply to this thread when I have anything to report.

Cheers!
Thank you very much!

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-02-01 05:06

^DooM^ I got it working. I added these two lines at the top of the script.

ini_set ("SMTP","mail.example.com");
ini_set ("sendmail_from","webmaster@example.com");

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2008-02-01 10:48

Hi Plobby,

That doesn't make any sense as they are just PHP.ini settings and we proved the mail(); function works.

Glad you have it working now though and sorry I couldn't get back to you sooner.

Cheers!

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-02-01 17:44

I actually had someone take a look at the script, and he made a few changes to it. Mainly changing cases. After he did this, I got an error saying the php.ini sendfrom_mail was incorrect or it was missing a from header or something like that in the script. So then I put that in there and it all works now.

It's alright, I just have next to no knowledge with php, or any other code for that matter :p

elsalvos
New user
New user
Posts: 1
Joined: 2008-02-13 17:26

Post by elsalvos » 2008-02-14 01:36

I have quick question, I'm slow finder so please hang with me.
I copy this script to my server but for the life of me, I can see on this thread (don't mean is not there) where (path)to place this files like "sighup.php" and what file to edit to call this form or how to install this plug-in form.
If some can point me to the right direction how to add form to SM I would greatly appreciate it.
there is a bunch of smart people here, I would never learn all this by myself, even if I lived 1000 years.

f1977
New user
New user
Posts: 1
Joined: 2008-04-01 18:25

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by f1977 » 2008-04-01 18:40

is it 4.4 that makes this script useless or is it my hmailserver setup.. In order for the php script created email accounts to become activeated you need to restart the hMailServer or it wont see the new accounts.

Any way around this, or is it hardcoded?

thanks in advance

[Edit to not doublepost]

@elsalvos

1). Go to your www or htdocs folder (wherever your webserver uses as webroot) right click on an empty space in this folder and select New --> Text document
2). Name the file whateveryouwant.php (when windows asks you if you want to change the file extension select Yes)
3). Right click this newly created file (whateveryouwant.php) and select Open with.. Notepad
4). Copy & Paste any of the PHP scripts throughout this topic into this new text document.
5). Save the text file and exit notepad
6). edit these lines to fit your needs:

Code: Select all

//MySQL database connection information
//MySQL connection information:
$mysql_host = "Change Me"; //Host Name
$mysql_user = "Change Me"; //Username
$mysql_pass = "Change Me"; //Password
$mysql_db = "hmailserver"; //Database

//General Configuration:
$form_title = "Change Me"; //Name for this form
$account_max = "10000000";  //Maximum size per account (1000000 = 1MB -> Do not uses spaces or commas!)
$admin_notify = "1"; //1 = yes & 0 = no
$admin_email = "Change Me"; //Administrators email to send notifications)
$admin_default_activate = "0"; //1 = yes & 0 = no -> If no, the administrator has to authorise the account
$accountisad = 0; // account is AD-account? 0 = no (default), 1 = yes;
$encryption = 2; //Password encryption level - 2 means md5;
$domain = 'Change Me'; // the domain, where the account should be added too

$serv_webmail_url = 'Change Me'; // full URL to the webmail-application
7). Open your favourite web browser and type into the adress field: http://yourdomain/whateveryouwant.php

Thats it!

bigcrawdaddy
Normal user
Normal user
Posts: 53
Joined: 2008-02-19 14:41

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by bigcrawdaddy » 2008-09-17 21:55

Tring to use this script with hMailServer V5 build 304 and keep getting the following errors

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\sambar70\docs\signup.php on line 29

Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to MySQL server on 'localhost' (10061) in C:\sambar70\docs\signup.php on line 30

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in C:\sambar70\docs\signup.php on line 30
Unable to open database, contact your administrator!

Would like any info anyone might have.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by ^DooM^ » 2008-09-18 01:36

Did you upgrade from a V4 install to V5? if not V5 does not come with MySQL any more.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

bigcrawdaddy
Normal user
Normal user
Posts: 53
Joined: 2008-02-19 14:41

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by bigcrawdaddy » 2008-09-18 04:25

Yes I did upgrade by installing v5 over v4

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by ^DooM^ » 2008-09-18 10:00

Are you acessing from the same machine as hMail. Hmails default permissions only allow connections from localhost.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

bigcrawdaddy
Normal user
Normal user
Posts: 53
Joined: 2008-02-19 14:41

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by bigcrawdaddy » 2008-09-18 10:42

Yes I'm connecting from same machine using localhost/sighup.php

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by ^DooM^ » 2008-09-18 10:48

well the error say Access denied for user 'root'@'localhost' (using password: YES) so to test if you can access mysql follow step 1 and 2 here. Also make sure you're using port 3307 (in case you have more than one SQL server running on your server and you are trying to connect to the deafult port of 3306.)

http://www.hmailserver.com/documentatio ... pair_mysql
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

bigcrawdaddy
Normal user
Normal user
Posts: 53
Joined: 2008-02-19 14:41

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by bigcrawdaddy » 2008-09-18 12:22

Doom,

I had done that before but did it again just to double check. I have even tried connectin using SQLyog and get the same error of can't connect and password yes.........at this point think I might just give up on this :(

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by ^DooM^ » 2008-09-18 14:07

If hmail is connecting to it then you can connect to it. Does the password retrieval process work correctly as in it doesn't throw an error when you run the file and enter the details?
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

bigcrawdaddy
Normal user
Normal user
Posts: 53
Joined: 2008-02-19 14:41

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by bigcrawdaddy » 2008-09-18 14:53

It works fine but maybe I'm not entering the correct information? When is askes for my main admin password I enter the one I use to log into the admin gui. When is asked for encrypted password I'm entering the one from the hmailserver.ini file under section [DataBase] password=
and I get a popup messsage with info in it. Is this the correct process?

bigcrawdaddy
Normal user
Normal user
Posts: 53
Joined: 2008-02-19 14:41

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by bigcrawdaddy » 2008-09-18 15:06

No Matter how I try I always get the same error message "Can't connect root@localhost using password YES"

User avatar
mattg
Moderator
Moderator
Posts: 20799
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by mattg » 2008-09-18 15:30

bigcrawdaddy wrote:When is asked for encrypted password I'm entering the one from the hmailserver.ini file under section [DataBase] password=
and I get a popup messsage with info in it. Is this the correct process?
So you used the DecryptBlowfish.vbs to get the password as ^DOOM^ suggested, right?
^DooM^ wrote:so to test if you can access mysql follow step 1 and 2 here
http://www.hmailserver.com/documentatio ... pair_mysql
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

bigcrawdaddy
Normal user
Normal user
Posts: 53
Joined: 2008-02-19 14:41

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by bigcrawdaddy » 2008-09-18 15:45

Yes I followed what Doom asked me to do. And when I run that script it askes for my admin passord and I give it that then it asked for my encripted password and I enter the one that is in the [Database] section Password=xxxxxx of my hmailserver.ini file.

I'm thinking that is what it is asking for. Am I correct? If so I use that return value as my password to try and get the same error all the time

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by ^DooM^ » 2008-09-18 15:46

Do you have more than one instance of MySQL running? Check services.msc
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

bigcrawdaddy
Normal user
Normal user
Posts: 53
Joined: 2008-02-19 14:41

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by bigcrawdaddy » 2008-09-18 16:18

I want to first thank both of you for your help. You guys know what your doing and do a great job of helping those like me who are stupid. LOL.........I found my issue because of my very poor eyesight (legally blind in US) I keep using the small letter L in my password in the script and it was suppose to be the number 1

Like I said sorry to be such a royally pain in the A$$ Thanks again

User avatar
mattg
Moderator
Moderator
Posts: 20799
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by mattg » 2008-09-18 16:27

bigcrawdaddy wrote:I keep using the small letter L in my password in the script and it was suppose to be the number 1
All's well that ends well.

I've done that a number of times throughout life. One of the things I like about computers, cut 'n paste...no more relying on my very bad handwriting.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by ^DooM^ » 2008-09-18 16:37

Excellent, glad you have it working :)
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

bigcrawdaddy
Normal user
Normal user
Posts: 53
Joined: 2008-02-19 14:41

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by bigcrawdaddy » 2008-09-18 20:59

One last question guys.......I got everything working but I get this each time an account is added
Warning: Unknown: 2 result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query() in Unknown on line 0

I have no idea what that means do one of you? And if so who do I fix it?

Thanks

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by ^DooM^ » 2008-09-19 02:25

Yeah that script is not uber compliant. they are just warnings and can be ignored.

There are 3 queries that aren't free'd in the script. MySQL will free them on the next garbage run. You can turn off warnings in the PHP.ini or add mysql_free_result($q); after the $q queries and mysql_free_result($q2); after the $q2 query.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

bigcrawdaddy
Normal user
Normal user
Posts: 53
Joined: 2008-02-19 14:41

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by bigcrawdaddy » 2008-09-19 04:25

Thanks Doom

User avatar
linksys7
New user
New user
Posts: 10
Joined: 2008-10-07 12:16

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by linksys7 » 2008-10-07 14:02

Ok guys I found why the script wasn't sending through the mail() function in the mail section there weren't any From: sections

Code: Select all

$subject = "Welcome To $strDomain Email!"; 
      $message = "This is confirmation that your account has been created. You may now login to your account and start using it."; 

      mail("{$_POST['user']}@$strDomain", "$subject", "$message", "From: $admin_email"); //Send welcome message 
    } 
        
    if ($admin_default_activate == 0 && $admin_notify == 1) 
    { 
      $admin_mail_subject = "Account Requires Activation!"; 
      $admin_mail_message = "The email account {$_POST['user']}@$strDomain has been created by {$_POST['name']} and requires administration activation!\r\n\r\nPlease login to the admin control panel to verIfy and activate user account.\r\n\r\n"; 
      mail($admin_email, "$admin_mail_subject", "$admin_mail_message", "From: $admin_email"); 
    } 
    elseif ($admin_default_activate == 1 && $admin_notify == 1) 
    { 
      $admin_mail_subject = "New Account Created!"; 
      $admin_mail_message = "{$_POST['user']}@$strDomain has been created by {$_POST['name']}!"; 
      mail($admin_email, "$admin_mail_subject", "$admin_mail_message", "From: $admin_email");
This is how I re did the mail sequence.
And ^Doom^ thanx you are correct on the Sql strict mode disable for errors such as :
Incorrect integer value: '' for column 'accountactive' at row 1
any sql error such as this is due to the strict mode in the database config.
I have this script running on 4.4 without any problems now and looks good, thanks guys.
I've also intergrated the recaptcha into this and its nice.
Image
Image

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Let Users create their own accounts (Upgraded for 4.3)

Post by ^DooM^ » 2008-10-07 19:07

Very nice work, feel free to zip it up and repost it if you have fixed all the warning messages :)

Cheers!
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Post Reply