Anego CMS Setup
Tasks:
- Configure PHP / Server
'; $warn = ' '; $bad = ' '; $configGood = true; $str='PHP Version 5 or higher'; if(intval(substr(phpversion(),0,1))>=5) { echo $good.$str; } else { echo $bad.$str.' - you have '.phpversion()." :("; $configGood=false; } echo '
'; if(ini_get('short_open_tag')) echo $good; else { echo $bad; $configGood=false; } echo '(php.ini) short_open_tag on
'; if(function_exists('mysqli_connect')) echo $good; else { echo $bad; $configGood=false; } echo '(php.ini) MySQL extension
'; if(extension_loaded ('gd')) echo $good; else { echo $bad; $configGood=false; } echo '(php.ini) GD2 extension
'; /*if(extension_loaded ('json')) echo $good; else { echo $bad; $configGood=false; } echo '(php.ini) JSON extension (included in php 5.2 and above)
';*/ if($cfg['fancyURLs']) { ?> - Give write access to following folders/files:
- no write access to some files in this folder!
'; } else { echo $good.$f.'
'; } } else { echo $bad.$f; echo '
'; } $allWriteable = $allWriteable && $writeable; } ?> - Configure conf.inc.php
'; } else { if(file_exists('conf.inc.php')) $sql_link=@mysqli_connect(HOST,SQLUSER,SQLPASS); if (isset($_GET['a']) && $_GET['a'] == 'crdb') { if( @mysqli_query($sql_link, 'CREATE DATABASE IF NOT EXISTS '.$_POST['dbname'])) echo 'Database \''.$_POST['dbname'].'\' created. You have to add it to the conf.inc.php to be recognized by Setup.
'; else echo 'Couldn\'t create database, please create it manually.Error was \''.mysqli_error($sql_link).'\'
'; } $icon = $good; $err = ''; if (! $sql_link) { $icon = $bad; $err = ' - couldn\'t connect to database'; } else { if(!@mysqli_select_db($sql_link, SQLDB)) { $sql_link=0; $icon=$bad; $err=' - connected but couldn\'t select database (create a database with name: '; } } echo $icon.'MySQL Info'.$err.'
'; $err=''; if (file_exists('styles/'.STYLE.'/templates/index.tpl')) { echo $good.'Page design'; } else { echo $bad.'Page design - \'styles/'.STYLE.'/templates/index.tpl not found.\''; } echo '
'; // Inform about domain if (!strlen($cfg['domain'])) { echo $warn; echo 'No domain supplied. Will be using ' . $cfg['default_domain'] . ''; echo 'from server configuration. Please configure $cfg[\'domain\'] if this is incorrect. Wrong domain settings e.g. might prevent the TinyMCE from being loaded'; } else { if (substr($cfg['domain'], -1) != '/') { echo $warn; echo 'Domain is missing trailing slash (/), please add one to your $cfg[\'domain\']
'; } else { echo $good.'Site Domain
'; } } // Check if we are in the server root directory - if not, anego needs to know about this $path = dirname($_SERVER['REQUEST_URI']).'/'; if ($path == '//') $path = '/'; // dirname adds backslashes in windows O.o if(preg_match('/Windows/i', php_uname("s"))) $path = str_replace('\\','/',$path); if($path[0] != '/') { $path .= '/' . $path; } if($path == $cfg['path']) { echo $good; } else { echo $warn; $err = 'Your Path settings might be incorrect. Try adding/adjusting the following line in conf.inc.php:$cfg[\'path\']=\''.$path.'\';'; } echo 'Anego path'.$err; echo '
'; // Default salt if($cfg['hash_salt'] == 'Vw_0Q3Z,e;y_!xyGo+tI' || strlen($cfg['hash_salt']) < 15) { echo $warn; if(strlen($cfg['hash_salt']) < 15) { echo "Your hash salt is very short.
"; echo 'How about something longer like this: '. htmlspecialchars(genPwd(35)) . ''; } else { echo 'You are using the default hash salt. Please add following (or similar) line to your config:
'; echo '$cfg[\'hash_salt\'] = \'' . htmlspecialchars(genPwd(35)) . '\';'; } } else { echo $good . 'Custom hash salt'; } } ?>- Set up database
Can\'t create tables, tables.sql file missing
'; $installOK=false; } } $tablesOK=false; if($sql_link) { mysqli_query($sql_link, "show tables like '".$cfg['tablePrefix']."%'"); if(mysqli_affected_rows($sql_link)>=2) $tablesOK=true; } echo ($tablesOK?$good:$bad).' Database tables'; if($sql_link) echo ' (Create tables)'; if(!$tablesOK && $sql_link) echo ' - minimum required tables not set up'; ?>- Set up a user
refresh:0) { echo $good . count($user_accounts); } else { echo $bad . '0'; } ?> Configured user(s)
'; echo '$user_accounts = Array('; foreach($users as $name=>$pass) { if($i++>0) echo ','; echo "\n\t'".strtolower($name)."' => '".$pass."'"; } $i=0; echo "\n);\n\n"; echo '$user_roles = Array('; foreach($userroles as $name=>$ro) { if($i++>0) echo ','; echo "\n\t'".strtolower($name)."' => Role::".$ro; } echo "\n);"; echo '
...or add another user if you need more (start over):
'; } ?>
- Delete setup.php and tables.sql
All done. Enjoy setting up your freshly installed Anego CMS!
Start by creating your first page in the menu'; } } } } ?> - Set up database