source: trunk/install/db/60-database.php @ 2206

Last change on this file since 2206 was 1926, checked in by rub, 18 years ago

Issue 578
User guest must be real user

Step 1: guest is a real user

On next commit, I finish installation and use of guest of user list and group

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
RevLine 
[1926]1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
6// +-----------------------------------------------------------------------+
7// | file          : $Id: 60-database.php 1926 2007-03-28 19:57:00Z rub $
8// | last update   : $Date: 2007-03-28 19:57:00 +0000 (Wed, 28 Mar 2007) $
9// | last modifier : $Author: rub $
10// | revision      : $Revision: 1926 $
11// +-----------------------------------------------------------------------+
12// | This program is free software; you can redistribute it and/or modify  |
13// | it under the terms of the GNU General Public License as published by  |
14// | the Free Software Foundation                                          |
15// |                                                                       |
16// | This program is distributed in the hope that it will be useful, but   |
17// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
18// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
19// | General Public License for more details.                              |
20// |                                                                       |
21// | You should have received a copy of the GNU General Public License     |
22// | along with this program; if not, write to the Free Software           |
23// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
24// | USA.                                                                  |
25// +-----------------------------------------------------------------------+
26
27if (!defined('PHPWG_ROOT_PATH'))
28{
29  die('Hacking attempt!');
30}
31
32$upgrade_description = 'Change default value on #user_infos for guest';
33
34include_once(PHPWG_ROOT_PATH.'include/constants.php');
35include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
36@include(PHPWG_ROOT_PATH. 'include/config_local.inc.php');
37
38// +-----------------------------------------------------------------------+
39// |                            Upgrade content                            |
40// +-----------------------------------------------------------------------+
41
42load_conf_from_db();
43
44$query = "
45update ".USER_INFOS_TABLE."
46set
47  template = '".$conf['default_template']."',
48  nb_image_line = ".$conf['nb_image_line'].",
49  nb_line_page = ".$conf['nb_line_page'].",
50  language = '".$conf['default_language']."',
51  maxwidth = ".(empty($conf['default_maxwidth']) ? "null" : $conf['default_maxwidth']).",
52  maxheight = ".(empty($conf['default_maxheight']) ? "null" : $conf['default_maxheight']).",
53  recent_period = ".$conf['recent_period'].",
54  expand = '".boolean_to_string($conf['auto_expand'])."',
55  show_nb_comments = '".boolean_to_string($conf['show_nb_comments'])."',
56  show_nb_hits = '".boolean_to_string($conf['show_nb_hits'])."',
57  enabled_high = '".boolean_to_string(
58    (isset($conf['newuser_default_enabled_high']) ? 
59      $conf['newuser_default_enabled_high'] : true))."'
60where
61  user_id = ".$conf['default_user_id'].";";
62pwg_query($query);
63
64
65$query = "
66delete from ".CONFIG_TABLE."
67where
68  param in
69(
70  'default_template',
71  'nb_image_line',
72  'nb_line_page',
73  'default_language',
74  'default_maxwidth',
75  'default_maxheight',
76  'recent_period',
77  'auto_expand',
78  'show_nb_comments',
79  'show_nb_hits'
80);";
81pwg_query($query);
82
83echo
84"\n"
85.'"'.$upgrade_description.'"'.' ended'
86."\n"
87;
88
89?>
Note: See TracBrowser for help on using the repository browser.