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: 63-database.php 2084 2007-09-11 02:24:51Z rvelices $ |
---|
8 | // | last update : $Date: 2007-09-11 02:24:51 +0000 (Tue, 11 Sep 2007) $ |
---|
9 | // | last modifier : $Author: rvelices $ |
---|
10 | // | revision : $Revision: 2084 $ |
---|
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 | |
---|
27 | if (!defined('PHPWG_ROOT_PATH')) |
---|
28 | { |
---|
29 | die('Hacking attempt!'); |
---|
30 | } |
---|
31 | |
---|
32 | $upgrade_description = 'Add #user_infos.level, #images.level and #user_cache.forbidden_images'; |
---|
33 | |
---|
34 | include_once(PHPWG_ROOT_PATH.'include/constants.php'); |
---|
35 | |
---|
36 | // +-----------------------------------------------------------------------+ |
---|
37 | // | Upgrade content | |
---|
38 | // +-----------------------------------------------------------------------+ |
---|
39 | |
---|
40 | $query = ' |
---|
41 | ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN level TINYINT UNSIGNED NOT NULL DEFAULT 0 |
---|
42 | '; |
---|
43 | pwg_query($query); |
---|
44 | |
---|
45 | $query = ' |
---|
46 | ALTER TABLE '.USER_INFOS_TABLE.' ADD COLUMN level TINYINT UNSIGNED NOT NULL DEFAULT 0 |
---|
47 | '; |
---|
48 | pwg_query($query); |
---|
49 | |
---|
50 | $query = ' |
---|
51 | ALTER TABLE '.USER_CACHE_TABLE.' ADD COLUMN image_access_type enum("NOT IN","IN") NOT NULL default "NOT IN" |
---|
52 | '; |
---|
53 | pwg_query($query); |
---|
54 | |
---|
55 | $query = ' |
---|
56 | ALTER TABLE '.USER_CACHE_TABLE.' ADD COLUMN image_access_list TEXT DEFAULT NULL |
---|
57 | '; |
---|
58 | pwg_query($query); |
---|
59 | |
---|
60 | $query = ' |
---|
61 | UPDATE '.USER_INFOS_TABLE.' SET level=8 WHERE status="webmaster" |
---|
62 | '; |
---|
63 | pwg_query($query); |
---|
64 | |
---|
65 | $query = ' |
---|
66 | UPDATE '.USER_CACHE_TABLE.' SET need_update=true |
---|
67 | '; |
---|
68 | pwg_query($query); |
---|
69 | |
---|
70 | echo |
---|
71 | "\n" |
---|
72 | .'"'.$upgrade_description.'"'.' ended' |
---|
73 | ."\n" |
---|
74 | ; |
---|
75 | |
---|
76 | ?> |
---|