diff --git a/install/install.php b/install/install.php index 2f2edf8..97f7c65 100755 --- a/install/install.php +++ b/install/install.php @@ -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.=''; - } - $data='
'.$this->t->_('WilkommenText1').'
-'.$this->t->_('Waehledeinesprache').'
+ 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 .= ''; + } + $data = '' . $this->t->_('WilkommenText1') . '
+' . $this->t->_('Waehledeinesprache') . '
'.$this->t->_('LizenzText').'
- '.$err.' -'.$this->t->_('Verzeichnis').' | '.$this->t->_('Ergebnis').' | |
---|---|---|
'.$dir['dir'].' | ................ | '.$dir['status'].' |
'.$this->t->_('Komponente').' | '.$this->t->_('benVersion').' | '.$this->t->_('instVersion').' |
---|---|---|
'.$p['name'].' | '.$p['needed'].' | '.$p['status'].' |
'.$this->t->_('PruefungText').'
'.$err.'
'; - if($globcheck){ - $data.=''.$this->t->_('CheckOK').'
'; - }else{ - $data.=''.$this->t->_('ChecknichtOK').'
'; - $locked='disabled="disabled"'; - } - $data.=''.$dirs.'
-'.$php.'
-'.$dbs.'
+ case 'license': + if (isset($_POST['back'])) { + header("Location: install.php?step=start"); + } + if (isset($_POST['send'])) { + if ($_POST['accept'] != 1) { + $err = '' . $this->t->_('LizenzText') . '
+ ' . $err . ' +' . $this->t->_('Verzeichnis') . ' | ' . $this->t->_('Ergebnis') . ' | |
---|---|---|
' . $dir['dir'] . ' | ................ | ' . $dir['status'] . ' |
' . $this->t->_('Komponente') . ' | ' . $this->t->_('benVersion') . ' | ' . $this->t->_('instVersion') . ' |
---|---|---|
' . $p['name'] . ' | ' . $p['needed'] . ' | ' . $p['status'] . ' |
' . $this->t->_('PruefungText') . '
' . $err . '
'; + if ($globcheck) { + $data .= '' . $this->t->_('CheckOK') . '
'; + } else { + $data .= '' . $this->t->_('ChecknichtOK') . '
'; + $locked = 'disabled="disabled"'; + } + $data .= '' . $dirs . '
+' . $php . '
+' . $dbs . '
'.$this->t->_('DatenbankText').'
- '.$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 .= ''; + } + $data = '' . $this->t->_('DatenbankText') . '
+ ' . $err . ''.$this->t->_('BenutzerText').'
- '.$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 = '' . $this->t->_('BenutzerText') . '
+ ' . $err . '