소스 검색

v1.1 Creación de subdominios y su sitio web. Comprobaciones de IPs, correcta escritura del dominio y subdominio.

v1.1
root 8 년 전
부모
커밋
a41ac7cf8b
6개의 변경된 파일177개의 추가작업 그리고 44개의 파일을 삭제
  1. +0
    -25
      LICENSE
  2. +171
    -0
      form/dns_a_webdns.tform.php
  3. +0
    -0
      form/new_service_webdns.tform.php
  4. +2
    -14
      new_service_webdns.php
  5. +4
    -2
      new_service_webdnsOLD.php
  6. +0
    -3
      prueba.txt

+ 0
- 25
LICENSE 파일 보기

@@ -1,25 +0,0 @@
Copyright (c) 2016, Kristián Feldsam, FELDSAM s.r.o. <info@feldsam.cz>
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 171
- 0
form/dns_a_webdns.tform.php 파일 보기

@@ -0,0 +1,171 @@
<?php

/*
Form Definition

Tabledefinition

Datatypes:
- INTEGER (Forces the input to Int)
- DOUBLE
- CURRENCY (Formats the values to currency notation)
- VARCHAR (no format check, maxlength: 255)
- TEXT (no format check)
- DATE (Dateformat, automatic conversion to timestamps)

Formtype:
- TEXT (Textfield)
- TEXTAREA (Textarea)
- PASSWORD (Password textfield, input is not shown when edited)
- SELECT (Select option field)
- RADIO
- CHECKBOX
- CHECKBOXARRAY
- FILE

VALUE:
- Wert oder Array

Hint:
The ID field of the database table is not part of the datafield definition.
The ID field must be always auto incement (int or bigint).


*/
global $app;

$form["title"] = "DNS A";
$form["description"] = "";
$form["name"] = "dns_a";
$form["action"] = "dns_a_edit.php";
$form["db_table"] = "dns_rr";
$form["db_table_idx"] = "id";
$form["db_history"] = "yes";
$form["tab_default"] = "dns";
$form["list_default"] = "dns_a_list.php";
$form["auth"] = 'yes'; // yes / no

$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete

$form["tabs"]['dns'] = array (
'title' => "DNS A",
'width' => 100,
'template' => "templates/dns_a_edit.htm",
'fields' => array (
//#################################
// Begin Datatable fields
//#################################
'server_id' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'zone' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
'default' => @$app->functions->intval($_REQUEST["zone"]),
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'name' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'filters' => array( 0 => array( 'event' => 'SAVE',
'type' => 'IDNTOASCII'),
1 => array( 'event' => 'SHOW',
'type' => 'IDNTOUTF8'),
2 => array( 'event' => 'SAVE',
'type' => 'TOLOWER')
),
'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[a-zA-Z0-9\.\-\*]{0,64}$/',
'errmsg'=> 'name_error_regex'),
),
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'A',
'value' => '',
'width' => '5',
'maxlength' => '5'
),
'data' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array (
0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'data_error_empty'),
1 => array ( 'type' => 'ISIPV4', 'errmsg'=> 'ip_error_wrong'),
),
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
/*
'aux' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
'default' => '0',
'value' => '',
'width' => '10',
'maxlength' => '10'
),
*/
'ttl' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'RANGE',
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
),
'active' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'Y',
'value' => array(0 => 'N', 1 => 'Y')
),
/*
'stamp' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
*/
'serial' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '10',
'maxlength' => '10'
),
//#################################
// ENDE Datatable fields
//#################################
)
);



?>

+ 0
- 0
form/new_service_webdns.tform.php 파일 보기


+ 2
- 14
new_service_webdns.php 파일 보기

@@ -97,9 +97,6 @@ class page_action extends tform_actions {


$app->tform->errorMessage = $app->tform->wordbook['error_dominio_mas_puntos']; $app->tform->errorMessage = $app->tform->wordbook['error_dominio_mas_puntos'];
return; return;
//print 'El Dominio ¡¡NO!! es correcto, hay 3 puntos o más.</p>\n';
//$this->subdom_error = true; //$this->subdom_error = true;


} else if(substr_count($subdom,".") == 2){ } else if(substr_count($subdom,".") == 2){
@@ -148,15 +145,6 @@ class page_action extends tform_actions {
$app->tform->errorMessage = $app->tform->wordbook['error_no_existe_dominio_padre']; $app->tform->errorMessage = $app->tform->wordbook['error_no_existe_dominio_padre'];
$this->onError(); $this->onError();
//return; //return;
/*echo '<div class="table-wrapper marginTop15">
<table class="table">
<tbody>
<tr>
<td bgcolor="#f7dfdf" colspan="2"><b>El dominio padre para este subdominio ¡NO EXISTE!</b></td>
</tr>
</tbody>
</table>
</div>';*/
//print 'No existe el dominio'; //print 'No existe el dominio';
return $this->subdom_error; return $this->subdom_error;


@@ -179,8 +167,8 @@ class page_action extends tform_actions {
//print "<pre>"; print_r($paramSubDominios); print "</pre>\n"; //print "<pre>"; print_r($paramSubDominios); print "</pre>\n";
//$remote = new remote_actions; //$remote = new remote_actions;
//Inserto en bbdd usando la clase remoto que se la he pasado en parámetros de la función //Inserto en bbdd usando la clase remoto que se la he pasado en parámetros de la función
$resultado = $remoto->insert_query('../dns/form/dns_a.tform.php', $fields['client_id'], $paramSubDominios);
//$resultado = $remoto->insert_query('../dns/form/dns_a.tform.php', $fields['client_id'], $paramSubDominios);
$resultado = $remoto->insert_query('form/dns_a_webdns.tform.php', $fields['client_id'], $paramSubDominios);
echo '<br><div class="alert alert-success"><br> echo '<br><div class="alert alert-success"><br>
Se ha dado de alta Web y Subdominio, <b>'.$this->subdominio.'</b>, ¡Correctamente! Se ha dado de alta Web y Subdominio, <b>'.$this->subdominio.'</b>, ¡Correctamente!
<br><br></div></br>'; <br><br></div></br>';


+ 4
- 2
new_service_webdnsOLD.php 파일 보기

@@ -1,7 +1,9 @@
<?php <?php
/* /*
2017, David Ramos García, Open6Hosting <dramos@open6hosting.com>
All rights reserved.
PHP por David Ramos García, Open6Hosting <dramos@open6hosting.com>
SQL y expresiones regulares por Pablo Sarria Pérez, Open6Hosting <pablo@sarriaperez.com>

2017, All rights reserved.
*/ */






+ 0
- 3
prueba.txt 파일 보기

@@ -1,3 +0,0 @@
linea1
linea2
linea3

불러오는 중...
취소
저장