This commit is contained in:
genuineparts 2025-06-22 16:24:59 +02:00
parent 66a92263a5
commit 10b21a09d6

View file

@ -366,188 +366,188 @@ class install{
function step($step='start'){ function step($step='start'){
global $config; global $config;
switch($step){ switch($step) {
case 'start': case 'start':
if(isset($_POST['send'])){ if (isset($_POST['send'])) {
$this->t->setlang($_POST['language']); $this->t->setlang($_POST['language']);
header("Location: install.php?step=license"); header("Location: install.php?step=license");
} }
$options=''; $options = '';
$languages=$this->t->getlanguages(); $languages = $this->t->getlanguages();
foreach($languages as $lang){ foreach ($languages as $lang) {
$options.='<option value="'.$lang['short'].'">'.$lang['name'].'</option>'; $options .= '<option value="' . $lang['short'] . '">' . $lang['name'] . '</option>';
} }
$data='<h3>'.$this->t->_('Wilkommen').'</h3> $data = '<h3>' . $this->t->_('Wilkommen') . '</h3>
<p>'.$this->t->_('WilkommenText1').'</p> <p>' . $this->t->_('WilkommenText1') . '</p>
<p>'.$this->t->_('Waehledeinesprache').'</p> <p>' . $this->t->_('Waehledeinesprache') . '</p>
<form action="#" method="post"> <form action="#" method="post">
<select name="language"> <select name="language">
'.$options.' ' . $options . '
</select> </select>
<br> <br>
<input type="submit" class="nextbutton" name="send" value="'.$this->t->_('Weiter').'" /> <input type="submit" class="nextbutton" name="send" value="' . $this->t->_('Weiter') . '" />
</form> </form>
<br style="clear:both;" />'; <br style="clear:both;" />';
break; break;
case 'license':
if(isset($_POST['back'])){
header("Location: install.php?step=start");
}
if(isset($_POST['send'])){
if($_POST['accept']!=1){
$err= '<p><div class="comment"><img src="style/images/error.png" alt="" /><span style="color: red;">'.$this->t->_('FehlerAkzeptieren').'</span></div></p>';
}else{
header("Location: install.php?step=check");
}
}
$datei = fopen(dirname(__FILE__).'/license/gpl2.txt','r');
$license='';
while (!feof($datei)){
$license .= fgets($datei,1024);
}
fclose($datei);
$data='<h3>'.$this->t->_('Lizenz').'</h3>
<p>'.$this->t->_('LizenzText').'</p>
'.$err.'
<div class="console" style="height:300px; overflow : auto;">'.$license.'</div>
<form action="#" method="post">
<p><input type="checkbox" class="checkbox" name="accept" value="1"/>'.$this->t->_('Akzeptieren').'</p>
<br />
<input type="submit" class="prevbutton" name="back" value="'.$this->t->_('Zurueck').'" /><input type="submit" class="nextbutton" name="send" value="'.$this->t->_('Weiter').'" />
</form>
<br style="clear:both;" />';
break;
case 'check':
$globcheck=true;
$dircheck=$this->checkchmod();
if($dircheck){
$dirs='<div class="comment"><img src="style/images/ok.png" alt="" />'.$this->t->_('dateiok');
}else{
$globcheck=false;
$dirs='<div class="comment"><img src="style/images/error.png" alt="" />'.$this->t->_('dateinichtok');
}
$dirs.='<table><tr><th>'.$this->t->_('Verzeichnis').'</th><th></th><th>'.$this->t->_('Ergebnis').'</th></tr>';
foreach($this->checkdir as $dir){
$dirs.='<tr style="color: '.$dir['color'].'"><td>'.$dir['dir'].'</td><td>................</td><td>'.$dir['status'].'</td></tr>';
}
$dirs.='</table></div>';
$phpcheck=$this->checkphp();
if($phpcheck){
$php='<div class="comment"><img src="style/images/ok.png" alt="" />'.$this->t->_('phpok');
}else{
$globcheck=false;
$php='<div class="comment"><img src="style/images/error.png" alt="" />'.$this->t->_('phpnichtok');
}
$php.='<table><tr><th>'.$this->t->_('Komponente').'</th><th>'.$this->t->_('benVersion').'</th><th>'.$this->t->_('instVersion').'</th></tr>';
foreach($this->checkphp as $p){
$php.='<tr style="color: '.$p['success'].'"><td>'.$p['name'].'</td><td>'.$p['needed'].'</td><td>'.$p['status'].'</td></tr>';
}
$php.='</table></div>';
$dbcheck=$this->getsupportetdbs();
if($dbcheck){
$dbs='<div class="comment"><img src="style/images/ok.png" alt="" />'.$this->t->_('dbsok');
}else{
$globcheck=false;
$dbs='<div class="comment"><img src="style/images/error.png" alt="" />'.$this->t->_('dbsnichtok');
}
$dbas = "";
foreach($this->dbas as $d){
if(empty($dbas))
$dbas=$d['name'];
else
$dbas.=' ,'.$d['name'];
}
if($dbas==''){
$dbas=$this->t->_('keine');
}
$dbs.='<br />'.$this->t->_('installiertedbs').': '.$dbas.'</div>';
if(isset($_POST['back'])){
header("Location: install.php?step=license");
}
if(isset($_POST['send'])){
if(!$globcheck){
$err= '<div class="comment"><img src="style/images/error.png" alt="" /><span style="color: red;">'.$this->t->_('Fehlererstloesen').'</span></div>';
}else{
header("Location: install.php?step=database");
}
}
$data='<h3>'.$this->t->_('Pruefung').'</h3> case 'license':
<p>'.$this->t->_('PruefungText').'</p><p>'.$err.'</p>'; if (isset($_POST['back'])) {
if($globcheck){ header("Location: install.php?step=start");
$data.='<p>'.$this->t->_('CheckOK').'</p>'; }
}else{ if (isset($_POST['send'])) {
$data.='<p>'.$this->t->_('ChecknichtOK').'</p>'; if ($_POST['accept'] != 1) {
$locked='disabled="disabled"'; $err = '<p><div class="comment"><img src="style/images/error.png" alt="" /><span style="color: red;">' . $this->t->_('FehlerAkzeptieren') . '</span></div></p>';
} } else {
$data.='<p>'.$dirs.'</p> header("Location: install.php?step=check");
<p>'.$php.'</p> }
<p>'.$dbs.'</p> }
$datei = fopen(dirname(__FILE__) . '/license/gpl2.txt', 'r');
$license = '';
while (!feof($datei)) {
$license .= fgets($datei, 1024);
}
fclose($datei);
$data = '<h3>' . $this->t->_('Lizenz') . '</h3>
<p>' . $this->t->_('LizenzText') . '</p>
' . $err . '
<div class="console" style="height:300px; overflow : auto;">' . $license . '</div>
<form action="#" method="post">
<p><input type="checkbox" class="checkbox" name="accept" value="1"/>' . $this->t->_('Akzeptieren') . '</p>
<br />
<input type="submit" class="prevbutton" name="back" value="' . $this->t->_('Zurueck') . '" /><input type="submit" class="nextbutton" name="send" value="' . $this->t->_('Weiter') . '" />
</form>
<br style="clear:both;" />';
break;
case 'check':
$globcheck = true;
$dircheck = $this->checkchmod();
if ($dircheck) {
$dirs = '<div class="comment"><img src="style/images/ok.png" alt="" />' . $this->t->_('dateiok');
} else {
$globcheck = false;
$dirs = '<div class="comment"><img src="style/images/error.png" alt="" />' . $this->t->_('dateinichtok');
}
$dirs .= '<table><tr><th>' . $this->t->_('Verzeichnis') . '</th><th></th><th>' . $this->t->_('Ergebnis') . '</th></tr>';
foreach ($this->checkdir as $dir) {
$dirs .= '<tr style="color: ' . $dir['color'] . '"><td>' . $dir['dir'] . '</td><td>................</td><td>' . $dir['status'] . '</td></tr>';
}
$dirs .= '</table></div>';
$phpcheck = $this->checkphp();
if ($phpcheck) {
$php = '<div class="comment"><img src="style/images/ok.png" alt="" />' . $this->t->_('phpok');
} else {
$globcheck = false;
$php = '<div class="comment"><img src="style/images/error.png" alt="" />' . $this->t->_('phpnichtok');
}
$php .= '<table><tr><th>' . $this->t->_('Komponente') . '</th><th>' . $this->t->_('benVersion') . '</th><th>' . $this->t->_('instVersion') . '</th></tr>';
foreach ($this->checkphp as $p) {
$php .= '<tr style="color: ' . $p['success'] . '"><td>' . $p['name'] . '</td><td>' . $p['needed'] . '</td><td>' . $p['status'] . '</td></tr>';
}
$php .= '</table></div>';
$dbcheck = $this->getsupportetdbs();
if ($dbcheck) {
$dbs = '<div class="comment"><img src="style/images/ok.png" alt="" />' . $this->t->_('dbsok');
} else {
$globcheck = false;
$dbs = '<div class="comment"><img src="style/images/error.png" alt="" />' . $this->t->_('dbsnichtok');
}
$dbas = "";
foreach ($this->dbas as $d) {
if (empty($dbas))
$dbas = $d['name'];
else
$dbas .= ' ,' . $d['name'];
}
if ($dbas == '') {
$dbas = $this->t->_('keine');
}
$dbs .= '<br />' . $this->t->_('installiertedbs') . ': ' . $dbas . '</div>';
if (isset($_POST['back'])) {
header("Location: install.php?step=license");
}
if (isset($_POST['send'])) {
if (!$globcheck) {
$err = '<div class="comment"><img src="style/images/error.png" alt="" /><span style="color: red;">' . $this->t->_('Fehlererstloesen') . '</span></div>';
} else {
header("Location: install.php?step=database");
}
}
$data = '<h3>' . $this->t->_('Pruefung') . '</h3>
<p>' . $this->t->_('PruefungText') . '</p><p>' . $err . '</p>';
if ($globcheck) {
$data .= '<p>' . $this->t->_('CheckOK') . '</p>';
} else {
$data .= '<p>' . $this->t->_('ChecknichtOK') . '</p>';
$locked = 'disabled="disabled"';
}
$data .= '<p>' . $dirs . '</p>
<p>' . $php . '</p>
<p>' . $dbs . '</p>
<form action="#" method="post"> <form action="#" method="post">
<br /> <br />
<input type="submit" class="prevbutton" name="back" value="'.$this->t->_('Zurueck').'" /><input type="submit" class="refreshbutton" name="refresh" value="'.$this->t->_('Erneut').'" /><input type="submit" '.$locked.' class="nextbutton" name="send" value="'.$this->t->_('Weiter').'" /> <input type="submit" class="prevbutton" name="back" value="' . $this->t->_('Zurueck') . '" /><input type="submit" class="refreshbutton" name="refresh" value="' . $this->t->_('Erneut') . '" /><input type="submit" ' . $locked . ' class="nextbutton" name="send" value="' . $this->t->_('Weiter') . '" />
</form> </form>
<br style="clear:both;" />'; <br style="clear:both;" />';
break; break;
case 'database': case 'database':
$locked='disabled="disabled"'; $locked = 'disabled="disabled"';
if(isset($_POST['back'])){ if (isset($_POST['back'])) {
@unlink(dirname(dirname(__FILE__)).'/config.tmp.php'); @unlink(dirname(dirname(__FILE__)) . '/config.tmp.php');
header("Location: install.php?step=check"); header("Location: install.php?step=check");
} }
if(isset($_POST['test'])){ if (isset($_POST['test'])) {
$error=false; $error = false;
$user=$_POST['dbuser']; $user = $_POST['dbuser'];
$pass=$_POST['dbpass']; $pass = $_POST['dbpass'];
$db=$_POST['db']; $db = $_POST['db'];
$server=$_POST['dbserv']; $server = $_POST['dbserv'];
$prefix=$_POST['dbprefix']; $prefix = $_POST['dbprefix'];
$driver=$_POST['dbdriver']; $driver = $_POST['dbdriver'];
$pdata=$_POST; $pdata = $_POST;
$configdata='<?php $configdata = '<?php
$config[\'host\'] = \''.$server.'\'; $config[\'host\'] = \'' . $server . '\';
// your Database Username // your Database Username
$config[\'user\'] = \''.$user.'\'; $config[\'user\'] = \'' . $user . '\';
// your Database Password // your Database Password
$config[\'pass\'] = \''.$pass.'\'; $config[\'pass\'] = \'' . $pass . '\';
// your Database // your Database
$config[\'db\'] = \''.$db.'\'; $config[\'db\'] = \'' . $db . '\';
// your Database Prefix // your Database Prefix
$config[\'prefix\']=\''.$prefix.'\'; $config[\'prefix\']=\'' . $prefix . '\';
// your Database Sytem // your Database Sytem
$config[\'db_class\']= \''.$driver.'\'; $config[\'db_class\']= \'' . $driver . '\';
?>'; ?>';
define('DEBUG', FALSE); define('DEBUG', FALSE);
include dirname(__FILE__, 2) .'/inc/logger.class.php'; include dirname(__FILE__, 2) . '/inc/logger.class.php';
include dirname(__FILE__, 2) .'/core/database/'.$driver.'.class.php'; include dirname(__FILE__, 2) . '/core/database/' . $driver . '.class.php';
try{ try {
$db = new db($server, $user, $pass, $db,'utf8', FALSE,TRUE); $db = new db($server, $user, $pass, $db, 'utf8', FALSE, TRUE);
$result=$db->query("SHOW TABLES"); $result = $db->query("SHOW TABLES");
}catch(Exception $e){ } catch (Exception $e) {
$error=true; $error = true;
} }
if(!$error){ if (!$error) {
$datei = fopen(dirname(__FILE__, 2) .'/config.tmp.php','w'); $datei = fopen(dirname(__FILE__, 2) . '/config.tmp.php', 'w');
fputs($datei,$configdata); fputs($datei, $configdata);
fclose($datei); fclose($datei);
$locked=''; $locked = '';
$err='<p><div class="comment"><img src="style/images/warning.png" alt="" /><span style="color: orange;">'.$this->t->_('Installationwarten').'</span></div></p>'; $err = '<p><div class="comment"><img src="style/images/warning.png" alt="" /><span style="color: orange;">' . $this->t->_('Installationwarten') . '</span></div></p>';
}else{ } else {
$err='<p><div class="comment"><img src="style/images/error.png" alt="" /><span style="color: red;">'.$this->t->_('FalscheDaten').'</span></div></p>'; $err = '<p><div class="comment"><img src="style/images/error.png" alt="" /><span style="color: red;">' . $this->t->_('FalscheDaten') . '</span></div></p>';
} }
} }
if(isset($_POST['send'])){ if (isset($_POST['send'])) {
define('DEBUG', FALSE); define('DEBUG', FALSE);
include dirname(__FILE__, 2) .'/inc/logger.class.php'; include dirname(__FILE__, 2) . '/inc/logger.class.php';
include dirname(__FILE__, 2) .'/config.tmp.php'; include dirname(__FILE__, 2) . '/config.tmp.php';
include dirname(__FILE__, 2) .'/core/database/'.$config['db_class'].'.class.php'; include dirname(__FILE__, 2) . '/core/database/' . $config['db_class'] . '.class.php';
$configdata='<?php $configdata = '<?php
/** /**
* Project: BeCast WebEngine - simple site engine * Project: BeCast WebEngine - simple site engine
* File: config.inc.php * File: config.inc.php
@ -579,148 +579,146 @@ if(!defined("in_astat")){
die(); die();
} }
// your Database Server (most likely localhost) // your Database Server (most likely localhost)
$config[\'host\'] = \''.$config['host'].'\'; $config[\'host\'] = \'' . $config['host'] . '\';
// your Database Username // your Database Username
$config[\'user\'] = \''.$config['user'].'\'; $config[\'user\'] = \'' . $config['user'] . '\';
// your Database Password // your Database Password
$config[\'pass\'] = \''.$config['pass'].'\'; $config[\'pass\'] = \'' . $config['pass'] . '\';
// your Database // your Database
$config[\'db\'] = \''.$config['db'].'\'; $config[\'db\'] = \'' . $config['db'] . '\';
// your Database Prefix // your Database Prefix
$config[\'prefix\']=\''.$config['prefix'].'\'; $config[\'prefix\']=\'' . $config['prefix'] . '\';
// your Database Sytem // your Database Sytem
$config[\'db_class\']= \''.$config['db_class'].'\'; $config[\'db_class\']= \'' . $config['db_class'] . '\';
define(\'INSTALLED\', TRUE); define(\'INSTALLED\', TRUE);
define(\'CHARSET\', \'UTF-8\'); define(\'CHARSET\', \'UTF-8\');
define(\'DEBUG\', FALSE); define(\'DEBUG\', FALSE);
?>'; ?>';
$datei = fopen(dirname(__FILE__, 2) .'/inc/config.inc.php','w+'); $datei = fopen(dirname(__FILE__, 2) . '/inc/config.inc.php', 'w+');
fputs($datei,$configdata); fputs($datei, $configdata);
fclose($datei); fclose($datei);
$db = new db($config['host'], $config['user'], $config['pass'], $config['db'],'utf8', FALSE,TRUE); $db = new db($config['host'], $config['user'], $config['pass'], $config['db'], 'utf8', FALSE, TRUE);
$dump = new dump($db); $dump = new dump($db);
$dump->read(dirname(__FILE__).'/sql/dump.sql'); $dump->read(dirname(__FILE__) . '/sql/dump.sql');
$dump->prepare($config['prefix']); $dump->prepare($config['prefix']);
$dump->execute(); $dump->execute();
$pdata=$_POST; $pdata = $_POST;
@unlink(dirname(__FILE__, 2) .'/config.tmp.php'); @unlink(dirname(__FILE__, 2) . '/config.tmp.php');
header("Location: install.php?step=user"); header("Location: install.php?step=user");
} }
if($pdata['dbprefix']==''){ if ($pdata['dbprefix'] == '') {
$pdata['dbprefix']='bcwe_'; $pdata['dbprefix'] = 'bcwe_';
} }
if($pdata['dbserv']==''){ if ($pdata['dbserv'] == '') {
$pdata['dbserv']='localhost'; $pdata['dbserv'] = 'localhost';
} }
$this->getsupportetdbs(); $this->getsupportetdbs();
foreach($this->dbas as $driver){ foreach ($this->dbas as $driver) {
if($pdata['dbdriver']==$driver['short']){ if ($pdata['dbdriver'] == $driver['short']) {
$select='selected="selected"'; $select = 'selected="selected"';
} }
$drv.='<option value="'.$driver['short'].'" '.$select.'>'.$driver['name'].'</option>'; $drv .= '<option value="' . $driver['short'] . '" ' . $select . '>' . $driver['name'] . '</option>';
} }
$data='<h3>'.$this->t->_('Datenbank').'</h3> $data = '<h3>' . $this->t->_('Datenbank') . '</h3>
<p>'.$this->t->_('DatenbankText').'</p> <p>' . $this->t->_('DatenbankText') . '</p>
'.$err.' ' . $err . '
<form action="#" method="post"> <form action="#" method="post">
<div class="reihe"> <div class="reihe">
<label class="label" for="dbuser">'.$this->t->_('Datenbankbenutzer').'</label> <label class="label" for="dbuser">' . $this->t->_('Datenbankbenutzer') . '</label>
<input class="feld" autocomplete="off" id="dbuser" name="dbuser" value="'.$pdata['dbuser'].'" type="text" /> <input class="feld" autocomplete="off" id="dbuser" name="dbuser" value="' . $pdata['dbuser'] . '" type="text" />
</div> </div>
<div class="reihe"> <div class="reihe">
<label class="label" for="dbpass">'.$this->t->_('Datenbankpasswort').'</label> <label class="label" for="dbpass">' . $this->t->_('Datenbankpasswort') . '</label>
<input class="feld" autocomplete="off" id="dbpass" name="dbpass" value="'.$pdata['dbpass'].'" type="password" /> <input class="feld" autocomplete="off" id="dbpass" name="dbpass" value="' . $pdata['dbpass'] . '" type="password" />
</div> </div>
<div class="reihe"> <div class="reihe">
<label class="label" for="db">'.$this->t->_('Datenbank').'</label> <label class="label" for="db">' . $this->t->_('Datenbank') . '</label>
<input class="feld" autocomplete="off" id="db" name="db" value="'.$pdata['db'].'" type="text" /> <input class="feld" autocomplete="off" id="db" name="db" value="' . $pdata['db'] . '" type="text" />
</div> </div>
<div class="reihe"> <div class="reihe">
<label class="label" for="dbserv">'.$this->t->_('Datenbankserver').'</label> <label class="label" for="dbserv">' . $this->t->_('Datenbankserver') . '</label>
<input class="feld" autocomplete="off" id="dbserv" name="dbserv" value="'.$pdata['dbserv'].'" type="text" /> <input class="feld" autocomplete="off" id="dbserv" name="dbserv" value="' . $pdata['dbserv'] . '" type="text" />
</div> </div>
<div class="reihe"> <div class="reihe">
<label class="label" for="dbprefix">'.$this->t->_('Datenbankprefix').'</label> <label class="label" for="dbprefix">' . $this->t->_('Datenbankprefix') . '</label>
<input class="feld" autocomplete="off" id="dbprefix" name="dbprefix" value="'.$pdata['dbprefix'].'" type="text" /> <input class="feld" autocomplete="off" id="dbprefix" name="dbprefix" value="' . $pdata['dbprefix'] . '" type="text" />
</div> </div>
<div class="reihe"> <div class="reihe">
<label class="label" for="dbdriver">'.$this->t->_('Datenbanktreiber').'</label> <label class="label" for="dbdriver">' . $this->t->_('Datenbanktreiber') . '</label>
<select class="feld" id="dbdriver" name="dbdriver"> <select class="feld" id="dbdriver" name="dbdriver">
'.$drv.' ' . $drv . '
</select> </select>
</div> </div>
<br /> <br />
<input type="submit" class="prevbutton" name="back" value="'.$this->t->_('Zurueck').'" /><input type="submit" class="refreshbutton" name="test" value="'.$this->t->_('Testen').'" /><input type="submit" '.$locked.' class="nextbutton" name="send" value="'.$this->t->_('Weiter').'" /> <input type="submit" class="prevbutton" name="back" value="' . $this->t->_('Zurueck') . '" /><input type="submit" class="refreshbutton" name="test" value="' . $this->t->_('Testen') . '" /><input type="submit" ' . $locked . ' class="nextbutton" name="send" value="' . $this->t->_('Weiter') . '" />
</form> </form>
<br style="clear:both;" />'; <br style="clear:both;" />';
break; break;
case 'user': case 'user':
if(isset($_POST['back'])){ if (isset($_POST['back'])) {
header("Location: install.php?step=database"); header("Location: install.php?step=database");
} }
if(isset($_POST['send'])){ if (isset($_POST['send'])) {
$err=false; $err = false;
if($_POST['pass']!=$_POST['passrepeat']){ if ($_POST['pass'] != $_POST['passrepeat']) {
$err.='<p><div class="comment"><img src="style/images/error.png" alt="" /><span style="color: red;">'.$this->t->_('Passwoerterfalsch').'</span></div></p>'; $err .= '<p><div class="comment"><img src="style/images/error.png" alt="" /><span style="color: red;">' . $this->t->_('Passwoerterfalsch') . '</span></div></p>';
} }
if(!preg_match('/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/iD',$_POST['email'])){ if (!preg_match('/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/iD', $_POST['email'])) {
$err.='<p><div class="comment"><img src="style/images/error.png" alt="" /><span style="color: red;">'.$this->t->_('Emailinkorrekt').'</span></div></p>'; $err .= '<p><div class="comment"><img src="style/images/error.png" alt="" /><span style="color: red;">' . $this->t->_('Emailinkorrekt') . '</span></div></p>';
} }
if(!$err){ if (!$err) {
define('in_astat',TRUE); define('in_astat', TRUE);
define('DEBUG', FALSE); define('DEBUG', FALSE);
include dirname(__FILE__, 2) .'/inc/logger.class.php'; include dirname(__FILE__, 2) . '/inc/logger.class.php';
include dirname(__FILE__, 2) .'/inc/config.inc.php'; include dirname(__FILE__, 2) . '/inc/config.inc.php';
include dirname(__FILE__, 2) .'/core/database/'.$config['db_class'].'.class.php'; include dirname(__FILE__, 2) . '/core/database/' . $config['db_class'] . '.class.php';
$db = new db($config['host'], $config['user'], $config['pass'], $config['db'],'utf8', FALSE,TRUE); $db = new db($config['host'], $config['user'], $config['pass'], $config['db'], 'utf8', FALSE, TRUE);
$key=$this->generate_Key(50); $key = $this->generate_Key(50);
$salt=$this->generate_Key(6); $salt = $this->generate_Key(6);
$active=1; $active = 1;
$pass=hash('sha256',$db->escape($salt.$_POST['pass'])); $pass = hash('sha256', $db->escape($salt . $_POST['pass']));
$username=$db->escape($_POST['user']); $username = $db->escape($_POST['user']);
$email=$db->escape($_POST['email']); $email = $db->escape($_POST['email']);
$db->query("INSERT INTO `" . $config['prefix'] . "users` (`username`,`password`,`loginkey`,`salt`,`email`,`active`,`since`,`role`) VALUES ('".$username."','".$pass."','".$key."', '".$salt."', '".$email."', '".$active."','".time()."','2')"); $db->query("INSERT INTO `" . $config['prefix'] . "users` (`username`,`password`,`loginkey`,`salt`,`email`,`active`,`since`,`role`) VALUES ('" . $username . "','" . $pass . "','" . $key . "', '" . $salt . "', '" . $email . "', '" . $active . "','" . time() . "','2')");
header("Location: install.php?step=finish"); header("Location: install.php?step=finish");
}else{ } else {
$pdata=$_POST; $pdata = $_POST;
} }
} }
$data='<h3>'.$this->t->_('Benutzer').'</h3> $data = '<h3>' . $this->t->_('Benutzer') . '</h3>
<p>'.$this->t->_('BenutzerText').'</p> <p>' . $this->t->_('BenutzerText') . '</p>
'.$err.' ' . $err . '
<form action="#" method="post"> <form action="#" method="post">
<div class="reihe"> <div class="reihe">
<label class="label" for="user">'.$this->t->_('Benutzername').'</label> <label class="label" for="user">' . $this->t->_('Benutzername') . '</label>
<input class="feld" autocomplete="off" id="user" name="user" value="'.$pdata['user'].'" type="text" /> <input class="feld" autocomplete="off" id="user" name="user" value="' . $pdata['user'] . '" type="text" />
</div> </div>
<div class="reihe"> <div class="reihe">
<label class="label" for="pass">'.$this->t->_('Passwort').'</label> <label class="label" for="pass">' . $this->t->_('Passwort') . '</label>
<input class="feld" autocomplete="off" id="pass" name="pass" type="password" /> <input class="feld" autocomplete="off" id="pass" name="pass" type="password" />
</div> </div>
<div class="reihe"> <div class="reihe">
<label class="label" for="passrepeat">'.$this->t->_('PasswortWiederholen').'</label> <label class="label" for="passrepeat">' . $this->t->_('PasswortWiederholen') . '</label>
<input class="feld" autocomplete="off" id="passrepeat" name="passrepeat" type="password" /> <input class="feld" autocomplete="off" id="passrepeat" name="passrepeat" type="password" />
</div> </div>
<div class="reihe"> <div class="reihe">
<label class="label" for="email">'.$this->t->_('EMail').'</label> <label class="label" for="email">' . $this->t->_('EMail') . '</label>
<input class="feld" autocomplete="off" id="email" name="email" value="'.$pdata['email'].'" type="text" /> <input class="feld" autocomplete="off" id="email" name="email" value="' . $pdata['email'] . '" type="text" />
</div> </div>
<br /> <br />
<input type="submit" class="prevbutton" name="back" value="'.$this->t->_('Zurueck').'" /><input type="submit" class="nextbutton" name="send" value="'.$this->t->_('Weiter').'" /> <input type="submit" class="prevbutton" name="back" value="' . $this->t->_('Zurueck') . '" /><input type="submit" class="nextbutton" name="send" value="' . $this->t->_('Weiter') . '" />
</form> </form>
<br style="clear:both;" />'; <br style="clear:both;" />';
break; break;
case 'finish': case 'finish':
$fopen=true; $fopen = true;
$test=fopen('https://webengine.becast.at/install.php?test', 'r'); $test = fopen('https://webengine.becast.at/install.php?test', 'r');
$testecho= fgets($test,1024); if (!$test) {
fclose($test); $fopen = false;
if($testecho!="Success"){ }
$fopen=false;
}
$server='Server: '.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; $server='Server: '.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
$astat_version='BcWe version: '.$this->version; $astat_version='BcWe version: '.$this->version;
$timestamp='Timestamp: '.time(); $timestamp='Timestamp: '.time();