aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--install.php45
-rw-r--r--install/phpwebgallery_structure.sql30
2 files changed, 52 insertions, 23 deletions
diff --git a/install.php b/install.php
index e4e38fafe..2f5ea3f30 100644
--- a/install.php
+++ b/install.php
@@ -300,26 +300,45 @@ if ( isset( $_POST['install'] ))
mysql_query( $query );
// webmaster admin user
- $query = 'INSERT INTO '.USERS_TABLE;
- $query.= ' (id,username,password,status,language,mail_address) VALUES ';
- $query.= "(1,'".$admin_name."','".md5( $admin_pass1 )."'";
- $query.= ",'admin','".$language."'";
- $query.= ",'".$admin_mail."');";
+ $query = '
+INSERT INTO '.USERS_TABLE.'
+ (id,username,password,mail_address)
+ VALUES
+ (1,\''.$admin_name.'\',\''.md5($admin_pass1).'\',\''.$admin_mail.'\')
+;';
mysql_query($query);
$query = '
-UPDATE '.USERS_TABLE.'
+INSERT INTO '.USER_INFOS_TABLE.'
+ (user_id,status,language)
+ VALUES
+ (1, \'admin\', \''.$language.'\')
+;';
+ mysql_query($query);
+
+ $query = '
+UPDATE '.USER_INFOS_TABLE.'
SET feed_id = \''.find_available_feed_id().'\'
- WHERE id = 1
+ WHERE user_id = 1
;';
mysql_query($query);
-
+
// guest user
- $query = 'INSERT INTO '.USERS_TABLE;
- $query.= '(id,username,password,status,language) VALUES ';
- $query.= "(2,'guest','','guest','".$language."')";
- $query.= ';';
- mysql_query( $query );
+ $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)
+ VALUES
+ (2, \'guest\', \''.$language.'\')
+;';
+ mysql_query($query);
}
}
diff --git a/install/phpwebgallery_structure.sql b/install/phpwebgallery_structure.sql
index 9ca7af0a7..98e81b3e9 100644
--- a/install/phpwebgallery_structure.sql
+++ b/install/phpwebgallery_structure.sql
@@ -212,11 +212,11 @@ CREATE TABLE `phpwebgallery_user_access` (
) TYPE=MyISAM;
--
--- Table structure for table `phpwebgallery_user_forbidden`
+-- Table structure for table `phpwebgallery_user_cache`
--
-DROP TABLE IF EXISTS `phpwebgallery_user_forbidden`;
-CREATE TABLE `phpwebgallery_user_forbidden` (
+DROP TABLE IF EXISTS `phpwebgallery_user_cache`;
+CREATE TABLE `phpwebgallery_user_cache` (
`user_id` smallint(5) unsigned NOT NULL default '0',
`need_update` enum('true','false') NOT NULL default 'true',
`forbidden_categories` text,
@@ -235,15 +235,12 @@ CREATE TABLE `phpwebgallery_user_group` (
) TYPE=MyISAM;
--
--- Table structure for table `phpwebgallery_users`
+-- Table structure for table `phpwebgallery_user_infos`
--
-DROP TABLE IF EXISTS `phpwebgallery_users`;
-CREATE TABLE `phpwebgallery_users` (
- `id` smallint(5) unsigned NOT NULL auto_increment,
- `username` varchar(20) binary NOT NULL default '',
- `password` varchar(32) default NULL,
- `mail_address` varchar(255) default NULL,
+DROP TABLE IF EXISTS `phpwebgallery_user_infos`;
+CREATE TABLE `phpwebgallery_user_infos` (
+ `user_id` smallint(5) unsigned NOT NULL default '0',
`nb_image_line` tinyint(1) unsigned NOT NULL default '5',
`nb_line_page` tinyint(3) unsigned NOT NULL default '3',
`status` enum('admin','guest') NOT NULL default 'guest',
@@ -257,6 +254,19 @@ CREATE TABLE `phpwebgallery_users` (
`last_feed_check` datetime default NULL,
`feed_id` varchar(50) binary default NULL,
`registration_date` datetime NOT NULL default '0000-00-00 00:00:00',
+ UNIQUE KEY `user_infos_ui1` (`user_id`)
+) TYPE=MyISAM;
+
+--
+-- Table structure for table `phpwebgallery_users`
+--
+
+DROP TABLE IF EXISTS `phpwebgallery_users`;
+CREATE TABLE `phpwebgallery_users` (
+ `id` smallint(5) unsigned NOT NULL auto_increment,
+ `username` varchar(20) binary NOT NULL default '',
+ `password` varchar(32) default NULL,
+ `mail_address` varchar(255) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `users_ui1` (`username`)
) TYPE=MyISAM;