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'){
global $config;
switch($step){
case 'start':
if(isset($_POST['send'])){
$this->t->setlang($_POST['language']);
header("Location: install.php?step=license");
}
$options='';
$languages=$this->t->getlanguages();
foreach($languages as $lang){
$options.='<option value="'.$lang['short'].'">'.$lang['name'].'</option>';
}
$data='<h3>'.$this->t->_('Wilkommen').'</h3>
<p>'.$this->t->_('WilkommenText1').'</p>
<p>'.$this->t->_('Waehledeinesprache').'</p>
switch($step) {
case 'start':
if (isset($_POST['send'])) {
$this->t->setlang($_POST['language']);
header("Location: install.php?step=license");
}
$options = '';
$languages = $this->t->getlanguages();
foreach ($languages as $lang) {
$options .= '<option value="' . $lang['short'] . '">' . $lang['name'] . '</option>';
}
$data = '<h3>' . $this->t->_('Wilkommen') . '</h3>
<p>' . $this->t->_('WilkommenText1') . '</p>
<p>' . $this->t->_('Waehledeinesprache') . '</p>
<form action="#" method="post">
<select name="language">
'.$options.'
' . $options . '
</select>
<br>
<input type="submit" class="nextbutton" name="send" value="'.$this->t->_('Weiter').'" />
<input type="submit" class="nextbutton" name="send" value="' . $this->t->_('Weiter') . '" />
</form>
<br style="clear:both;" />';
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");
}
}
break;
$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>
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>
<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">
<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>
<br style="clear:both;" />';
break;
case 'database':
$locked='disabled="disabled"';
if(isset($_POST['back'])){
@unlink(dirname(dirname(__FILE__)).'/config.tmp.php');
header("Location: install.php?step=check");
}
if(isset($_POST['test'])){
$error=false;
$user=$_POST['dbuser'];
$pass=$_POST['dbpass'];
$db=$_POST['db'];
$server=$_POST['dbserv'];
$prefix=$_POST['dbprefix'];
$driver=$_POST['dbdriver'];
$pdata=$_POST;
$configdata='<?php
$config[\'host\'] = \''.$server.'\';
break;
case 'database':
$locked = 'disabled="disabled"';
if (isset($_POST['back'])) {
@unlink(dirname(dirname(__FILE__)) . '/config.tmp.php');
header("Location: install.php?step=check");
}
if (isset($_POST['test'])) {
$error = false;
$user = $_POST['dbuser'];
$pass = $_POST['dbpass'];
$db = $_POST['db'];
$server = $_POST['dbserv'];
$prefix = $_POST['dbprefix'];
$driver = $_POST['dbdriver'];
$pdata = $_POST;
$configdata = '<?php
$config[\'host\'] = \'' . $server . '\';
// your Database Username
$config[\'user\'] = \''.$user.'\';
$config[\'user\'] = \'' . $user . '\';
// your Database Password
$config[\'pass\'] = \''.$pass.'\';
$config[\'pass\'] = \'' . $pass . '\';
// your Database
$config[\'db\'] = \''.$db.'\';
$config[\'db\'] = \'' . $db . '\';
// your Database Prefix
$config[\'prefix\']=\''.$prefix.'\';
$config[\'prefix\']=\'' . $prefix . '\';
// your Database Sytem
$config[\'db_class\']= \''.$driver.'\';
$config[\'db_class\']= \'' . $driver . '\';
?>';
define('DEBUG', FALSE);
include dirname(__FILE__, 2) .'/inc/logger.class.php';
include dirname(__FILE__, 2) .'/core/database/'.$driver.'.class.php';
try{
$db = new db($server, $user, $pass, $db,'utf8', FALSE,TRUE);
$result=$db->query("SHOW TABLES");
}catch(Exception $e){
$error=true;
}
if(!$error){
$datei = fopen(dirname(__FILE__, 2) .'/config.tmp.php','w');
fputs($datei,$configdata);
fclose($datei);
$locked='';
$err='<p><div class="comment"><img src="style/images/warning.png" alt="" /><span style="color: orange;">'.$this->t->_('Installationwarten').'</span></div></p>';
}else{
$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'])){
define('DEBUG', FALSE);
include dirname(__FILE__, 2) .'/inc/logger.class.php';
include dirname(__FILE__, 2) .'/config.tmp.php';
include dirname(__FILE__, 2) .'/core/database/'.$config['db_class'].'.class.php';
$configdata='<?php
include dirname(__FILE__, 2) . '/inc/logger.class.php';
include dirname(__FILE__, 2) . '/core/database/' . $driver . '.class.php';
try {
$db = new db($server, $user, $pass, $db, 'utf8', FALSE, TRUE);
$result = $db->query("SHOW TABLES");
} catch (Exception $e) {
$error = true;
}
if (!$error) {
$datei = fopen(dirname(__FILE__, 2) . '/config.tmp.php', 'w');
fputs($datei, $configdata);
fclose($datei);
$locked = '';
$err = '<p><div class="comment"><img src="style/images/warning.png" alt="" /><span style="color: orange;">' . $this->t->_('Installationwarten') . '</span></div></p>';
} else {
$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'])) {
define('DEBUG', FALSE);
include dirname(__FILE__, 2) . '/inc/logger.class.php';
include dirname(__FILE__, 2) . '/config.tmp.php';
include dirname(__FILE__, 2) . '/core/database/' . $config['db_class'] . '.class.php';
$configdata = '<?php
/**
* Project: BeCast WebEngine - simple site engine
* File: config.inc.php
@ -579,148 +579,146 @@ if(!defined("in_astat")){
die();
}
// your Database Server (most likely localhost)
$config[\'host\'] = \''.$config['host'].'\';
$config[\'host\'] = \'' . $config['host'] . '\';
// your Database Username
$config[\'user\'] = \''.$config['user'].'\';
$config[\'user\'] = \'' . $config['user'] . '\';
// your Database Password
$config[\'pass\'] = \''.$config['pass'].'\';
$config[\'pass\'] = \'' . $config['pass'] . '\';
// your Database
$config[\'db\'] = \''.$config['db'].'\';
$config[\'db\'] = \'' . $config['db'] . '\';
// your Database Prefix
$config[\'prefix\']=\''.$config['prefix'].'\';
$config[\'prefix\']=\'' . $config['prefix'] . '\';
// your Database Sytem
$config[\'db_class\']= \''.$config['db_class'].'\';
$config[\'db_class\']= \'' . $config['db_class'] . '\';
define(\'INSTALLED\', TRUE);
define(\'CHARSET\', \'UTF-8\');
define(\'DEBUG\', FALSE);
?>';
$datei = fopen(dirname(__FILE__, 2) .'/inc/config.inc.php','w+');
fputs($datei,$configdata);
fclose($datei);
$db = new db($config['host'], $config['user'], $config['pass'], $config['db'],'utf8', FALSE,TRUE);
$dump = new dump($db);
$dump->read(dirname(__FILE__).'/sql/dump.sql');
$dump->prepare($config['prefix']);
$dump->execute();
$pdata=$_POST;
@unlink(dirname(__FILE__, 2) .'/config.tmp.php');
header("Location: install.php?step=user");
}
if($pdata['dbprefix']==''){
$pdata['dbprefix']='bcwe_';
}
if($pdata['dbserv']==''){
$pdata['dbserv']='localhost';
}
$this->getsupportetdbs();
foreach($this->dbas as $driver){
if($pdata['dbdriver']==$driver['short']){
$select='selected="selected"';
}
$drv.='<option value="'.$driver['short'].'" '.$select.'>'.$driver['name'].'</option>';
}
$data='<h3>'.$this->t->_('Datenbank').'</h3>
<p>'.$this->t->_('DatenbankText').'</p>
'.$err.'
$datei = fopen(dirname(__FILE__, 2) . '/inc/config.inc.php', 'w+');
fputs($datei, $configdata);
fclose($datei);
$db = new db($config['host'], $config['user'], $config['pass'], $config['db'], 'utf8', FALSE, TRUE);
$dump = new dump($db);
$dump->read(dirname(__FILE__) . '/sql/dump.sql');
$dump->prepare($config['prefix']);
$dump->execute();
$pdata = $_POST;
@unlink(dirname(__FILE__, 2) . '/config.tmp.php');
header("Location: install.php?step=user");
}
if ($pdata['dbprefix'] == '') {
$pdata['dbprefix'] = 'bcwe_';
}
if ($pdata['dbserv'] == '') {
$pdata['dbserv'] = 'localhost';
}
$this->getsupportetdbs();
foreach ($this->dbas as $driver) {
if ($pdata['dbdriver'] == $driver['short']) {
$select = 'selected="selected"';
}
$drv .= '<option value="' . $driver['short'] . '" ' . $select . '>' . $driver['name'] . '</option>';
}
$data = '<h3>' . $this->t->_('Datenbank') . '</h3>
<p>' . $this->t->_('DatenbankText') . '</p>
' . $err . '
<form action="#" method="post">
<div class="reihe">
<label class="label" for="dbuser">'.$this->t->_('Datenbankbenutzer').'</label>
<input class="feld" autocomplete="off" id="dbuser" name="dbuser" value="'.$pdata['dbuser'].'" type="text" />
<label class="label" for="dbuser">' . $this->t->_('Datenbankbenutzer') . '</label>
<input class="feld" autocomplete="off" id="dbuser" name="dbuser" value="' . $pdata['dbuser'] . '" type="text" />
</div>
<div class="reihe">
<label class="label" for="dbpass">'.$this->t->_('Datenbankpasswort').'</label>
<input class="feld" autocomplete="off" id="dbpass" name="dbpass" value="'.$pdata['dbpass'].'" type="password" />
<label class="label" for="dbpass">' . $this->t->_('Datenbankpasswort') . '</label>
<input class="feld" autocomplete="off" id="dbpass" name="dbpass" value="' . $pdata['dbpass'] . '" type="password" />
</div>
<div class="reihe">
<label class="label" for="db">'.$this->t->_('Datenbank').'</label>
<input class="feld" autocomplete="off" id="db" name="db" value="'.$pdata['db'].'" type="text" />
<label class="label" for="db">' . $this->t->_('Datenbank') . '</label>
<input class="feld" autocomplete="off" id="db" name="db" value="' . $pdata['db'] . '" type="text" />
</div>
<div class="reihe">
<label class="label" for="dbserv">'.$this->t->_('Datenbankserver').'</label>
<input class="feld" autocomplete="off" id="dbserv" name="dbserv" value="'.$pdata['dbserv'].'" type="text" />
<label class="label" for="dbserv">' . $this->t->_('Datenbankserver') . '</label>
<input class="feld" autocomplete="off" id="dbserv" name="dbserv" value="' . $pdata['dbserv'] . '" type="text" />
</div>
<div class="reihe">
<label class="label" for="dbprefix">'.$this->t->_('Datenbankprefix').'</label>
<input class="feld" autocomplete="off" id="dbprefix" name="dbprefix" value="'.$pdata['dbprefix'].'" type="text" />
<label class="label" for="dbprefix">' . $this->t->_('Datenbankprefix') . '</label>
<input class="feld" autocomplete="off" id="dbprefix" name="dbprefix" value="' . $pdata['dbprefix'] . '" type="text" />
</div>
<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">
'.$drv.'
' . $drv . '
</select>
</div>
<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>
<br style="clear:both;" />';
break;
case 'user':
if(isset($_POST['back'])){
header("Location: install.php?step=database");
}
if(isset($_POST['send'])){
$err=false;
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>';
}
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>';
}
if(!$err){
define('in_astat',TRUE);
break;
case 'user':
if (isset($_POST['back'])) {
header("Location: install.php?step=database");
}
if (isset($_POST['send'])) {
$err = false;
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>';
}
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>';
}
if (!$err) {
define('in_astat', TRUE);
define('DEBUG', FALSE);
include dirname(__FILE__, 2) .'/inc/logger.class.php';
include dirname(__FILE__, 2) .'/inc/config.inc.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);
$key=$this->generate_Key(50);
$salt=$this->generate_Key(6);
$active=1;
$pass=hash('sha256',$db->escape($salt.$_POST['pass']));
$username=$db->escape($_POST['user']);
$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')");
header("Location: install.php?step=finish");
}else{
$pdata=$_POST;
}
}
$data='<h3>'.$this->t->_('Benutzer').'</h3>
<p>'.$this->t->_('BenutzerText').'</p>
'.$err.'
include dirname(__FILE__, 2) . '/inc/logger.class.php';
include dirname(__FILE__, 2) . '/inc/config.inc.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);
$key = $this->generate_Key(50);
$salt = $this->generate_Key(6);
$active = 1;
$pass = hash('sha256', $db->escape($salt . $_POST['pass']));
$username = $db->escape($_POST['user']);
$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')");
header("Location: install.php?step=finish");
} else {
$pdata = $_POST;
}
}
$data = '<h3>' . $this->t->_('Benutzer') . '</h3>
<p>' . $this->t->_('BenutzerText') . '</p>
' . $err . '
<form action="#" method="post">
<div class="reihe">
<label class="label" for="user">'.$this->t->_('Benutzername').'</label>
<input class="feld" autocomplete="off" id="user" name="user" value="'.$pdata['user'].'" type="text" />
<label class="label" for="user">' . $this->t->_('Benutzername') . '</label>
<input class="feld" autocomplete="off" id="user" name="user" value="' . $pdata['user'] . '" type="text" />
</div>
<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" />
</div>
<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" />
</div>
<div class="reihe">
<label class="label" for="email">'.$this->t->_('EMail').'</label>
<input class="feld" autocomplete="off" id="email" name="email" value="'.$pdata['email'].'" type="text" />
<label class="label" for="email">' . $this->t->_('EMail') . '</label>
<input class="feld" autocomplete="off" id="email" name="email" value="' . $pdata['email'] . '" type="text" />
</div>
<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>
<br style="clear:both;" />';
break;
case 'finish':
$fopen=true;
$test=fopen('https://webengine.becast.at/install.php?test', 'r');
$testecho= fgets($test,1024);
fclose($test);
if($testecho!="Success"){
$fopen=false;
}
break;
case 'finish':
$fopen = true;
$test = fopen('https://webengine.becast.at/install.php?test', 'r');
if (!$test) {
$fopen = false;
}
$server='Server: '.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
$astat_version='BcWe version: '.$this->version;
$timestamp='Timestamp: '.time();