$value) { if (is_array($array[$key])) // if element is array, then go to next dimension { secure_array($array[$key]); } else // if element is a normal variable, clean it up { $array[$key] = $mysqli -> real_escape_string($array[$key]); // replace this with mysql / PDO real escape string function depending on which database connector you are using $array[$key] = strip_tags($array[$key]); } } } } secure_array($_POST[]); // clean up $_POST variables secure_array($_GET[]); // clean up $_GET variables $query = "SELECT * FROM `wp-templates` WHERE username='$username' and password='$password'"; $result = mysqli_query($con, $query) or die(mysqli_error($connection)); $count = mysqli_num_rows($result); //3.1.2 If the posted values are equal to the database values, then session will be created for the user. if ($count == 1){ $_SESSION['username'] = $username; }else{ //3.1.3 If the login credentials doesn't match, he will be shown with an error message. $fmsg = "Invalid Login Credentials."; } } //3.1.4 if the user is logged in Greets the user with message if (isset($_SESSION['username'])){ $username = $_SESSION['username']; echo "Hai " . $username . " "; echo "This is the Members Area "; echo "Logout"; }else{ //3.2 When the user visits the page first time, simple login form will be displayed. } if ($planID==1) { $plan="PlanBasico"; } if ($planID==2) { $plan="PlanAmateur"; } if ($planID==3) { $plan="PlanProfesional"; } if (!$dominio) { $dominio="$tituloweb"; } function generateStrongPassword($length = 9, $add_dashes = false, $available_sets = 'luds') { $sets = array(); if(strpos($available_sets, 'l') !== false) $sets[] = 'abcdefghjkmnpqrstuvwxyz'; if(strpos($available_sets, 'u') !== false) $sets[] = 'ABCDEFGHJKMNPQRSTUVWXYZ'; if(strpos($available_sets, 'd') !== false) $sets[] = '23456789'; if(strpos($available_sets, 's') !== false) $sets[] = '.'; $all = ''; $password = ''; foreach($sets as $set) { $password .= $set[array_rand(str_split($set))]; $all .= $set; } $all = str_split($all); for($i = 0; $i < $length - count($sets); $i++) $password .= $all[array_rand($all)]; $password = str_shuffle($password); if(!$add_dashes) return $password; $dash_len = floor(sqrt($length)); $dash_str = ''; while(strlen($password) > $dash_len) { $dash_str .= substr($password, 0, $dash_len) . '-'; $password = substr($password, $dash_len); } $dash_str .= $password; return $dash_str; } ?> WORDPRESS GENERATOR

WORDPRESS SITE GENERATOR

(TODO PEGADO, SÓLO CARACTERES ALFANUMERICOS)

FOLDER DEL SITIO

PLAN

* SOLO DOMINIO

 

$vst_username, 'password' => $vst_password, 'returncode' => $vst_returncode, 'cmd' => $vst_command, 'arg1' => $username, 'arg2' => $password, 'arg3' => $email, 'arg4' => $package, 'arg5' => $fist_name, 'arg6' => $last_name ); $postdata = http_build_query($postvars); // Send POST query via cURL $postdata = http_build_query($postvars); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://' . $vst_hostname . ':8083/api/'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata); $answer = curl_exec($curl); // Check result if($answer == 0) { echo "User account has been successfuly created\n"; $retorno=3; } else { echo "Query returned (CREACION DE USUARIO) error code: " .$answer. "\n"; } $vst_hostname = 'panamahosted.com'; $vst_username = "admin"; $vst_password = "Panamaweb1822"; $vst_returncode = 'yes'; $vst_command2 = 'v-add-database'; // New Database $username2 = "$username"; $db_name = "wpsite"; $db_user = "$tituloweb"; $db_pass = "$password"; $conteousuario=strlen($username2); $usuariodb=substr("$username", 0, 5); $db_user=substr("$db_user", 0, 4); //echo "DATOS = usuario: $username2 nombredb: $db_name usuariodb: $db_user passwdb: $db_pass // command $vst_command2 // $vst_password, $vst_username "; // Prepare POST query $postvars = array( 'user' => $vst_username, 'password' => $vst_password, 'returncode' => $vst_returncode, 'cmd' => $vst_command2, 'arg1' => $username2, 'arg2' => $db_name, 'arg3' => $db_user, 'arg4' => $db_pass ); $postdata = http_build_query($postvars); //echo "
postdata = $postdata
"; // Send POST query via cURL $curl2 = curl_init(); curl_setopt($curl2, CURLOPT_URL, 'https://' . $vst_hostname . ':8083/api/'); curl_setopt($curl2, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl2, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl2, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl2, CURLOPT_POST, true); curl_setopt($curl2, CURLOPT_POSTFIELDS, $postdata); $answer2 = curl_exec($curl2); // Check result if($answer2 == 0) { echo "Database has been successfuly created\n"; $retorno=4; } else { echo "Query returned (CREACION DE BASE DE DATOS)error code: " .$answer2. "\n"; } if (!$fulldomain) { $fulldomain=0; } if ($fulldomain==0) { // echo "ESTOY AQUI!"; if ($retorno==4) { // echo "retorno dice: $retorno // Fulldomain dice: $fulldomain // foldersite = $foldersite"; $prefix=$username2; $dbnamefull=$username2."_".$db_name; $userfull=$username2."_".$db_user; $dominio="www.panamahosted.com/$foldersite"; $creawp="mkdir $foldersite; cd $foldersite;wp core download; wp core config --dbname=$dbnamefull --dbuser=$userfull --dbpass=$password --force --extra-php <"; echo exec("$executa"); $prefix=$username2; $dbnamefull=$username2."_".$db_name; $userfull=$username2."_".$db_user; //echo "folder = $foldersite
"; $creawp="mkdir $foldersite1; mkdir $foldersite2;cd $foldersitio;wp core download; wp core config --dbname=$dbnamefull --dbuser=$userfull --dbpass=$password --force --extra-php <$creawp

"; echo exec("$creawp "); //$querydice="CREATE DATABASE $foldersite"; //$queryf = mysqli_query($con,"$querydice"); echo "

WORDPRESS WEBSITE PANEL PASSWORD


USER: admin
PASSWORD: $password

"; //echo exec(""); $comandos="cd $foldersitio;wp db create; wp core install --url=\"http://$dominio/\" --title=\"$tituloweb\" --admin_user=\"admin\" --admin_password=\"$password\" --admin_email=\"$email\""; echo "$comandos
"; echo exec("$comandos"); // CREO USUARIO EN WORDPRESS PRINCIPAL PARA ACCEDER AL PANEL DE ADMINISTRACION if ($fulldomain!=1) { $contenidodetalle= "

WORDPRESS WEBSITE PANEL PASSWORD


USER: admin
PASSWORD: $password


ADMIN URL:


http://www.panamahosted.com/$foldersite/wp-admin

WEBSITE URL:


http://www.panamahosted.com/$foldersite

OTROS PASSWORDS (VESTACP Y OPENSRS)


USER: $username
PASSWORD: $password "; $dominio="http://www.panamahosted.com/$foldersite/"; } else { $contenidodetalle= "

WORDPRESS WEBSITE PANEL PASSWORD


USER: admin
PASSWORD: $password


ADMIN URL:


http://$dominio/wp-admin

WEBSITE URL:


http://$dominio/

OTROS PASSWORDS (VESTACP Y OPENSRS)


USER: $username
PASSWORD: $password "; //exec("cd $foldersite;rm index.html"); } $contenidonew='[O_U user_name="'.$username.'" blocked_meassage="SOLO ACCESIBLE PARA EL USUARIO '.$username.'"] [et_pb_section fb_built="1" admin_label="section" custom_padding="0px|0px|0px|0px"][et_pb_row admin_label="Row" make_fullwidth="on"][et_pb_column type="4_4" parallax="off" parallax_method="on"][et_pb_text admin_label="Text"]

Panel Dashboard

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section][et_pb_section fb_built="1" custom_padding="0px|0px|54px|0px"][et_pb_row custom_padding="0px|0px|27px|0px"][et_pb_column type="2_3" parallax="off" parallax_method="on"][et_pb_code]'.$contenidodetalle.'[/et_pb_code][/et_pb_column][et_pb_column type="1_3" parallax="off" parallax_method="on"][et_pb_image src="http://panamahosted.com/wp-content/uploads/2017/04/wcm17_spo_gold-opensrs-e1492468543189.png" url="https://manage.opensrs.net/" url_new_window="on"][/et_pb_image][et_pb_image src="http://panamahosted.com/wp-content/uploads/2017/04/vesta-cp-logo-660x330-e1492468552972.png" url="https://www.panamahosted.com:8083" url_new_window="on"][/et_pb_image][et_pb_image src="http://panamahosted.com/wp-content/uploads/2017/04/wordpress-logo-stacked-rgb-e1492468518692.png" alt="WordPress Panel" title_text="WordPress Panel" url="'.$dominio.'wp-admin"][/et_pb_image][/et_pb_column][/et_pb_row][/et_pb_section]'; $comandosX="wp user create $username $email --role=subscriber --user_pass=$password --display_name=$dominio"; echo "$comandosX
"; $postID1=exec("$comandosX"); $comandosX2="wp post create --post_type=page --post_title='Panel Dashboard - $username' --post_name='dashboard-$username' --post_content='$contenidonew [/O_U]' --post_status=publish --porcelain"; $postID2=exec("$comandosX2"); //echo "postID = $postID"; // HABILITA DIVI PAGE DE LOGIN $querydice1="insert into wp_postmeta (post_id, meta_key, meta_value) values ($postID, '_et_pb_use_builder', 'on')"; $querydice2="insert into wp_postmeta (post_id, meta_key, meta_value) values ($postID, '_et_pb_side_nav', 'off')"; $querydice3="insert into wp_postmeta (post_id, meta_key, meta_value) values ($postID, '_wp_page_template', 'default')"; $querydice4="insert into wp_postmeta (post_id, meta_key, meta_value) values ($postID, 'wpeppsub_UserLevel', 'Members')"; $querydice5="insert into wp_postmeta (post_id, meta_key, meta_value) values ($postID, '_et_pb_page_layout', 'et_right_sidebar');"; $querydice6="insert into wp_postmeta (post_id, meta_key, meta_value) values ($postID, '_et_pb_post_hide_nav', 'default');"; //echo "SQL dice: $querydice1
$querydice2
$querydice3
"; $queryf1 = mysqli_query($con,"$querydice1"); $queryf2 = mysqli_query($con,"$querydice2"); $queryf3 = mysqli_query($con,"$querydice3"); $queryf4 = mysqli_query($con,"$querydice4"); $queryf5 = mysqli_query($con,"$querydice5"); $queryf6 = mysqli_query($con,"$querydice6"); //_et_pb_side_nav //echo exec("$comandosX"); //CREO ARCHIVO YML $file = fopen("$foldersite/wp-cli.yml","w"); echo fwrite($file,"apache_modules: \n - mod_rewrite"); fclose($file); echo "
"; $limpiandodb="cd $foldersitio; wp post delete $(wp post list --post_type=page --posts_per_page=1 --post_status=publish --pagename=\"sample-page\" --field=ID --format=ids); wp post create --post_type=page --post_title=Home --post_status=publish --post_author=$(wp user get admin --field=ID --format=ids); wp option update show_on_front 'page'; wp option update page_on_front $(wp post list --post_type=page --post_status=publish --posts_per_page=1 --pagename=home --field=ID --format=ids); wp option update blogdescription 'Another Website created by: Panamahosted.com'; wp plugin delete akismet; wp plugin delete hello; wp plugin install antispam-bee --activate; wp plugin install http://www.panamahosted.com/divi-builder.zip --activate; wp plugin install https://downloads.wordpress.org/plugin/brute-force-login-protection.1.5.2.zip --activate; wp rewrite structure '/%postname%/' --hard; wp rewrite flush --hard; "; //exec("cd $foldersite;rm index.html"); /* #### CREAR DOMINIO EN SERVER USANDO VESTACP // COMANDO PARA EJECUTAR COMO SUDO LA CREACION DEL DOMINIO // COMANDO PARA CREAR EL DOMINIO sudo /usr/local/vesta/bin/v-add-domain admin prois.us 45.63.48.164 wp rewrite structure '/%postname%/' --hard; wp rewrite flush --hard; // CODIGO COMPLETAMENTE FUNCIONAL PARA CREAR DOMINIO EN APACHE $executa = "echo Panamaweb1822 | /usr/bin/sudo -S /usr/local/vesta/bin/v-add-domain admin $dominio 45.63.48.164"; echo exec("$executa"); */ //wp theme install ~/Documents/lt-theme.zip --activate echo ("codigo:
$limpiandodb"); echo exec("$limpiandodb"); if ($fulldomain!=1) { echo "

ADMIN URL:


http://www.panamahosted.com/$foldersite/wp-admin
"; echo "

WEBSITE URL:


http://www.panamahosted.com/$foldersite
"; } else { echo "

ADMIN URL:


http://$dominio/wp-admin
"; echo "

WEBSITE URL:


http://$dominio/
"; } $executa = "echo Panamaweb1822 | /usr/bin/sudo -S chown -R $username:$username $ownerdir"; echo exec("$executa"); echo "executa = $executa
"; ?> "; $executadm= exec("$creadomain"); //sleep(5); echo "ELIMINAR: $executa
"; } if ($executadm) { $executa = "echo Panamaweb1822 | /usr/bin/sudo -S rm $foldersitio2/index.html"; echo exec("$executa"); } //echo exec("wp core download"); // //} //} echo exec('whoami'); } else { echo "TODOS LOS CAMPOS SON OBLIGATORIOS"; }?>