From 022db618ffa112149287880b95c198125327a0b0 Mon Sep 17 00:00:00 2001 From: David Ramos Date: Wed, 20 Dec 2017 15:02:18 +0100 Subject: [PATCH] =?UTF-8?q?Versi=C3=B3n=20v1.2=20para=20admin,=20sin=20con?= =?UTF-8?q?trol=20de=20limitaciones.=20Mejora=20del=20pdf,=20se=20ha=20a?= =?UTF-8?q?=C3=B1adido=20la=20url=20de=20phpmyadmin.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crear_pdf_o6h.php | 64 +++++--- new_service_webdns.php | 322 +++++++++++++++++------------------------ pdf_o6h.php | 5 + 3 files changed, 183 insertions(+), 208 deletions(-) diff --git a/crear_pdf_o6h.php b/crear_pdf_o6h.php index 3c9841a..1868faa 100755 --- a/crear_pdf_o6h.php +++ b/crear_pdf_o6h.php @@ -282,9 +282,11 @@ $nombre_bd = $_POST['nombre_bd2']; $usuario_bd = $_POST['usuario_bd2']; $pass_bd = $_POST['pass_bd2']; $nombreDominio = $_POST['dominio_nuevo']; +//$fecha_creado = $_POST['fecha_creado']; $usuario_ftp = $_POST['usuario_ftp2']; $pass_ftp = $_POST['pass_ftp2']; $la_ip4 = $_POST['ip4']; +$la_url_db = $_POST['url_db']; //$nombre_base = $_POST['nombre_bd']; @@ -300,9 +302,6 @@ $enlaceAdvertencia = '
Advert $enlaceMail = '
info@open6hosting.com'; -$hoy = date("d-m-Y H:i:s"); - - //print 'en creacion: ' . $nombre_bd . ' ' . $usuario_bd . ' ' . $pass_bd . ' Aqui la ip: ' . $la_ip4; $pdf = new PDFO6H(); // Primera página @@ -331,22 +330,31 @@ $pdf->AliasNbPages(); $pdf->SetMargins($pdf->left, $pdf->top, $pdf->right); -$pdf->WriteHTML('






'); +$pdf->WriteHTML('





'); // create table $columns = array(); -$urlBBDD = 'https://'. $la_ip4. '/phpmyadmin'; -$url = ''.$urlBBDD .''; +$fecha = 'Documento creado el ' . $hoy = date("d-m-Y H:i:s"); -// header 3 -$col3 = array(); +/*$col3 = array(); $col3[] = array('text' => '', 'width' => '8', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '255,255,255', 'linewidth' => '0.0', 'linearea' => ''); -$col3[] = array('text' => 'Nuevo Dominio:', 'width' => '40', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => ''); -$col3[] = array('text' => $nombreDominio, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => ''); +$col3[] = array('text' => $fecha, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '11', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => ''); +$col3[] = array('text' => '', 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => ''); $columns3[] = $col3; -// Draw Table -$pdf->WriteTable($columns3); +$pdf->WriteTable($columns3);*/ +$pdf->WriteHTML('

'); +// header 3 +$col4 = array(); +$col4[] = array('text' => '', 'width' => '8', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '255,255,255', 'linewidth' => '0.0', 'linearea' => ''); +$col4[] = array('text' => 'Nuevo Dominio:', 'width' => '40', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => ''); +$col4[] = array('text' => $nombreDominio, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => ''); +$columns4[] = $col4; + + +// Draw Table + +$pdf->WriteTable($columns4); $pdf->WriteHTML('

'); // header tupla $col = array(); @@ -376,16 +384,27 @@ $col[] = array('text' => 'Clave:', 'width' => '21', 'height' => '7', 'align' => $col[] = array('text' => $pass_bd, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => ''); $columns[] = $col; -$pdf->SetTextColor(0, 0, 100); +//$pdf->SetTextColor(0, 0, 100); // data tupla 3 -$col = array(); +/*$col = array(); $col[] = array('text' => '', 'width' => '8', 'height' => '7', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => ''); $col[] = array('text' => 'Url:', 'width' => '21', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => ''); -$col[] = array('text' => $urlBBDD, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,90,255', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => ''); -$columns[] = $col; +$col[] = array('text' => $urlDB, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '3', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,90,255', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => ''); +$columns[] = $col;*/ -// Draw Table +// Draw Table $pdf->WriteTable($columns); +$pdf->SetLeftMargin(10); +$pdf->SetFont('Arial','',13); +$pdf->WriteHTML('Url: '); +//$pdf->Rect(7, 5, 10, 50, 'D'); + +$urlBBDD = $la_url_db; //'https://'. $la_ip4. '/phpmyadmin'; +$url = ''.$urlBBDD .''; +$pdf->SetFont('Arial','',13); +$urlDB = $pdf->WriteHTML($url); +$pdf->SetLeftMargin(2); + $pdf->WriteHTML('
'); // header tupla 2 $col2 = array(); @@ -413,13 +432,11 @@ $col2[] = array('text' => '', 'width' => '8', 'height' => '7', 'align' => 'C', ' $col2[] = array('text' => 'Servidor:', 'width' => '21', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => ''); $col2[] = array('text' => $la_ip4, 'width' => '140', 'height' => '7', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '13', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.4', 'linearea' => ''); $columns2[] = $col2; - $pdf->WriteHTML('
'); $pdf->WriteTable($columns2); - //$pdf->AddPage(); $pdf->SetLink($link); $pdf->Image('imagen/open6-logo.png',10,12,50,0,'','http://www.open6hosting.com'); @@ -440,6 +457,15 @@ $pdf->WriteHTML($enlaceTwitter); $pdf->WriteHTML('
'); $pdf->WriteHTML($enlacePriv); $pdf->WriteHTML($enlaceAdvertencia); + +$pdf->WriteHTML('

'); +$col5 = array(); +$col5[] = array('text' => '', 'width' => '22', 'height' => '6', 'align' => 'C', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '255,255,255', 'linewidth' => '0.0', 'linearea' => ''); +$col5[] = array('text' => $fecha, 'width' => '170', 'height' => '6', 'align' => 'R', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => '', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => ''); +//$col5[] = array('text' => '', 'width' => '140', 'height' => '6', 'align' => 'L', 'font_name' => 'Arial', 'font_size' => '10', 'font_style' => 'B', 'fillcolor' => '255,255,255', 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0.0', 'linearea' => ''); +$columns5[] = $col5; +$pdf->WriteTable($columns5); + //$pdf->WriteHTML($nombre_base); $pdf->Output(); diff --git a/new_service_webdns.php b/new_service_webdns.php index 9b677d6..19d8998 100755 --- a/new_service_webdns.php +++ b/new_service_webdns.php @@ -6,37 +6,29 @@ SQL y expresiones regulares por Pablo Sarria Pérez, Open6Hosting auth->check_module_permissions('webdns'); -// Check the module permissions and redirect if not allowed. +//Check the module permissions and redirect if not allowed. /*if(!stristr($_SESSION['s']['user']['modules'],'customdns')) { header('Location: ../index.php'); die; }*/ -// Loading classes, asi es como se carga la api, busco la clase que contiene los métodos que se necesiten y se añade aquí +//Loading classes a usar. $app->uses('tpl,tform,tform_actions,remoting,tools_sites,remoting_lib,remoting_dns'); $app->load('tform_actions'); class page_action extends tform_actions { - function onShowNew() { global $app; @@ -49,19 +41,17 @@ class page_action extends tform_actions { $app->error('Reseller: '.$app->tform->wordbook["limit_database_user_txt"]); } } - parent::onShowNew(); } + function onShowEnd() { global $app, $conf, $interfaceConf; - /* * If the names are restricted -> remove the restriction, so that the * data can be edited */ - - //* Get the database user prefix + //Get the database user prefix $app->uses('getconf,tools_sites'); $global_config = $app->getconf->get_global_config('sites'); $dbuser_prefix = $app->tools_sites->replacePrefix($global_config['dbuser_prefix'], $this->dataRecord); @@ -101,7 +91,6 @@ class page_action extends tform_actions { $app->tpl->setVar("client_group_id", $client_select); } - if ($this->dataRecord['database_user'] != ""){ /* REMOVE the restriction */ $app->tpl->setVar("database_user", $app->tools_sites->removePrefix($this->dataRecord['database_user'], $this->dataRecord['database_user_prefix'], $dbuser_prefix)); @@ -123,7 +112,6 @@ class page_action extends tform_actions { } else { $app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $ftpuser_prefix, $global_config['ftpuser_prefix'])); } - parent::onShowEnd(); } @@ -131,17 +119,11 @@ class page_action extends tform_actions { public $valor_prefix; public $valor_prefix_ftp; - function tratarVariablesHTML(){ + function tratarVariablesHTML() { //function onBeforeInsert() { global $app, $conf, $interfaceConf; - //* Database username shall not be empty - //if($this->dataRecord['database_user'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_user_error_empty"].'
'; - - //* Database password shall not be empty - //if($this->dataRecord['database_password'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_password_error_empty"].'
'; - - //* Get the database name and database user prefix + //Get the database name and database user prefix $app->uses('getconf,tools_sites'); $global_config = $app->getconf->get_global_config('sites'); $dbuser_prefix = $app->tools_sites->replacePrefix($global_config['dbuser_prefix'], $this->dataRecord); @@ -153,20 +135,12 @@ class page_action extends tform_actions { $this->valor_prefix = $this->dataRecord['database_user_prefix'] = $dbuser_prefix; $this->valor_prefix_ftp = $this->dataRecord['username_prefix'] = $ftpuser_prefix; - //$this->dataRecord['database_user'] = substr($dbuser_prefix . $this->dataRecord['database_user'], 0, 16); - - //$valor1 = $this->dataRecord['database_user']; if(strlen($dbuser_prefix . $this->dataRecord['database_user']) > 16) $app->tform->errorMessage .= str_replace('{user}', htmlentities($dbuser_prefix . $this->dataRecord['database_user'], ENT_QUOTES, 'UTF-8'), $app->tform->wordbook["database_user_error_len"]).'
'; - - //echo('Tratando ' . '
' . 'Mas ' . $valor2 . '
' . - // $this->valor_prefix_ftp . '
'); - - - //* Check database user against blacklist + //Check database user against blacklist $dbuser_blacklist = array($conf['db_user'], 'mysql', 'root'); if(is_array($dbuser_blacklist) && in_array($dbuser_prefix . $this->dataRecord['database_user'], $dbuser_blacklist)) { $app->tform->errorMessage .= $app->lng('Database user not allowed.').'
'; @@ -177,7 +151,7 @@ class page_action extends tform_actions { if ($app->tform->errorMessage == ''){ $this->dataRecord['database_user'] = substr($dbuser_prefix . $this->dataRecord['database_user'], 0, 16); } - //echo('Ultima variable ' . '
'); + $this->dataRecord['server_id'] = 0; // we need this on all servers /* prepare password for MongoDB */ @@ -186,8 +160,6 @@ class page_action extends tform_actions { //parent::onBeforeInsert(); } - - public $dominio; public $subdominio; @@ -204,33 +176,27 @@ class page_action extends tform_actions { public $pass_ftp_txt; public $nombre_user_ftp; public $ip4_pdf; + public $url_db; function generaNombreFTP(){ global $app, $conf, $interfaceConf; - //* Database username shall not be empty - //if($this->dataRecord['database_user'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_user_error_empty"].'
'; - - //* Database password shall not be empty - //if($this->dataRecord['database_password'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_password_error_empty"].'
'; - - //* Get the database name and database user prefix + //Get the database name and database user prefix $app->uses('getconf,tools_sites'); $global_config = $app->getconf->get_global_config('sites'); $dbuser_prefix = $app->tools_sites->replacePrefix($global_config['dbuser_prefix'], $this->dataRecord); $dbuser_prefix_valor = $app->tpl->setVar("database_name", $app->tools_sites->removePrefix($this->dataRecord['database_name'], $this->dataRecord['database_name_prefix'], $dbname_prefix)); - //echo ('El prefix de los cohone ' . $dbuser_prefix); + //echo ('El prefix ' . $dbuser_prefix); $this->dataRecord['database_user_prefix'] = $dbuser_prefix_valor; - //echo ('PreFIX ' . '{user}' . str_replace('{user}', htmlentities($dbuser_prefix . $this->dataRecord['database_user'], ENT_QUOTES, 'UTF-8'))); if(strlen($dbuser_prefix . $this->dataRecord['database_user']) > 16) $app->tform->errorMessage .= str_replace('{user}', htmlentities($dbuser_prefix . $this->dataRecord['database_user'], ENT_QUOTES, 'UTF-8'), $app->tform->wordbook["database_user_error_len"]).'
'; - //* Check database user against blacklist + //Check database user against blacklist $dbuser_blacklist = array($conf['db_user'], 'mysql', 'root'); if(is_array($dbuser_blacklist) && in_array($dbuser_prefix . $this->dataRecord['database_user'], $dbuser_blacklist)) { $app->tform->errorMessage .= $app->lng('Database user not allowed.').'
'; @@ -248,37 +214,34 @@ class page_action extends tform_actions { //echo ('PreFIX Valor ' . $dbuser_prefix_valor); //Cadena de caractares para construir las nombre. $cadena = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ23456789"; - //$cadSpeciales = "!@#_"; //Obtengo la longitud de las cadenas $longitudCadena=strlen($cadena); - //$longSpeciales = strlen($cadSpeciales); //Variable para la nombre $nombre = ""; //Longitud para la nombre $longitudNombre=8; - //Creo la nombre + //Creo el nombre for($i=1 ; $i<=$longitudNombre ; $i++){ //Número aleatorio entre 0 y la longitud de la cadena de caracteres-1 $pos=rand(0,$longitudCadena-1); //Formo la nombre en cada iteraccion del bucle, añadiendo a la cadena $nombre //la letra correspondiente a la posicion $pos en la cadena de caracteres definida. $nombre .= substr($cadena,$pos,1); - - } - return $nombre;//$this->valor_prefix_ftp; + return $nombre; } + function generaPass(){ //Cadena de caractares para construir las password. $cadena = "abcdefghijklmnopqrstuvwxyz!@#_ABCDEFGHIJKLMNOPQRSTUVWXYZ23456789"; $cadSpeciales = "!@#_"; //Obtengo la longitud de las cadenas - $longitudCadena=strlen($cadena); + $longitudCadena = strlen($cadena); $longSpeciales = strlen($cadSpeciales); //Variable para la password @@ -302,31 +265,25 @@ class page_action extends tform_actions { return $pass; } + function generaNombreBD(){ global $app, $conf, $interfaceConf; - //* Database username shall not be empty - //if($this->dataRecord['database_user'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_user_error_empty"].'
'; - - //* Database password shall not be empty - //if($this->dataRecord['database_password'] == '') $app->tform->errorMessage .= $app->tform->wordbook["database_password_error_empty"].'
'; - - //* Get the database name and database user prefix + //Get the database name and database user prefix $app->uses('getconf,tools_sites'); $global_config = $app->getconf->get_global_config('sites'); $dbuser_prefix = $app->tools_sites->replacePrefix($global_config['dbuser_prefix'], $this->dataRecord); $dbuser_prefix_valor = $app->tpl->setVar("database_name", $app->tools_sites->removePrefix($this->dataRecord['database_name'], $this->dataRecord['database_name_prefix'], $dbname_prefix)); - //echo ('El prefix de los cohone ' . $dbuser_prefix); + //echo ('El prefix ' . $dbuser_prefix); $this->dataRecord['database_user_prefix'] = $dbuser_prefix_valor; - //echo ('PreFIX ' . '{user}' . str_replace('{user}', htmlentities($dbuser_prefix . $this->dataRecord['database_user'], ENT_QUOTES, 'UTF-8'))); if(strlen($dbuser_prefix . $this->dataRecord['database_user']) > 16) $app->tform->errorMessage .= str_replace('{user}', htmlentities($dbuser_prefix . $this->dataRecord['database_user'], ENT_QUOTES, 'UTF-8'), $app->tform->wordbook["database_user_error_len"]).'
'; - //* Check database user against blacklist + //Check database user against blacklist $dbuser_blacklist = array($conf['db_user'], 'mysql', 'root'); if(is_array($dbuser_blacklist) && in_array($dbuser_prefix . $this->dataRecord['database_user'], $dbuser_blacklist)) { $app->tform->errorMessage .= $app->lng('Database user not allowed.').'
'; @@ -367,6 +324,7 @@ class page_action extends tform_actions { return $this->valor_prefix . $nombre; } + /*function comprobarPass($claveGenerada){ //compruebo que el tamaño del string sea válido. if (strlen($claveGenerada)<3 || strlen($claveGenerada)>20){ @@ -404,45 +362,29 @@ class page_action extends tform_actions { $app->uses('ini_parser,getconf'); $server_config_array = $app->getconf->get_global_config(); - //Tomo el valor mínimo de dígitos que tiene que tener la contraseña - $min_password_length = 10; - //if(isset($server_config_array['misc']['min_password_length'])) { - $min_password_length = $app->functions->intval($server_config_array['misc']['min_password_length']); - //} - //print "Cantidad de digitos: " . $min_password_length; - //print 'La clave ' . $this->generaPass(); - - $generated_usernameBBDD = $this->generaNombreBD();//$fields['client_id'].substr(sha1(rand()), 0, 10);//client_prefix.substr(sha1(rand()), 0, 8); + $generated_usernameBBDD = $this->generaNombreBD(); //print "
"; print_r($generated_usernameBBDD); print "
\n"; $sitio_id = $app->db->queryOneRecord( 'SELECT domain_id, domain FROM web_domain WHERE domain = "'.$fields['domain'].'"'); //print "
"; print_r($camDnsRR); print "
\n"; - $camDnsRR = $app->db->queryOneRecord('SELECT server_id, zone FROM dns_rr WHERE name LIKE "'.$this->dominio.'."'); + //$camDnsRR = $app->db->queryOneRecord('SELECT server_id, zone FROM dns_rr WHERE name LIKE "'.$this->dominio.'."'); //print "
"; print_r($fields['client_id']); print "
\n"; $clavePass = $this->generaPass(); //*Recupero todos los prefix necesarios $app->uses('getconf,tools_sites'); $global_config = $app->getconf->get_global_config('sites'); - //$dbuser_prefix = $app->tools_sites->replacePrefix($global_config['dbuser_prefix'], $this->dataRecord); - //$dbname_prefix = $app->tools_sites->replacePrefix($global_config['dbname_prefix'], $this->dataRecord); $ftpuser_prefix = $app->tools_sites->replacePrefix($global_config['ftpuser_prefix'], $this->dataRecord); - - /*$this->sys_usuario_id = $this->cli_id; - $this->sys_grupo_id = $this->cli_grupo_id;*/ - //"sys_userid" => $sysUsuarioId, //$fields['client_group_id'],//$sys_userid, - //"sys_groupid" => $cliente_groupid, //$client_group_id, - // añado database user con su prefix + //añado database user con su prefix $db_user_params = array( - 'server_id' => $this->bbdd_serv, //$camDnsRR['server_id'], - 'sysgroup_id' => $this->sys_grupo_id, //$fields['client_group_id'], - 'sys_userid' => $this->sys_usuario_id, //$fields['client_group_id'], - 'database_user' => $generated_usernameBBDD, //$dbuser_prefix3 . $generated_usernameBBDD, + 'server_id' => $this->bbdd_serv, + 'sysgroup_id' => $this->sys_grupo_id, + 'sys_userid' => $this->sys_usuario_id, + 'database_user' => $generated_usernameBBDD, 'database_user_prefix' => $this->valor_prefix, - 'database_password' => $clavePass//substr(sha1($dbuser_prefix . $generated_usernameBBDD), 0, 16) - //substr(sha1(rand()), 0, 20) + 'database_password' => $clavePass ); $this->usuario_db_txt = $db_user_params['database_user']; @@ -451,9 +393,9 @@ class page_action extends tform_actions { //print "
"; print_r($db_user_params); print "
\n"; //print "
". $this->usuario_db_txt; //print "
". $this->pass_db_txt; - //print "
"; print_r($fields); print "
\n"; - $db_user_id = $remoto->insert_query('../sites/form/database_user.tform.php', $this->cli_id,/*$fields['client_group_id'],*/ $db_user_params, 'sites:web_database_user:on_after_insert'); + + $db_user_id = $remoto->insert_query('../sites/form/database_user.tform.php', $this->cli_id, $db_user_params, 'sites:web_database_user:on_after_insert'); // add database $paramsBD = array( @@ -462,7 +404,7 @@ class page_action extends tform_actions { 'parent_domain_id' => $sitio_id['domain_id'], 'type' => 'mysql', 'database_quota' => '-1', - 'database_name' => $generated_usernameBBDD, //$dbuser_prefix3 . $generated_usernameBBDD,//$db_user_params['database_user'], + 'database_name' => $generated_usernameBBDD, 'database_name_prefix' => $this->valor_prefix, 'database_user_id' => $db_user_id, 'database_charset' => 'utf8', @@ -475,9 +417,10 @@ class page_action extends tform_actions { $this->nombre_db_txt = $paramsBD['database_name']; - - $remoto->sites_database_add($this->cli_id,/*$fields['client_group_id'],*/ $paramsBD); + $db_id = $remoto->sites_database_add($this->cli_id,/*$fields['client_group_id'],*/ $paramsBD); + $this->urlBBDD($db_id, $this->bbdd_serv); + //echo('Id de la BBDD ' . $db_id); // get site data para usarlo en la creación de la cuenta ftp, otra forma de cargar una tupla dandole un id //$app->uses('remoting_lib'); $app->remoting_lib->loadFormDef('../sites/form/web_vhost_domain.tform.php'); @@ -488,9 +431,9 @@ class page_action extends tform_actions { $ftp_params = array( 'server_id' => $this->web_serv, //$camDnsRR['server_id'], 'parent_domain_id' => $sitio_id['domain_id'], - 'username' => $this->valor_prefix_ftp . $this->nombre_user_ftp, //$ftpuser_prefix . $generated_username, + 'username' => $this->valor_prefix_ftp . $this->nombre_user_ftp, 'username_prefix' => $this->valor_prefix_ftp, - 'password' => $clavePass,//substr(sha1(rand()), 0, 10), + 'password' => $clavePass, 'quota_size' => '-1', 'dir' => $site_data['0']['document_root'], 'uid' => $site_data['0']['system_user'], @@ -517,7 +460,7 @@ class page_action extends tform_actions {
Usuario FTP: '. $this->usuario_ftp_txt .'
Contraseña: ' . $this->pass_ftp_txt . '


'; - $hoy = date("d-m-Y H:i:s"); + //$hoy = date("d-m-Y H:i:s"); $html_resultado = '

BBDD
Usuario: '. $this->usuario_db_txt .'
@@ -526,11 +469,7 @@ class page_action extends tform_actions { FTP
Usuario: '. $this->usuario_ftp_txt .'
Clave: ' . $this->pass_ftp_txt . '

- -
- Nuevo dominio: '. $fields['domain'].'

- Documento generado: ' . $hoy . '

'; - +
Nuevo dominio: '. $fields['domain'].'

'; $eldom = $fields['domain']; echo '
'; @@ -541,6 +480,7 @@ class page_action extends tform_actions { echo ''; echo ''; echo ''; + echo ''; echo ''; echo ''; echo '
'; @@ -549,17 +489,43 @@ class page_action extends tform_actions { } + function urlBBDD($idBBDD, $servidor_id){ + global $app, $conf; + $dbData = $app->db->queryOneRecord("SELECT server_id, database_name FROM web_database WHERE database_id = ?", $idBBDD); + $serverData = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ?", $servidor_id); + + $app->uses('getconf'); + $global_config = $app->getconf->get_global_config('sites'); + $web_config = $app->getconf->get_server_config($servidor_id, 'web'); + + /* + * We only redirect to the login-form, so there is no need, to check any rights + */ + + if($global_config['phpmyadmin_url'] != '') { + $phpmyadmin_url = $global_config['phpmyadmin_url']; + $phpmyadmin_url = str_replace(array('[SERVERNAME]', '[DATABASENAME]'), array($serverData['server_name'], $dbData['database_name']), $phpmyadmin_url); + //header('Location: '.$phpmyadmin_url); + $this->url_db = $phpmyadmin_url; + //print('la url ' . $phpmyadmin_url); + } /*else { + isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http'; + if($web_config['server_type'] == 'nginx') { + //header('Location: http://' . $serverData['server_name'] . ':8081/phpmyadmin'); + print('la url http://' . $serverData['server_name'] . ':8081/phpmyadmin'); + } else { + //header('Location: ' . $http . '://' . $serverData['server_name'] . '/phpmyadmin'); + print('la url http://' . $serverData['server_name'] . ':8081/phpmyadmin'); + } + }*/ + } + //Expresiones regulares para comprobar si es subdominio function comprobarSubDominios($subdom) { global $app, $conf; $patronSubDominos = "/(.*?)\.(.*)$/"; $patronWWW = "/^w{3}/"; - //$patronPunto = '/(\.)/'; - /*$patronP1 = '/(^\.)/'; - $patronP2 = '/(\.$)/'; - $patronP3 = '/(\.\.+)/'; - $patronP4 = '/(\.[[:alpha:]]*)$/';*/ //Se comprueba que no tenga 3 w "www" al principio del nombre del dominio o subdomino $encontradoWWW = preg_match($patronWWW, $subdom, $coincidencias); @@ -568,14 +534,11 @@ class page_action extends tform_actions { return; } //print "
"; print_r($subdom); print "
\n"; - //print "
"; print(substr_count($subdom,".")); print "
\n"; //Si el dominio tiene mas de dos puntos, es incorrecto if(substr_count($subdom,".") > 2) { - //$app->tform->errorMessage = $app->tform->wordbook['error_dominio_mas_puntos']; $this->es_subdominio = false; $this->dominio_error = true; - //print "
"; print_r($subdom . " hola " .$this->es_subdominio ); print "
\n"; $app->tform->errorMessage = $app->tform->wordbook['error_dominio_mas_puntos']; //return; @@ -586,10 +549,9 @@ class page_action extends tform_actions { $this->subdominio = $coincidencias[0]; $this->dominio = $coincidencias[2]; - //print "Subdomino: " . $this->subdomino . "

\n Dominio: " . $this->domino; $this->es_subdominio = true; } - //print "
El dominio es: " . $this->dominio;
+
 		return $this->es_subdominio;
 	}
 
@@ -599,16 +561,40 @@ class page_action extends tform_actions {
 	public $sys_usuario_id;
 	public $sys_grupo_id;
 
+
 	function controlUserGrupoId(){
 
 		global $app, $conf;
 		$fields = $app->tform->encode($this->dataRecord, $app->tform->getCurrentTab(), true);
 
-		//IMPORTANTE. CON ESTA LLAMADA REALIZO LOS PASOS SIGUIENTES A ELLA. COMPROBAR. NO VA.
-		/*$capturaGroupClientVista = $app->db->queryOneRecord(
-			"SELECT groupid, client_id FROM sys_group
-				WHERE client_id = ".$app->functions->intval($fields['client_group_id']));*/
+		//Captura de los distintos ids del cliente y usuario de sistema.
+		//combinando un query a las dos tablas sys_group y sys_user que comparten el client_id.
+		if($fields['client_group_id']==0) {
+			//En la tabla sys_user el userid 1 es admin. No esta en sys_group.
+			$this->cli_id = 1;
+			//En la tabla dns_soa y dns_rr se guarda el valor 0 en sys_groupid cuando es admin.
+			$this->cli_grupo_id = 0;
+			$this->sys_usuario_id = $this->cli_id;
+			$this->sys_grupo_id = $this->cli_grupo_id;
+		}else{
+		    $client = $app->db->queryOneRecord(
+				'SELECT sys_user.sys_userid, sys_user.sys_groupid, sys_user.default_group, sys_user.client_id
+					FROM sys_group, sys_user
+					WHERE sys_group.client_id = sys_user.client_id and sys_group.groupid = ?', $fields['client_group_id']);
+			
+			$this->cli_id = $client['client_id'];
+			$this->cli_grupo_id = $client['default_group'];
+			$this->sys_usuario_id = $client['sys_userid'];
+			$this->sys_grupo_id = $client['sys_groupid'];
+		}	
+	}
+
 
+	/*function controlUserGrupoId(){
+
+		global $app, $conf;
+		$fields = $app->tform->encode($this->dataRecord, $app->tform->getCurrentTab(), true);
+		
 		//IMPORTANTE.
 		//Con la selección del cliente o admin en la vista.
 		//Tomamos el grupo del cliente o admin, se toma este valor y se captura el client_id y groupid de la tabla
@@ -620,7 +606,10 @@ class page_action extends tform_actions {
 			//En la tabla dns_soa y dns_rr se guarda el valor 0 en sys_groupid cuando es admin.
 			$this->cli_grupo_id = 0;
 		}else{
-		    $cliente_id_seleccionadoCaptura = $app->db->queryOneRecord('SELECT client_id, groupid FROM sys_group WHERE groupid ="'. $fields['client_group_id'] . '"');
+		    $cliente_id_seleccionadoCaptura = $app->db->queryOneRecord(
+				'SELECT client_id, groupid FROM sys_group
+					WHERE groupid ="'. $fields['client_group_id'] .'"');
+			
 			$this->cli_id = $cliente_id_seleccionadoCaptura['client_id'];
 			$this->cli_grupo_id = $cliente_id_seleccionadoCaptura['groupid'];
 		}
@@ -633,16 +622,18 @@ class page_action extends tform_actions {
 			$this->sys_usuario_id = $this->cli_id;
 			$this->sys_grupo_id = $this->cli_grupo_id;
 		}else{
-			$sysUsersCaptura = $app->db->queryOneRecord('SELECT sys_userid, sys_groupid FROM sys_user WHERE userid ="'. $this->cli_grupo_id . '"');
+			$sysUsersCaptura = $app->db->queryOneRecord(
+				'SELECT sys_userid, sys_groupid FROM sys_user
+					WHERE userid ="'. $this->cli_grupo_id . '"');
+			
 			$this->sys_usuario_id = $sysUsersCaptura['sys_userid'];
 			$this->sys_grupo_id = $sysUsersCaptura['sys_groupid'];
 		}
 	
-	}
+	}*/
 
 	//Crear subdominio
 	function crearSubDominio($remoto, $campoSubDominio){
-		//para usar variables globales en las funciones hay que declararlas dentro de la funcion.
 		global $app, $conf;
 
 		$fields = $app->tform->encode($this->dataRecord, $app->tform->getCurrentTab(), true);
@@ -651,8 +642,6 @@ class page_action extends tform_actions {
 		//NO --> ('SELECT server_id, name FROM dns_rr WHERE name LIKE "'.$this->dominio.'%"');
 		$existeDominioParaSubDominio = $app->db->queryOneRecord(
 			'SELECT server_id, name FROM dns_rr WHERE name LIKE "'.$this->dominio.'."');
-			/*'SELECT domain_id, domain FROM web_domain
-				WHERE domain = "'.$campoSubDominio.'"');*/
 
 //		print "
En crearSubDominio campo que se le pasa subdominio es: "; print_r($campoSubDominio); print "
\n"; //Compruebo que el subdominio no existe consultando la tabla web_domain. @@ -688,7 +677,7 @@ class page_action extends tform_actions { return $this->subdom_error; } - $this->controlUserGrupoId(); +// $this->controlUserGrupoId2(); /*$servidores = $app->db->queryOneRecord( "SELECT client_id, default_dnsserver, default_webserver, web_servers FROM client WHERE client_id = ". $this->cli_id);*/ @@ -698,9 +687,9 @@ class page_action extends tform_actions { //print "
Servidores: ". $web_servidor . " DNS " . $dns_servidor . " Cliente " . $this->cli_id;
 //		print "
El dominio es: " . $this->dominio;
 		//$camDominio = $app->db->queryOneRecord('SELECT domain_id, domain FROM domain WHERE domain = "'.$this->dominio.'"');
-		$camDominio = $app->db->queryOneRecord('SELECT origin FROM dns_soa WHERE origin LIKE "'.$this->dominio.'%"');
+		$camDominio = $app->db->queryOneRecord('SELECT origin FROM dns_soa WHERE origin LIKE "'.$this->dominio.'."');
 		//$camDominio = $app->db->queryOneRecord('SELECT origin FROM dns_soa WHERE origin LIKE "'.$campoSubDominio.'%"');
-		$camDnsRR = $app->db->queryOneRecord('SELECT server_id, zone FROM dns_rr WHERE name LIKE "'.$this->dominio.'%"');
+		$camDnsRR = $app->db->queryOneRecord('SELECT server_id, zone FROM dns_rr WHERE name LIKE "'.$this->dominio.'."');
 		
 		//Para los registros tipo A la ip tiene que ser tipo IPv4
 		$camServIP = $app->db->queryOneRecord(
@@ -768,36 +757,8 @@ class page_action extends tform_actions {
 			//$this->elServidor = $server_id;
 		}
 */
-		/*echo ('Lo seleccionado ' . $fields['client_group_id'] . " 
"); - echo ('Tabla sys_group --> client id ' . $this->cli_id . "
"); - echo ('Tabla sys_group --> groupid ' . $this->cli_grupo_id . "
"); - - echo ('Tabla sys_user --> userid ' . $this->sys_usuario_id . "
"); - echo ('Tabla sys_user --> sys_groupid ' . $this->sys_grupo_id . "
");*/ - - //$dns_ip_servidor_ipv6 = $app->db->queryOneRecord("SELECT ip_type, ip_address FROM server_ip WHERE client_id = ".$fields['client_group_id']." AND ip_type='IPv6'"); - - //Comprobamos que el resultado para el cliente seleccionado no esta vacío, - //si lo esta tomamos los datos del cliente id 0 - //if(!$dns_ip_servidor_ipv6){ -// $dns_ip_servidor = $app->db->queryOneRecord("SELECT ip_type, ip_address FROM server_ip WHERE client_id = 1 AND ip_type='IPv4'"); -// $dns_ip_servidor_ipv6 = $app->db->queryOneRecord("SELECT ip_type, ip_address FROM server_ip WHERE client_id = 1 AND ip_type='IPv6'"); - /*echo '

Valor de la consulta '.$dns_ip_servidor_ipv6[ip_address].' '; - echo '

Valor de la consulta '.$dns_ip_servidor[ip_address].' ';*/ - //} - -/* $dns_servidor = $app->db->queryOneRecord("SELECT client_id, default_dnsserver, default_webserver FROM client WHERE client_id = ".$app->functions->intval($fields['client_group_id'])); - $clienteID = $dns_servidor['client_id']; -*/ -// $res = $app->db->queryOneRecord("SELECT groupid, client_id FROM sys_group WHERE client_id = ".$app->functions->intval($fields['client_group_id'])); -// $client_group_id = $res['groupid']; - //$client_id = $res['client_id']; - - //echo('Seleccion es '.$app->functions->intval($fields['client_group_id']) . ' campos groupid ' . $client_group_id. ' campos client_id ' .$client_id); - - //echo ('El server es: ' . $dns_servidor['default_webserver']); - $this->tieneServidorIPs(); - $this->controlUserGrupoId(); + //$this->tieneServidorIPs(); +// $this->controlUserGrupoId2(); /* print "
DNS SERVER ";print_r($this->dns_serv);print "
\n"; print "
WEB SERVER ";print_r($this->web_serv);print "
\n"; @@ -806,17 +767,16 @@ class page_action extends tform_actions { print "
IP4 WEB ";print_r($this->ip4_servidor_web);print "
\n"; print "
IP6 WEB ";print_r($this->ip6_servidor_web);print "
\n"; print "
IP6 WEB LA OTRA ";print_r($this->ip6_ultima['ip_address']);print "
\n"; - */ - // add site + //add site $paramsite = array( //"sys_userid" => $this->sys_usuario_id, //"sys_groupid" => $this->cli_grupo_id, 'type' => 'vhost', 'domain' => $fields['domain'], //$this->subdominio, - 'server_id' => $this->web_serv, //$server_id,//$dns_servidor['default_webserver'], - 'ip_address' => '*', //$dns_ip_servidor['ip_address'], - 'ipv6_address' =>$this->ip6_servidor_web['ip_address'], //$dns_ip_servidor_ipv6['ip_address'], + 'server_id' => $this->web_serv, //$server_id, + 'ip_address' => '*', + 'ipv6_address' =>$this->ip6_servidor_web['ip_address'], 'traffic_quota' => '-1', 'hd_quota' => '0', 'cgi' => 'y', @@ -853,16 +813,10 @@ class page_action extends tform_actions { 'client_group_id' => $this->cli_grupo_id, //$client_group_id, ); - //$app->uses('remoting_lib'); - //$formulario = $app->remoting_lib->loadFormDef('../sites/form/web_vhost_domain.tform.php'); - //$formulario = $app->tform->loadFormDef('../sites/form/web_vhost_domain.tform.php'); - - //print 'Valores: ' . $dns_ip_servidor_ipv6; //print "
 Parametros:"; print_r($paramsite); print "
\n"; /*print '
 cliente id ' . $fields['client_id'];
 		print "
";print_r($fields);print "
\n" . $fields['client_id'];*/ - //print "
Formulario ";print_r($formulario);print "
\n"; //print '
DNS IPV6 ' . $dns_ip_servidor_ipv6['ip_address'];
 
@@ -871,8 +825,7 @@ class page_action extends tform_actions {
 		//El último parámetro es para lanzar un evento que llama a la función on_after_insert que prepara
 		//los campos document_root, system_user y system_group
 		//$site_id = $remoto->insert_query('../sites/form/web_vhost_domain.tform.php', $fields['client_group_id'], $paramsite, 'sites:web_vhost_domain:on_after_insert');
-		$site_id = $remoto->insert_query('../sites/form/web_vhost_domain.tform.php', $this->sys_usuario_id, $paramsite, 'sites:web_vhost_domain:on_after_insert');
-		//print '
ID sitio web del subdominio --> ' . $site_id;
+		$site_id = $remoto->insert_query('../sites/form/web_vhost_domain.tform.php', $this->cli_id, $paramsite, 'sites:web_vhost_domain:on_after_insert');
 	}
 
 	public $ip4_servidor_dns;
@@ -961,7 +914,7 @@ class page_action extends tform_actions {
 					WHERE client_id = "'.$this->cli_id.'" AND server_id = "'.$this->dns_serv.'"AND ip_type="IPv6"');
 
 			//si no tiene asignado le damos el de admin.
-			if(!$this->ip4_servidor_dns/* || !$this->ip6_servidor_dns*/){
+			if(!$this->ip4_servidor_dns){
 				//Compruebo si hay datos para el client_id 0 y si no existe pruebo con el 1. Es admin ya que este cliente no tiene ip4 ni ip6 asignadas
 				//Tomamos las de admin.
 				//Alguno de los dos tiene que existir por configuración de ispconfig.
@@ -976,7 +929,7 @@ class page_action extends tform_actions {
 							WHERE client_id = "1" AND server_id = "'.$this->dns_serv.'" AND ip_type="IPv4"');
 				}
 			}
-			if(/*!$this->ip4_servidor_dns ||*/ !$this->ip6_servidor_dns){
+			if(!$this->ip6_servidor_dns){
 				//Compruebo si hay datos para el client_id 0 y si no existe pruebo con el 1. Es admin ya que este cliente no tiene ip4 ni ip6 asignadas
 				//Tomamos las de admin.
 				//Alguno de los dos tiene que existir por configuración de ispconfig.
@@ -1025,10 +978,7 @@ class page_action extends tform_actions {
 					WHERE client_id = "'.$this->cli_id.'" AND server_id = "'.$this->web_serv.'"AND ip_type="IPv6"');
 			
 			//si no tiene asignado le damos el de admin.
-			if(!$this->ip4_servidor_web/* || !$this->ip6_servidor_dns*/){
-				//Compruebo si hay datos para el client_id 0 y si no existe pruebo con el 1. Es admin ya que este cliente no tiene ip4 ni ip6 asignadas
-				//Tomamos las de admin.
-				//Alguno de los dos tiene que existir por configuración de ispconfig.
+			if(!$this->ip4_servidor_web){
 				$this->ip4_servidor_web = $app->db->queryOneRecord(
 					'SELECT ip_type, ip_address FROM server_ip
 						WHERE client_id = "0" AND server_id = "'.$this->web_serv.'" AND ip_type="IPv4"');
@@ -1040,11 +990,7 @@ class page_action extends tform_actions {
 							WHERE client_id = "1" AND server_id = "'.$this->web_serv.'" AND ip_type="IPv4"');
 				}
 			}
-			if(/*!$this->ip4_servidor_dns ||*/ !$this->ip6_servidor_web){
-				//Compruebo si hay datos para el client_id 0 y si no existe pruebo con el 1. Es admin ya que este cliente no tiene ip4 ni ip6 asignadas
-				//Tomamos las de admin.
-				//Alguno de los dos tiene que existir por configuración de ispconfig.
-				//$this->ip4_servidor_dns = $app->db->queryOneRecord('SELECT ip_type, ip_address FROM server_ip WHERE client_id = "0" AND ip_type="IPv4"');
+			if(!$this->ip6_servidor_web){
 				$this->ip6_servidor_web = $app->db->queryOneRecord(
 					'SELECT ip_type, ip_address FROM server_ip
 						WHERE client_id = "0" AND server_id = "'.$this->web_serv.'" AND ip_type="IPv6"');
@@ -1104,9 +1050,6 @@ class page_action extends tform_actions {
 				}
 			}
 			if(!$this->ip6_servidor_bbdd){
-				//Compruebo si hay datos para el client_id 0 y si no existe pruebo con el 1. Es admin ya que este cliente no tiene ip4 ni ip6 asignadas
-				//Tomamos las de admin.
-				//Alguno de los dos tiene que existir por configuración de ispconfig.
 				$this->ip6_servidor_bbdd = $app->db->queryOneRecord(
 					'SELECT ip_type, ip_address FROM server_ip
 						WHERE client_id = "0" AND server_id = "'.$this->bbdd_serv.'" AND ip_type="IPv6"');
@@ -1234,19 +1177,20 @@ class page_action extends tform_actions {
 		$app->tform->loadFormDef($tform_def_file);
 			
 		//Carga y seleccion de dns_template, si no esta creado se informa de que tiene que crearse.
-		$template_record = $app->db->queryOneRecord("SELECT * FROM dns_template WHERE visible = 'Y' AND name = 'webdns'"); /*'open6hosting'");*/
+		$template_record = $app->db->queryOneRecord(
+			"SELECT * FROM dns_template WHERE visible = 'Y' AND name = 'webdns'"); /*'open6hosting'");*/
 		
 		//Llamada a la tabla server_ip para recuperar la ip4 e ip6
 		//$dns_ip_servidor = $app->db->queryOneRecord("SELECT ip_type, ip_address FROM server_ip WHERE client_id = ".$app->functions->intval($fields['client_id']. " AND ip_type='IPv4'"));
 //PROVISIONAL. IMPORTANTE. ¿ES CORRECTA ESTA CAPTURA?
-		$dns_ip_servidor = $app->db->queryOneRecord(
+/*		$dns_ip_servidor = $app->db->queryOneRecord(
 			"SELECT ip_type, ip_address FROM server_ip
-				WHERE client_id = ' . $cliente_id_seleccionado . ' AND ip_type='IPv4'");
+				WHERE client_id = ' . $cliente_id_seleccionado . ' AND ip_type='IPv4'");*/
 		//$dns_ip_servidor_ipv6 = $app->db->queryOneRecord("SELECT ip_type, ip_address FROM server_ip WHERE client_id = ".$fields['client_id']."  AND ip_type='IPv6'");
 //PROVISIONAL.
-		$dns_ip_servidor_ipv6 = $app->db->queryOneRecord(
+/*		$dns_ip_servidor_ipv6 = $app->db->queryOneRecord(
 			"SELECT ip_type, ip_address FROM server_ip
-				WHERE client_id = ' . $cliente_id_seleccionado . ' AND ip_type='IPv6'");
+				WHERE client_id = ' . $cliente_id_seleccionado . ' AND ip_type='IPv6'");*/
 //print_r($cliente_id_seleccionado);
 //print_r($dns_ip_servidor);
 //print_r($dns_ip_servidor_ipv6);
diff --git a/pdf_o6h.php b/pdf_o6h.php
index 112e9b3..b1f0fd9 100755
--- a/pdf_o6h.php
+++ b/pdf_o6h.php
@@ -7,7 +7,11 @@ $pass_bd = $_POST['pass_bd'];
 $usuario_ftp = $_POST['usuario_ftp'];
 $pass_ftp = $_POST['pass_ftp'];
 $ip4 = $_POST['ip4'];
+$url_db = $_POST['url_db'];
 $dominio_nuevo = $_POST['dominio_nuevo'];
+//$fecha_creado = $_POST['fecha_creado'];
+
+//$hoy = date("d-m-Y H:i:s");
 
 echo "";
 //print $nombre_bd . ' ' . $usuario_bd . ' ' . $pass_bd;
@@ -20,6 +24,7 @@ echo '';
 echo '';
 echo '';
 echo '';
+echo '';
 echo '';
 echo '';