Skip to content

Commit 08745a5

Browse files
author
redray
committed
added new modul: domain
1 parent 41a96e4 commit 08745a5

22 files changed

+1117
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
since i don't have the time to develope this module at the moment i want to explain how the database is constructed, so that someone else is able to contiue on this module.
2+
3+
First of all: Why do we need this module?
4+
-----------------------------------------
5+
At the moment it is possible for a customer to register every domain, even subdomains belonging to other customers!
6+
With the "domain"-module it is possible to assign domains to customers and to implement domain-robot-tools.
7+
8+
The next step would be to implement selector boxes to other modules like "dns", "mail", etc. where the customer can only select domains which belong to him.
9+
10+
THE TABLES:
11+
-----------
12+
13+
domain
14+
______
15+
16+
- domain_provider_id: reference to table domain_provider; over which provider was the domain ordered!
17+
- provider_domain_id: reference-id from the domain-provider
18+
- ...
19+
- added_at: record creation date
20+
- connected_at: date at which the domain was connected - important for billing!
21+
- disconnected_at: empty by default. Date when the domain was canceled.
22+
- status: status-info from the registrar
23+
24+
25+
domain_handle
26+
-------------
27+
most registrars work with handles. In this table we assign handles from different registrars (DENIC, etc.) to the ispc-clients
28+
29+
30+
domain_provider
31+
---------------
32+
the domainprovider is the one where the domains are ordere at (Hetzner, 1und1, HostEurope, etc.)
33+
34+
- provider: name of the Provider
35+
- is_extern: BOOL; Only True if the client has ordered the domain somewhere else on his own and want's to use the domain on the ISPC-Server. - IMPORTANT FOR DOMAIN-BILLING!
36+
- domainrobot_interface: for future development - describes the Providers domainrobot-interface: could be NULL, EMAIL, SOAP, XML, etc.
37+
38+
domain_tld
39+
----------
40+
all available TopLevelDomains
41+
42+
- tld: The TopLevelDomain (without dot: e.g.: "de" NOT ".de")
43+
- domain_provider: reference to table domain_provider; which provider is responsible for registration
44+
- domain_registrar: who is the domain registrar (DENIC, EURID, etc.); same name as in domain_handle - IMPORTANT for Table domain_handle: e.g.: When the domain test.de is ordered only DENIC-Handles from the Customer are displayed and valid!
45+
46+
47+
48+
cheers
49+
50+
if you have any question you can contact me over the forum.
51+
http://www.howtoforge.com/forums/member.php?u=50859
52+
53+
2009-04-11
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
/******************************************
32+
* Begin Form configuration
33+
******************************************/
34+
35+
$list_def_file = "list/domain.list.php";
36+
$tform_def_file = "form/domain.tform.php";
37+
38+
/******************************************
39+
* End Form configuration
40+
******************************************/
41+
42+
require_once('../../lib/config.inc.php');
43+
require_once('../../lib/app.inc.php');
44+
45+
//* Check permissions for module
46+
$app->auth->check_module_permissions('domain');
47+
48+
$app->uses('tpl,tform,tform_actions');
49+
$app->load('tform_actions');
50+
51+
class page_action extends tform_actions {
52+
53+
function onBeforeDelete() {
54+
global $app; $conf;
55+
56+
if($app->tform->checkPerm($this->id,'d') == false) $app->error($app->lng('error_no_delete_permission'));
57+
58+
// Delete all records that belog to this domain.
59+
$app->db->query("DELETE FROM domain WHERE domain_id = $domain_id");
60+
}
61+
}
62+
63+
$page = new page_action;
64+
$page->onDelete();
65+
66+
?>
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<?php
2+
/*
3+
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification,
7+
are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
* Neither the name of ISPConfig nor the names of its contributors
15+
may be used to endorse or promote products derived from this software without
16+
specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*/
29+
30+
31+
/******************************************
32+
* Begin Form configuration
33+
******************************************/
34+
35+
$tform_def_file = "form/domain.tform.php";
36+
37+
/******************************************
38+
* End Form configuration
39+
******************************************/
40+
41+
require_once('../../lib/config.inc.php');
42+
require_once('../../lib/app.inc.php');
43+
44+
//* Check permissions for module
45+
$app->auth->check_module_permissions('domain');
46+
47+
// Loading classes
48+
$app->uses('tpl,tform,tform_actions');
49+
$app->load('tform_actions');
50+
51+
class page_action extends tform_actions {
52+
53+
function onShowNew() {
54+
global $app, $conf;
55+
56+
if($_SESSION["s"]["user"]["typ"] != 'admin') {
57+
$app->error($app->tform->wordbook["onlyforadmin_txt"]);
58+
}
59+
60+
parent::onShowNew();
61+
}
62+
63+
function onShowEnd() {
64+
global $app, $conf;
65+
66+
if($_SESSION["s"]["user"]["typ"] != 'admin') {
67+
$app->error($app->tform->wordbook["onlyforadmin_txt"]);
68+
}
69+
70+
// Fill the client select field
71+
$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0";
72+
$clients = $app->db->queryAllRecords($sql);
73+
$client_select = "<option value='0'></option>";
74+
if(is_array($clients)) {
75+
foreach( $clients as $client) {
76+
$selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
77+
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
78+
}
79+
}
80+
$app->tpl->setVar("client_group_id",$client_select);
81+
82+
parent::onShowEnd();
83+
}
84+
85+
function onSubmit() {
86+
global $app, $conf;
87+
88+
parent::onSubmit();
89+
}
90+
91+
function onAfterInsert() {
92+
global $app, $conf;
93+
94+
}
95+
96+
function onBeforeUpdate () {
97+
global $app, $conf;
98+
99+
}
100+
101+
function onAfterUpdate() {
102+
global $app, $conf;
103+
104+
}
105+
106+
function onAfterDelete() {
107+
global $app, $conf;
108+
109+
}
110+
111+
}
112+
113+
$page = new page_action;
114+
$page->onLoad();
115+
116+
?>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
require_once('../../lib/config.inc.php');
3+
require_once('../../lib/app.inc.php');
4+
5+
/******************************************
6+
* Begin Form configuration
7+
******************************************/
8+
9+
$list_def_file = "list/domain.list.php";
10+
11+
/******************************************
12+
* End Form configuration
13+
******************************************/
14+
15+
//* Check permissions for module
16+
$app->auth->check_module_permissions('domain');
17+
18+
$app->uses('listform_actions');
19+
20+
$app->listform_actions->SQLOrderBy = 'ORDER BY domain';
21+
$app->listform_actions->onLoad();
22+
23+
?>

0 commit comments

Comments
 (0)