Web Registration new accounts

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
User avatar
VINT
New user
New user
Posts: 7
Joined: 2005-01-18 14:25
Contact:

Web Registration new accounts

Post by VINT » 2005-01-18 14:36

Hello, forgive for my English I from Russia, say where find web script for registration new accounts?! :?:

seeku
New user
New user
Posts: 4
Joined: 2005-01-24 17:25
Location: Austria - Vorarlberg

Post by seeku » 2005-01-25 15:54

with php use this function:

Code: Select all

function hcom_account_add($user, $domainid, $maxsize, $pass) {

$obBaseApp = new COM("hCOM.BaseApp");
$obBaseApp->Connect();
$obDomain = $obBaseApp->Domains->ItemByDBID($domainid);
			
$obAccounts = $obDomain->Accounts();
$obAccount = $obAccounts->Add();
$obAccount->Address = $user . "@" . $obDomain->Name;
$obAccount->Password = $imap_pass;
$obAccount->Active = 1;
				
$obAccount->MaxSize = $maxsize;
$obAccount->Save();
}

User avatar
VINT
New user
New user
Posts: 7
Joined: 2005-01-18 14:25
Contact:

Post by VINT » 2005-01-25 19:35

I do not understand something where it is necessary to enter this code?

I create php a file I insert there this code and I see an empty sheet at opening... Something needs to be edited in this code?

User avatar
VINT
New user
New user
Posts: 7
Joined: 2005-01-18 14:25
Contact:

Post by VINT » 2005-02-06 20:40

I want that users could register to themselves new E-mail. Such it is possible through Web? :?:

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2005-02-06 21:26

What users? Domain owners?
Or do you want a webpage where users can register their own accounts even if they don't have any account on the server already?

User avatar
VINT
New user
New user
Posts: 7
Joined: 2005-01-18 14:25
Contact:

Post by VINT » 2005-02-06 22:30

Yes need WebPage that the user himself could create account on my server :)

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2005-02-06 23:04

Do you have a webpage already where you want this functionality to be added? You'll need to know some PHP or ASP to do this....

User avatar
VINT
New user
New user
Posts: 7
Joined: 2005-01-18 14:25
Contact:

Post by VINT » 2005-02-07 01:58

All is available, Apache, php, mysql...

Raymond

Post by Raymond » 2005-02-08 04:56

Hi,

Is there any sample asp code on how to accomplish web registration of new accounts?

User avatar
VINT
New user
New user
Posts: 7
Joined: 2005-01-18 14:25
Contact:

Post by VINT » 2005-02-10 02:30

This script will approach me? http://hmailserver.com/forum/viewtopic.php?t=904

The link dead with whom has remained signup.zip lay out the reference!

Help me... :cry:

jlcarbwood
New user
New user
Posts: 3
Joined: 2005-03-02 07:26

Post by jlcarbwood » 2005-03-15 00:36

I was searching the forums for something like this. I check that link, but it's invalid. If anyone know where i can get something with an auto registration. I will like maybe the owners of the domain be able to use a web interface, or just a webinterface that user can register their e-mail with a preassing domain name.

Thank you in advanced.

Jorge

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2005-03-15 09:45


abgar
Normal user
Normal user
Posts: 93
Joined: 2005-03-23 09:33
Location: Warsaw, Poland

Post by abgar » 2005-03-23 09:38

I understand what VINT wants.
I.e: at the Squirrel login page, there should be link: "create new accout". After filling up registration page a new user is created - but should be inactive - untill administrator activates the account.
I also consider it very usefull.
Regards

User avatar
VINT
New user
New user
Posts: 7
Joined: 2005-01-18 14:25
Contact:

Post by VINT » 2005-03-24 16:23

In Squirrel there is no function " create new accout ". It is necessary to find script of registration.

User avatar
[PT]Cableguy
New user
New user
Posts: 25
Joined: 2007-02-22 11:09
Location: Portugal

Post by [PT]Cableguy » 2007-02-22 11:27

Hi there:

I'm using/testing hMail in the past 5 days.
I've managed to install it with phpwebadmin and roundcubemail.
I've been looking to for this feature also, to enable users to create their own accounts on the server.
Since the link posted above doesn't work, i searched Google and found this:

http://public.www.planetmirror.com/pub/ ... mail/?fl=t

Code: Select all

hmail.zip
Hmail Signup.zip
hmail_server_files.zip
I've downloaded Hmail Signup.zip and this is what is part of it: (index.php)

Code: Select all

<?php
/*
// +----------------------------------------------------------------------+
// |  Denlou HMail Server Addon - Version 0.1A                            |
// +----------------------------------------------------------------------+
// | Copyright (C) 2005, http://denlou.ca/, http://php.driwashshop.biz    |
// +----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or    |
// | (at your option) any later version.                                  |
// | This program is distributed in the hope that it will be useful       |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the         |
// | GNU General Public License for more details.                         |
// +----------------------------------------------------------------------+
// | Author: Ryan Louden       <denlou@denlou.ca>                         |
// | Zpanel Intigration:       <mjshinner@gmail.com>                      |
// +----------------------------------------------------------------------+
*/
//#############################//
//USER CONFIGURATION REQUIRED!!//
//#############################//

//MySQL Information:
$mysql_host = "hostname"; //Host Name
$mysql_user = "username"; //Username
$mysql_pass = "password"; //Password
$mysql_db = "database"; //Database

//General Configuration:
$form_title = "Email Accounts"; //Name for this form

$account_max = "20000000";  //Maximum size per account (1000000 = 1MB -> Do not uses spaces or commas!)

$admin_notify = 1; //1 = yes & 0 = no
$admin_email = "youradminemail"; //Server Administrators E-mail (Where notifications will be sent)
$admin_default_activate = 1; //1 = yes & 0 = no -> If no, the administrator has to authorise the account

//###DO NOT EDIT BELOW!###//
.
.
.
.
.
.
?>
Since i don't use Zpanel, what changes must i do, to use it with roundcube?

btw: what database should i configure on the top of index.php ?
aka: Bruno Vaz

hMailServer-4.3.1-B253 + phpwebadmin + roundcubemail-0.1beta2.2 + clamwin-0.88.7

raymond
Normal user
Normal user
Posts: 135
Joined: 2006-11-30 07:13
Location: Australia

Post by raymond » 2007-02-22 12:23

I believe this is the forum post that you are after...

Let Users create their own accounts (Upgraded for 4.3)
http://hmailserver.com/forum/viewtopic.php?t=6580

User avatar
[PT]Cableguy
New user
New user
Posts: 25
Joined: 2007-02-22 11:09
Location: Portugal

Post by [PT]Cableguy » 2007-02-22 14:44

Thanks for the link raymond. Very helpfull. :wink:

Since i can't post on the link you've supplied, i'll post it here.
It seems i can't connect to the Hmailserver mysql database.
Image

I've also added the port number to the "add.php" file:

Code: Select all

//MySQL Information: 
$mysql_host = "localhost"; //Host Name 
$mysql_user = "###########"; //Username 
$mysql_pass = "###########"; //Password 
$mysql_db = "hmailserver"; //Database
$mysql_port = "3307";
Does this work, defining the port on this php file?

My limitation is related to another mysql i have running on the machine.
Therefore i can't change the php.ini to another port, because the other mysql uses port 3306.

Another question, if i may:
Is the user (to access phpwebadmin) the same as this one configured on the php file ?
aka: Bruno Vaz

hMailServer-4.3.1-B253 + phpwebadmin + roundcubemail-0.1beta2.2 + clamwin-0.88.7

raymond
Normal user
Normal user
Posts: 135
Joined: 2006-11-30 07:13
Location: Australia

Post by raymond » 2007-02-22 23:16

If you want to specify the mysql port, change this piece of code

Code: Select all

$mysql_host = "localhost"; //Host Name
To

Code: Select all

$mysql_host = "localhost:3307"; //Host Name
[PT]Cableguy wrote:Is the user (to access phpwebadmin) the same as this one configured on the php file ?
If you are referring to mysql_user... that should be root. To obtain the mysql_pass, you'll need to run “DecryptBlowfish.vbs” script in the hMailServer\Addons\Utilities folder to decrypt the password in hMailServer.INI file in the “bin” folder of your hMailServer installation.

User avatar
[PT]Cableguy
New user
New user
Posts: 25
Joined: 2007-02-22 11:09
Location: Portugal

Post by [PT]Cableguy » 2007-02-23 12:15

raymond wrote:...To obtain the mysql_pass, you'll need to run “DecryptBlowfish.vbs” script...
Haaaaaa...i knew i didn't entered any password for hMail MySQL.
Nice tip raymond. Thanks a million !!!

YAHOOOOOO...my users can create their own accounts !!! :wink: :lol:
Image
aka: Bruno Vaz

hMailServer-4.3.1-B253 + phpwebadmin + roundcubemail-0.1beta2.2 + clamwin-0.88.7

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

Post by ^DooM^ » 2007-02-23 12:34

Just be sure that the signup script is in a somewhat secure location as any spammer could signup for an account and send thousands of messages through it :)

TANGOGC
New user
New user
Posts: 5
Joined: 2007-09-27 15:58

delete user

Post by TANGOGC » 2007-09-27 16:01

I have added a new version vorking with hmail last version of the script to create the user email from the zpanel 2.5.

It work perfectly and I share for the comunity.

than I have tried to add the code to delete the email but it fail.

Could you please help to fix ?

I HAVE ONLY ADDED THIS CODE FOR EMAIL DELETION IT DON'T WORK COULD YOU HELP PLEASE


echo "
<br>
<b>Delete Accounts:</b><br>
<form action=\"$zpaneldomain/zpanel.php?page=hmaildomain&mode=2\" method=\"POST\">
<select name=\"account\">
";
$q=mysql_query("SELECT `domainid` FROM `hm_domains` WHERE `domainname` = '$it' AND `domainactive` = '1'");
WHILE($v=mysql_fetch_array($q))
{
$q2=mysql_query("SELECT `accountaddress` FROM `hm_accounts` WHERE `accountdomainid` = '{$v['0']}' ORDER BY `accountaddress` DESC");
WHILE($v2=mysql_fetch_array($q2))
{
echo "<option>{$v2['0']}</option>";
}
}
echo "
</select>
<input type=\"submit\" name=\"submit\" value=\"Delete Selected\"><input type=\"submit\" name=\"submit\" value=\"Delete All\">
</form>
";

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

Post by ^DooM^ » 2007-09-27 17:56

You cannot delete accounts directly via the database without restarting hMail service after you have done this.

TANGOGC
New user
New user
Posts: 5
Joined: 2007-09-27 15:58

Post by TANGOGC » 2007-09-27 18:01

But I can mark for deleting and then when I restart Hmail they are been cancelled ?

About the script where is the error ?

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2007-09-27 22:39

You can delete accounts directly in the database unless you're using account caching. If you're using account caching and have set the TTL to 60 seconds, the user will still be able to use the account up to 60 seconds after you deleted it from the database.

However, if you delete the account you must delete messages and IMAP folders as well in these cases. And message files on disk. And if you do, these objects will continue to be cached in memory until a server restart. That shouldn't matter mcuh though.

TANGOGC
New user
New user
Posts: 5
Joined: 2007-09-27 15:58

delte from db

Post by TANGOGC » 2007-09-27 23:29

Ok Thanks again but where is the error in mmy script it doesn't show and delete account form db

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2007-09-27 23:33

That's really not possible to say. If you have a problem with a PHP script you've written, you need to debug it to see what's causing the problem. I don't have access to Zpanel and hence have no clue what properties and functions is available. The PHP script you posted only appears to create an option box, not actually deleting any account.

TANGOGC
New user
New user
Posts: 5
Joined: 2007-09-27 15:58

Post by TANGOGC » 2007-09-27 23:36

I can only post 58 characters in this forum so I have only posted a little part of the script.
How I can post all ?

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2007-09-27 23:53

That was quite a bit more than 58 characters. Anyway, you can put it up on another web site and post a link to it here. But you shouldn't expect other people to debug PHP scripts you've written. This is a hMailServer forum, not a PHP scripting forum. :)

TANGOGC
New user
New user
Posts: 5
Joined: 2007-09-27 15:58

Post by TANGOGC » 2007-09-27 23:56

Thanks Martin I wil try to myself

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

Post by adrianp918 » 2007-10-05 23:19

can this script work for multiple domains, all i get is this

i use a subdomain of my real domain, and it automatically defaults to the subdomain for the domain name, and i want itto give the choice of domians that are there

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Web Registration new accounts

Post by martin » 2009-08-23 18:54

In hMailServer 5.2 you need to insert a row into the hm_imapfolders table when creating a new account. If you're using the COM API to create accounts, this is done automatically. If you're doing direct inserts into the database, the script needs to be modified..

Post Reply