Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
class Install{
private $error = 0;
private $meldung = '';
private $array = array();
private $db;
private function make_array($post){
foreach($post AS $key => $value){
if($key != '' && $value != '' && $key != 'datenbank_anlegen' && $key != 'impressum_anlegen'){
$this->array[$key] = $value;
}
}
}
private function DBTest(){
$con = mysqli_connect($this->array['host'],$this->array['nutzername'],$this->array['passwort'],$this->array['db']);
if (mysqli_connect_errno()) {
$this->error = 1;
$this->meldung = 'Konnte keine Verbindung zur Datenbank aufbauen.';
}
}
public function DB_Config($post){
global $_GET;
$this->make_array($post);
$this->DBTest();
if($this->error == 0){
$this->ConfigEdit();
}else{
$_GET['step'] = 2;
}
meldung($this->error,$this->meldung);
}
private function ConfigEdit(){
$file = file_get_contents('db.default.php');
$file = str_replace("???HOST???",$this->array['host'],$file);
$file = str_replace("???USER???",$this->array['nutzername'],$file);
$file = str_replace("???PASS???",$this->array['passwort'],$file);
$file = str_replace("???BASS???",$this->array['db'],$file);
$file = str_replace("???PREFIX???",$this->array['prefix'],$file);
$file = str_replace("???SCHLUESSEL???", create_code(16),$file);
$file = str_replace("???PW???", create_code(4),$file);
fwrite($datei, $file,100000);
fclose($datei);
$this->meldung = 'Configurationsdatei erfolgreich angelegt.';
}
private function DBConnect(){
require_once($_SERVER['DOCUMENT_ROOT'].'/lib/db_config.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/lib/class/db.class.php');
$dbnew = new DB;
$this->db = $dbnew;
}
public function DBStrucktur($query){
$this->DBConnect();
if(!empty($query) && $query != ''){
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
if($this->db->queryInstall($query)== true){
echo '<div class="alert alert-success">Befehl: '. $query .' erfolgreich</div>';
}
}
}
public function GrundConfig($post){
global $_GET;
$ArrayInput = array(
"wartung" => 0,
"domain" => $post['domain'],
"seitenname" => $post['name'],
"waehrung" => $post['waehrung'],
"betreibermail" => $post['mail'],
"cron_pw" => $post['cron_pw'],
"einzahlgrenze" => 100000,
"re1" => 8.00,
"re2" => 3.00,
"re3" => 1.00,
"min_betteln" => 50.00,
"max_betteln" => 250.00,
"reload_betteln" => 60,
"denied_domains" => '@sofort-mail.de;@trash-mail.de;@mailinator.com;@spamgourmet.com;@spammotel.com;@centermail.com;@discardmail.com;@sneakemail.com;@netzidiot.de;@myTrashMail.com;@wegwerfadresse.de;@nervmich.net;@nervtmich.net;@mailinator.net;@klassmaster.com;@mailin8r.com;@sogetthis.com;@mailinator2.com',
"auszahlgrenze" => 100,
"chat_aktiv" => 2,
"anzeige_chat" => 1,
"anzeige_text" => 1,
"geb_addon" => 1,
"news_komment" => 1
);
if($this->insert(PREFIX . CONFIG, $ArrayInput) == true){
}else{
$this->error = 1;
$this->meldung = 'Fehler beim Eintragen der Daten';
$_GET['step'] = 4;
}
meldung($this->error,$this->meldung);
}
public function Zugangsdaten($post){
$this->DBConnect();
$this->db->update(PREFIX . KONTO, array("passwort" => pw_erstellen($post['user_pass'])), array("uid" => 1));
$this->db->update(PREFIX . USER, array("nickname" => $post['user_name']), array("uid" => 1));
$this->db->update(PREFIX . CONFIG, array("admin_name" => base64_encode($post['admin_name']), "admin_pass" => pw_erstellen($post['admin_pass'])));
}
public function Impressum($post){
$this->make_array($post);
$this->DBConnect();
$this->createImpreesum();
}
private function createImpreesum(){
$anschrift = 'Anschrift Seitenbetreiber.
'.$this->array['name'].' '.$this->array['vorname'].'
'.$this->array['str'].' '.$this->array['hs'].'
'.$this->array['plz'].' '.$this->array['ort'].'
<a href="'.$this->array['mail'].'">'.$this->array['mail'].'</a>';
$impressum = file_get_contents("impressum.txt");
$inhalt = $anschrift.$impressum;
$inhalt = base64_encode($inhalt);
$this->db->insert(PREFIX. TEXTE, array("name" => "impressum", "text" => $inhalt));
}
}