diff options
author | plegall <plg@piwigo.org> | 2006-04-27 21:05:07 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2006-04-27 21:05:07 +0000 |
commit | 46900fece3a0ffb09a0a4fe58bae841a3978f79d (patch) | |
tree | 7922f66a8f62a2eacf810ac75ed90344094f26fb /install.php | |
parent | 321d7d474c0c88316472e96d9740b2c4bbb6f6a6 (diff) |
bug 228 fixed one more time ;-): use boolean_to_string on
$conf['newuser_default_enabled_high'] during user infos creation. Useless
use of boolean_to_string on $conf['newcat_default_status'] was removed.
modification: loading configuration parameter from database was moved to a
dedicated function to be called from include/common.inc.php and from
install.php.
improvement: use of clean insert function during install.
bug fixed: during user information creation, support new status
webmaster/normal/guest instead of admin/guest.
bug fixed: during install, no need to insert obsolete mail_webmaster
configuration parameter.
git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1282 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'install.php')
-rw-r--r-- | install.php | 82 |
1 files changed, 31 insertions, 51 deletions
diff --git a/install.php b/install.php index 70d698147..d84b94600 100644 --- a/install.php +++ b/install.php @@ -247,8 +247,12 @@ define(\'PHPWG_INSTALLED\', true); { $html_content = htmlentities( $file_content, ENT_QUOTES ); $html_content = nl2br( $html_content ); - $template->assign_block_vars('error_copy', - array('FILE_CONTENT'=>$html_content)); + $template->assign_block_vars( + 'error_copy', + array( + 'FILE_CONTENT' => $html_content, + ) + ); } @fputs($fp, $file_content, strlen($file_content)); @fclose($fp); @@ -268,65 +272,41 @@ define(\'PHPWG_INSTALLED\', true); $query = ' UPDATE '.CONFIG_TABLE.' - SET value = \''.$admin_mail.'\' - WHERE param = \'mail_webmaster\' -;'; - mysql_query($query); - - $query = ' -UPDATE '.CONFIG_TABLE.' SET value = \''.$language.'\' WHERE param = \'default_language\' ;'; mysql_query($query); - - $query = ' -INSERT - INTO '.SITES_TABLE.' - (id, galleries_url) - VALUES - (1, \''.PHPWG_ROOT_PATH.'galleries/\') -;'; - mysql_query($query); + + // fill $conf global array + load_conf_from_db(); + + $insert = array( + 'id' => 1, + 'galleries_url' => PHPWG_ROOT_PATH.'galleries/', + ); + mass_inserts(SITES_TABLE, array_keys($insert), array($insert)); // webmaster admin user - $query = ' -INSERT INTO '.USERS_TABLE.' - (id,username,password,mail_address) - VALUES - (1,\''.$admin_name.'\',\''.md5($admin_pass1).'\',\''.$admin_mail.'\') -;'; - mysql_query($query); + $inserts = array( + array( + 'id' => 1, + 'username' => $admin_name, + 'password' => md5($admin_pass1), + 'mail_address' => $admin_mail, + ), + array( + 'id' => 2, + 'username' => 'guest', + ), + ); + mass_inserts(USERS_TABLE, array_keys($inserts[0]), $inserts); - $query = ' -INSERT INTO '.USER_INFOS_TABLE.' - (user_id,status,language,enabled_high) - VALUES - (1, \'webmaster\', \''.$language.'\',\''.$conf['newuser_default_enabled_high'].'\') -;'; - mysql_query($query); + create_user_infos(1); + create_user_infos(2); $query = ' UPDATE '.USER_INFOS_TABLE.' - SET feed_id = \''.find_available_feed_id().'\' - WHERE user_id = 1 -;'; - mysql_query($query); - - // guest user - $query = ' -INSERT INTO '.USERS_TABLE.' - (id,username,password,mail_address) - VALUES - (2,\'guest\',\'\',\'\') -;'; - mysql_query($query); - - $query = ' -INSERT INTO '.USER_INFOS_TABLE.' - (user_id,status,language,enabled_high) - VALUES - (2, \'guest\', \''.$language.'\',\'false\') + SET language = \''.$language.'\' ;'; mysql_query($query); |