| 27 | | if (modify_database($CFG->dirroot . "lib/db/$CFG->dbtype.sql")) { |
|---|
| 28 | | include_once($CFG->dirroot . "version.php"); |
|---|
| 29 | | set_config('version', $version); |
|---|
| 30 | | $db->debug = false; |
|---|
| 31 | | notify($strdatabasesuccess, "green"); |
|---|
| 32 | | if (!isset($CFG->newsinitialpassword) || empty($CFG->newsinitialpassword)) { |
|---|
| 33 | | notify("WARNING: the initial password for the news account is 'password'. This account has administrator privileges, and you should log in and change the password as soon as installation is complete."); |
|---|
| | 27 | |
|---|
| | 28 | //version check |
|---|
| | 29 | $continue = true; |
|---|
| | 30 | $infoarr = $db->ServerInfo(); |
|---|
| | 31 | if (!empty($infoarr['version'])) { |
|---|
| | 32 | switch($CFG->dbtype) { |
|---|
| | 33 | case "mysql": |
|---|
| | 34 | if (!preg_match('/^(4\.1|[5-9]\.|[0-9][0-9]+)/', $infoarr['version'])) { |
|---|
| | 35 | error('Error: Your MySQL version is too old: ' . $infoarr['version'] . '. Elgg requires MySQL 4.1 or newer. 5.0 or newer is recommended.'); |
|---|
| | 36 | $continue = false; |
|---|
| | 37 | } |
|---|
| | 38 | break; |
|---|
| | 39 | } |
|---|
| | 40 | } |
|---|
| | 41 | |
|---|
| | 42 | if ($continue) { |
|---|
| | 43 | if (modify_database($CFG->dirroot . "lib/db/$CFG->dbtype.sql")) { |
|---|
| | 44 | include_once($CFG->dirroot . "version.php"); |
|---|
| | 45 | set_config('version', $version); |
|---|
| | 46 | $db->debug = false; |
|---|
| | 47 | notify($strdatabasesuccess, "green"); |
|---|
| | 48 | if (!isset($CFG->newsinitialpassword) || empty($CFG->newsinitialpassword)) { |
|---|
| | 49 | notify("WARNING: the initial password for the news account is 'password'. This account has administrator privileges, and you should log in and change the password as soon as installation is complete."); |
|---|
| | 50 | } else { |
|---|
| | 51 | //$newspassword = $db->qstr(md5($CFG->newsinitialpassword)); |
|---|
| | 52 | //execute_sql("update ".$CFG->prefix."users set password = $newspassword where username = 'news'"); |
|---|
| | 53 | set_field('users', 'password', md5($CFG->newsinitialpassword), 'username', 'news'); |
|---|
| | 54 | } |
|---|
| | 55 | //execute_sql("update ".$CFG->prefix."users set email = ". $db->qstr($CFG->sysadminemail) ." where username = 'news'"); |
|---|
| | 56 | set_field('users', 'email', $CFG->sysadminemail, 'username', 'news'); |
|---|