diff --git a/awesomoe/setup/index.php b/awesomoe/setup/index.php index 432068e..293b3ad 100644 --- a/awesomoe/setup/index.php +++ b/awesomoe/setup/index.php @@ -1,10 +1,13 @@ init(); + class install { + protected $_alang; protected $position = null; protected $dberror = null; @@ -13,9 +16,19 @@ class install protected $database = null; protected $username = null; protected $password = null; + /** + * @var int + */ + protected $erros; - public function init() { + /** + * @var $smarty smarty + */ + protected $smarty; + public function init() { + define('PATH', __DIR__.'/../'); + $this->setSmarty(); /* load language */ /* Default language for users */ $config['def_lang'] = 'de'; @@ -48,6 +61,8 @@ public function init() { if (!$this->position || $this->position == 1) { include "step1.tpl"; } elseif($this->position == 2) { + + $this->checkSystem(); include "step2.tpl"; } elseif($this->position == 3) { include "step3.tpl"; @@ -240,5 +255,83 @@ public function translateContent($ident) { } echo $this->_alang[$ident]; } + + protected function setSmarty() { + $this->smarty = new Smarty; + $this->smarty->use_include_path = __DIR__.'/../'; + $this->smarty->debugging = true; + $this->smarty->caching = false; + $this->smarty->cache_lifetime = 120; + } + + + protected function checkSystem() { + $errors = 0; + $this->smarty->assign('errors', $errors); + if (PHP_VERSION_ID < 50616) { + $errors++; + echo "X "; + $this->translateContent('PHP2LOW'); + } else { + echo " ", + $this->translateContent('PHPOKAY'); + } + if (is_writable('../media/')) { + echo '

'; + $this->translateContent('mediaCHMODOK'); + echo '

'; + } else { + $errors++; + echo '

X '; + $this->translateContent('mediaCHMODNO'); + echo '

'; + } + + if (is_writable('../media/profile')) { + echo '

'; + $this->translateContent('mediapCHMODOK'); + echo '

'; + } else { + $errors++; + echo '

X '; + $this->translateContent('mediapCHMODNO'); + echo '

'; + } + + if (is_writable('../media/projects')) { + echo '

'; + $this->translateContent('mediaproCHMODOK'); + echo '

'; + } else { + $errors++; + echo '

X '; + $this->translateContent('mediaproCHMODNO'); + echo '

'; + } + + if (is_writable('../media/taskfiles')) { + echo '

'; + $this->translateContent('mediatasCHMODOK'); + echo '

'; + } else { + $errors++; + echo '

X '; + $this->translateContent('mediatasCHMODNO'); + echo '

'; + } + + if (is_writable('../tmp')) { + echo '

'; + $this->translateContent('mediatmpCHMODOK'); + echo '

'; + } else { + $errors++; + echo '

X '; + $this->translateContent('mediatmpCHMODNO'); + echo '

'; + } + $this->smarty->assign('errors', $errors); + $this->errors = $errors; + } } -?> \ No newline at end of file + diff --git a/awesomoe/setup/step2.tpl b/awesomoe/setup/step2.tpl index 96b5bec..506d192 100644 --- a/awesomoe/setup/step2.tpl +++ b/awesomoe/setup/step2.tpl @@ -1,85 +1,21 @@

PHP Version

-X "; - $this->translateContent('PHP2LOW'); - } else { - echo " ", - $this->translateContent('PHPOKAY'); - } -?>

translateContent('chmodRULES');?>

- '; - $this->translateContent('mediaCHMODOK'); - echo '

'; - } else { - $errors++; - echo '

X '; - $this->translateContent('mediaCHMODNO'); - echo '

'; - } - if (is_writable('../media/profile')) { - echo '

'; - $this->translateContent('mediapCHMODOK'); - echo '

'; - } else { - $errors++; - echo '

X '; - $this->translateContent('mediapCHMODNO'); - echo '

'; - } - - if (is_writable('../media/projects')) { - echo '

'; - $this->translateContent('mediaproCHMODOK'); - echo '

'; - } else { - $errors++; - echo '

X '; - $this->translateContent('mediaproCHMODNO'); - echo '

'; - } - if (is_writable('../media/taskfiles')) { - echo '

'; - $this->translateContent('mediatasCHMODOK'); - echo '

'; - } else { - $errors++; - echo '

X '; - $this->translateContent('mediatasCHMODNO'); - echo '

'; - } - - if (is_writable('../tmp')) { - echo '

'; - $this->translateContent('mediatmpCHMODOK'); - echo '

'; - } else { - $errors++; - echo '

X '; - $this->translateContent('mediatmpCHMODNO'); - echo '

'; - } - - if ($errors == 0) { +errors === 0) { ?> translateContent('NEXT'); ?> + + + translateContent('HELPCHMODUPDATE'); ?> - -translateContent('HELPCHMODUPDATE'); ?> - \ No newline at end of file