Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
pepiuox committed Jan 7, 2025
1 parent 71868ce commit b11ea3d
Show file tree
Hide file tree
Showing 216 changed files with 5,474 additions and 4,983 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Expand Down
4 changes: 2 additions & 2 deletions classes/GetVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

class GetVisitor {

protected $getip;
public $getip;
public $baseurl;
public $system;
public $system;
protected $connection;
private $timestamp;
public $date;
Expand Down
26 changes: 26 additions & 0 deletions config/dbconnection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

include 'error_report.php';
include 'Multisite.php';
include 'Database.php';

$multisite = new Multisite();
$dbsite = $multisite->DomainConnection();
$link = new Database();
$conn = $link->MysqliConnection($dbsite);
require_once 'Routers.php';
require_once 'function.php';
include_once 'define.php';

$protocol = (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] != "off") ||
$_SERVER["SERVER_PORT"] == 443 ? "https://" : "http://";

if (!empty(SITE_PATH)) {
$siteinstall = SITE_PATH;
} else {
$base = $protocol . $_SERVER['HTTP_HOST'];
}
$fname = basename($_SERVER['SCRIPT_FILENAME'], '.php');
$rname = $fname . '.php';
$alertpg = $_SERVER['REQUEST_URI'];
?>
39 changes: 39 additions & 0 deletions config/define.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
define('DOMAIN_SITE','http://www.pepiuox.net');
define('SITE_NAME','PEPIUOX');
define('SITE_BRAND_IMG','icon-pepiuox.png');
define('SITE_PATH','http://localhost:130/');
define('SITE_DESCRIPTION','Your description for your domains');
define('SITE_KEYWORDS','Your keywords for your domains');
define('SITE_CLASSIFICATION','Your classification for your domains');
define('SITE_EMAIL','[email protected]');
define('SITE_IMAGE','dashboard');
define('SITE_ADMIN','dashboard');
define('SITE_CONTROL','users');
define('SITE_CONFIG','siteconf');
define('SITE_LANGUAGE_1','English');
define('SITE_LANGUAGE_2','Spanish');
define('FOLDER_IMAGES','uploads');
define('SITE_CREATOR','admin');
define('SITE_EDITOR','admin, editor');
define('SITE_BUILDER','builder');
define('SITE_LIST','list');
define('NAME_CONTACT','Jose Mantilla');
define('PHONE_CONTACT','0051999063645');
define('EMAIL_CONTACT','[email protected]');
define('ADDRESS','Lima - Peru');
define('TWITTER','@pepiuox');
define('FACEBOOKID','pepiuox30675');
define('SKYPE','pepiuox');
define('TELEGRAM','pepiuox');
define('WHATSAPP','+51 999063645');
define('MAILSERVER','smtp.hostinger.com');
define('PORTSERVER','461');
define('USEREMAIL','[email protected]');
define('PASSMAIL','truelove');
define('SUPERADMIN_NAME','Super Admin');
define('SUPERADMIN_LEVEL','9');
define('ADMIN_NAME','Admin');
define('ADMIN_LEVEL','5');
define('SECURE_HASH','d4d6234d6e90b6d34877630d6ff640c1b0a62751a900a20d36337dc6bfef0aaa');
define('SECURE_TOKEN','HjB1TAMLii4eQl3(8}8%P2shg)D([yshop)gX[##0GkV]51NUI3&AMwqGcnL)JtUk]@lO7g1h#HFOqAAQuk61lDO9umL1w88hCSA]I5EKT2)ZwQTMoIIP9[IrCUJqdtN');?>
11 changes: 11 additions & 0 deletions config/domains.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

return [
'domains' => [
'localhost_130' => ['dataserver' => 'cms_1'],
'pepiuox_net' => ['dataserver' => 'cms_1'],
'pepiuox_com' => ['dataserver' => 'cms_2'],
'pepiuox_org' => ['dataserver' => 'cms_3']
]
]
?>
23 changes: 23 additions & 0 deletions config/server.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

return [
'connections' => [
'cms_1' => [
'server' => 'localhost',
'database' => 'grapesjs',
'username' => 'root',
'password' => 'Tru3L@ve',
'charset' => 'utf8',
'port' => '3306',
], // use different connection for another DB in this app, and change values.
'ecommerce' => [
'server' => 'localhost',
'database' => 'ecommerce',
'username' => 'user',
'password' => 'password',
'charset' => 'utf8',
'port' => '3306',
],
],
];
?>
7 changes: 7 additions & 0 deletions installer/domain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
return [
'domains' => [
'localhost_130' => ['dataserver' => 'cms_1'],'pepiuox_com' => ['dataserver' => 'cms_2']
]
]
?>
125 changes: 125 additions & 0 deletions installer/fifthstep.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<?php

// Fourth step
// Define configuration for the website
function RandHash($len = 128) {

$secret = substr(sha1(openssl_random_pseudo_bytes(21)), - $len) . sha1(openssl_random_pseudo_bytes(13));
return substr(hash('sha256', $secret), 0, $len);
}

function RandKey($length = 128) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ}#[$)%&{]@(';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}

extract($_POST);
if (isset($_POST['Update'])) {
$definefiles = '../config/define.php';
if (file_exists($definefiles)) {
unlink($definefiles);
}
$_SESSION['AlertMessage'] = "The definitions are up to date.";

foreach ($_POST as $k => $v) {
if ($_POST['Update'] === $v) {
continue;
}
if ($k == 'DOMAIN_SITE' || $k == 'SITE_PATH') {
$v .= '/';
}

$vals[] = "`" . $k . "` = '" . $v . "'";
}
$vupdates = implode(", ", $vals);
$update = ("UPDATE site_configuration SET $vupdates WHERE `ID_Site` = '1'");
if ($conn->query($update) === TRUE) {
$sql = "SELECT * FROM site_configuration WHERE `ID_Site` = '1'";
if ($result = $conn->query($sql)) {
$fname = $result->fetch_fields();
$fdata = $result->fetch_assoc();

foreach ($fname as $val) {
if ($val->name === 'ID_Site') {
continue;
} elseif ($val->name === 'CREATE') {
continue;
} elseif ($val->name === 'UPDATED') {
continue;
}
$fldname[] = "define('" . $val->name . "','" . $fdata[$val->name] . "');";
}

if (!file_exists($definefiles)) {

$ndef = '<?php' . "\n";
$ndef .= implode("\n ", $fldname);
$ndef .= '?>' . "\n";

file_put_contents($definefiles, $ndef, FILE_APPEND | LOCK_EX);

$_SESSION['SuccessMessage'] = "The configuration definitions file has been created ";

$_SESSION['StepInstall'] = 5;
header("Location: install.php?step=5");
exit();
}
}
} else {
$_SESSION['ErrorMessage'] = 'Error Updating configutations.';
}
$conn->close();
}
?>
<div class="alert alert-success" role="alert">
<h5>Create configuration for your web site</h5>
</div>
<div class="mb-3">
<div class="alert alert-primary text-center" role="alert">
<h3>4.- Fourth step</h3>
</div>
<h4>Define the website values .</h4>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 75%;" aria-valuenow="75"
aria-valuemin="0" aria-valuemax="100">75%</div>
</div>
</div>
<h4>Define values for the configuration</h4>


<hr>
<div class="form-group">
<label for="DOMAIN_SITE">DOMAIN SITE:</label>
<input type="text" class="form-control" id="DOMAIN_SITE" name="DOMAIN_SITE"
value="<?php echo $confs["DOMAIN_SITE"]; ?>">
</div>
<div class="form-group">
<label for="SITE_NAME">SITE NAME:</label>
<input type="text" class="form-control" id="SITE_NAME" name="SITE_NAME"
value="<?php echo $confs["SITE_NAME"]; ?>">
</div>
<div class="form-group">
<label for="SITE_PATH">SITE PATH:</label>
<input type="text" class="form-control" id="SITE_PATH" name="SITE_PATH"
value="<?php echo $siteinstall; ?>">
</div>
<hr>
<h5>Secure installs strings</h5>
<div class="form-group">
<label for="SECURE_HASH">SECURE HASH:</label>
<input type="text" class="form-control" id="SECURE_HASH" name="SECURE_HASH"
value="<?php echo RandHash(); ?>" readonly="yes">
</div>
<div class="form-group">
<label for="SECURE_TOKEN">SECURE TOKEN:</label>
<textarea class="form-control" id="SECURE_TOKEN" name="SECURE_TOKEN"
readonly="yes"><?php echo RandKey(); ?></textarea>
</div>
<div class="col-12">
<button type="submit" name="Update" class="btn btn-primary">Save</button>
</div>
84 changes: 84 additions & 0 deletions installer/firststep.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php
$filed = '../config/domains.php';
if (file_exists($filed)) {
unlink($filed);
}
if (isset($_POST['save'])) {
$doma = $_POST['domain'];
$serv = $_POST['server'];

foreach ($doma as $key => $n) {
$local = 'localhost';
if (str_contains($n, $local)) {
$sitenm = str_replace(":", "_", $n);
} else {
$sitenm = str_replace(".", "_", $n);
}
$im[] = "'" . $sitenm . "' => ['dataserver' => '" . $serv[$key] . "']";
}

$cont = "<?php" . "\n";
$cont .= "return [" . "\n";
$cont .= "'domains' => [" . "\n";
$cont .= implode(',', $im) . "\n";
$cont .= "]" . "\n";
$cont .= "]" . "\n";
$cont .= "?>" . "\n";
file_put_contents($filed, $cont, FILE_APPEND | LOCK_EX);
}
?>
<script>
function add(){
// Clonar contenedor, eliminar ID
let new = $('#itemGroup').clone();
new.attr('id', '');
// Agregar clase para poder obtener el padre al eliminar
new.addClass('itemGroup');
new.find('input').each(function() {
// Solo establecer el valor
this.value = '';
// Dejar el nombre con corchetes, para que sea un arreglo
});
// Insertar nuevo contenedor antes del botón "Agregar"
$(new).insertBefore('#item-add');
}
// Función para eliminar
function removeThisFile(ele) {
// $(this) es el elemento que disparó el evento
// ele no es el elemento, sino el evento
// Obtener padre por clase, usando closest()
$(this).closest('.itemGroup').remove();
}
// Escuchar clic en botón Agregar
$('#item-add .button').on('click', add);
// Escuchar clic en botones para borrar
$(document.body).on('click', '.item-delete', removeThisFile);
</script>
<div class="alert alert-success" role="alert">
<h5>Admin registration </h5>
</div>
<div id="itemGroup" class="input-group mb-3">
<span class="input-group-text">Domain name</span>
<input type="text" name="domain[]" class="form-control" placeholder="Sitename" aria-label="Sitename" value="<?php echo $_SERVER['HTTP_HOST']; ?>">
<span class="input-group-text">DB reference name</span>
<input type="text" name="server[]" class="form-control" placeholder="DB Server" aria-label="DB Server" value="cms_1">
<button class="btn btn-outline-danger item-delete" type="button" name="delete" id="button">Delete</button>
</div>
<div class="col-md-2" id="item-add">
<p class="text-right" style="padding-top: 1.5rem">
<button type="button" class="btn btn-info" onclick="add();">
<i class="mi-add"></i>
Add
</button>
</p>
</div>
<div class="col-md-2" id="item-check">
<p class="text-right" style="padding-top: 1.5rem">
<button type="submit" name="save" class="btn btn-info">
Save domains and server names
</button>
</p>
</div>



52 changes: 52 additions & 0 deletions installer/fourthstep.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
// Third step
// Import tables to Database
if (isset($_POST['install'])) {
// Name of the file
$filename = 'sql/page.sql';

// Temporary variable, used to store current query
$templine = '';
// Read in entire file
$lines = file($filename);
// Loop through each line
foreach ($lines as $line) {
// Skip it if it's a comment
if (substr($line, 0, 2) == '--' || $line == '') {
continue;
}
// Add this line to the current segment
$templine .= $line;
// If it has a semicolon at the end, it's the end of the query
if (substr(trim($line), -1, 1) == ';') {
// Perform the query
$conn->query($templine) or print('Error performing query \'<strong>' . $templine . '\': ' . $conn->error . '<br /><br />');
// Reset temp variable to empty
$templine = '';
}
}
$_SESSION['SuccessMessage'] = "Tables imported successfully";
$conn->close();
$_SESSION['StepInstall'] = 4;
header("Location: install.php?step=4");
exit();
}
?>
<div class="alert alert-success" role="alert">
<h5>Your DB is connected to <?php echo $_SESSION['DBNAME']; ?></h5>
</div>
<div class="mb-3">
<div class="alert alert-primary text-center" role="alert">
<h3>3.- Third step</h3>
</div>
<h4> Install tables in your database.</h4>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 55%;" aria-valuenow="55"
aria-valuemin="0" aria-valuemax="100">55%</div>
</div>
</div>
<h4>This step creates the tables in your database </h4>
<div class="mb-3">
<button class="btn btn-info" type="submit" name="install" id="install">Install
tables</button>
</div>
Loading

0 comments on commit b11ea3d

Please sign in to comment.