root/tags/omega-1.0.0-rc3/gui/orderpanel/addon.php

Revision 771, 2.6 KB (checked in by raphael, 17 months ago)

Fixed #597: Error in the Menu under Admin->Language
Make use of php[4|5]-idn if available (faster than using pure PHP code)
Fixed #596: Undefined offset: 1 in gui/admin/multilanguage.php
Added missing gender field in reseller/edit_user.php

Line 
1<?php
2/**
3 *  ispCP (OMEGA) - Virtual Hosting Control System | Omega Version
4 *
5 *  @copyright     2001-2006 by moleSoftware GmbH
6 *  @copyright     2006-2007 by ispCP | http://isp-control.net
7 *  @link         http://isp-control.net
8 *  @author        ispCP Team (2007)
9 *
10 *  @license
11 *  This program is free software; you can redistribute it and/or modify it under
12 *  the terms of the MPL General Public License as published by the Free Software
13 *  Foundation; either version 1.1 of the License, or (at your option) any later
14 *  version.
15 *  You should have received a copy of the MPL Mozilla Public License along with
16 *  this program; if not, write to the Open Source Initiative (OSI)
17 *  http://opensource.org | osi@opensource.org
18 **/
19
20require '../include/ispcp-lib.php';
21
22$tpl = new pTemplate();
23
24$tpl -> define_dynamic('page', $cfg['PURCHASE_TEMPLATE_PATH'].'/addon.tpl');
25
26$tpl -> define_dynamic('page_message', 'page');
27
28$tpl -> define_dynamic('purchase_header', 'page');
29
30$tpl -> define_dynamic('purchase_footer', 'page');
31
32
33/*
34* Functions start
35*/
36
37function addon_domain($dmn_name)
38{
39    $dmn_name = strtolower($dmn_name);
40    $dmn_name = encode_idna($dmn_name);
41
42    if (!chk_dname($dmn_name)) {
43
44        set_page_message(tr('Wrong domain name syntax!'));
45        return;
46
47    } else if (ispcp_domain_exists($dmn_name, 0)) {
48
49        set_page_message(tr('Domain with that name already exists on the system!'));
50        return;
51
52    }
53
54    $_SESSION['domainname'] = $dmn_name;
55    header( "Location: address.php" );
56    die();
57
58}
59
60/*
61* Functions end
62*/
63
64
65
66
67
68
69/*
70*
71* static page messages.
72*
73*/
74
75if (isset($_SESSION['user_id'])){
76    $user_id = $_SESSION['user_id'];
77
78    if (isset($_SESSION['plan_id'])){
79        $plan_id = $_SESSION['plan_id'];
80    } else if(isset($_GET['id'])){
81        $plan_id = $_GET['id'];
82        $_SESSION['plan_id'] = $plan_id;
83    } else {
84        system_message(tr('You do not have permission to access this interface!'));
85    }
86} else {
87    system_message(tr('You do not have permission to access this interface!'));
88}
89
90if (isset($_SESSION['domainname'])){
91    header( "Location: address.php" );
92    die();
93}
94
95if (isset($_POST['domainname']) && $_POST['domainname'] != ''){
96    addon_domain($_POST['domainname']);
97}
98
99gen_purchase_haf($tpl, $sql, $user_id);
100
101gen_page_message($tpl);
102
103    $tpl -> assign(
104                array(
105                           'DOMAIN_ADDON' => tr('Add On A Domain'),
106                        'TR_DOMAIN_NAME' => tr('Domain name'),
107                        'TR_CONTINUE' => tr('Continue'),
108                        'TR_EXAMPLE' => tr('(e.g. domain-of-your-choice.com)'),
109                        'THEME_CHARSET' => tr('encoding'),
110
111
112                    )
113            );
114
115$tpl -> parse('PAGE', 'page');
116
117$tpl -> prnt();
118
119if ($cfg['DUMP_GUI_DEBUG']) dump_gui_debug();
120
121unset_messages();
122?>
Note: See TracBrowser for help on using the browser.