source: trunk/admin.php @ 1682

Last change on this file since 1682 was 1682, checked in by rub, 17 years ago

Fix Feature Issue ID 0000585.

Convergence of exif configuration between local site and remote site.

Notes added on administration page where configuration is not OK.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.0 KB
Line 
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-2006 PhpWebGallery Team - http://phpwebgallery.net |
6// +-----------------------------------------------------------------------+
7// | branch        : BSF (Best So Far)
8// | file          : $RCSfile$
9// | last update   : $Date: 2006-12-28 00:06:06 +0000 (Thu, 28 Dec 2006) $
10// | last modifier : $Author: rub $
11// | revision      : $Revision: 1682 $
12// +-----------------------------------------------------------------------+
13// | This program is free software; you can redistribute it and/or modify  |
14// | it under the terms of the GNU General Public License as published by  |
15// | the Free Software Foundation                                          |
16// |                                                                       |
17// | This program is distributed in the hope that it will be useful, but   |
18// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
19// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
20// | General Public License for more details.                              |
21// |                                                                       |
22// | You should have received a copy of the GNU General Public License     |
23// | along with this program; if not, write to the Free Software           |
24// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
25// | USA.                                                                  |
26// +-----------------------------------------------------------------------+
27
28//----------------------------------------------------------- include
29define('PHPWG_ROOT_PATH','./');
30define('IN_ADMIN', true);
31include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
32
33include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
34include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php');
35
36// +-----------------------------------------------------------------------+
37// | Check Access and exit when user status is not ok                      |
38// +-----------------------------------------------------------------------+
39check_status(ACCESS_ADMINISTRATOR);
40
41// +-----------------------------------------------------------------------+
42// |                    synchronize user informations                      |
43// +-----------------------------------------------------------------------+
44
45sync_users();
46
47// +-----------------------------------------------------------------------+
48// |  Check configuration and add notes on problem                         |
49// +-----------------------------------------------------------------------+
50
51check_conf();
52
53// +-----------------------------------------------------------------------+
54// |                            variables init                             |
55// +-----------------------------------------------------------------------+
56
57if (isset($_GET['page'])
58    and preg_match('/^[a-z_]*$/', $_GET['page'])
59    and is_file(PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php'))
60{
61  $page['page'] = $_GET['page'];
62}
63else
64{
65  $page['page'] = 'intro';
66}
67
68$page['errors'] = array();
69$page['infos']  = array();
70
71$link_start = PHPWG_ROOT_PATH.'admin.php?page=';
72$conf_link = $link_start.'configuration&amp;section=';
73$opt_link = $link_start.'cat_options&amp;section=';
74//----------------------------------------------------- template initialization
75$title = l10n('PhpWebGallery Administration'); // for include/page_header.php
76$page['page_banner'] = '<h1>'.l10n('PhpWebGallery Administration').'</h1>';
77$page['body_id'] = 'theAdminPage';
78include(PHPWG_ROOT_PATH.'include/page_header.php');
79
80$template->set_filenames(array('admin' => 'admin.tpl'));
81
82$template->assign_vars(
83  array(
84    'U_SITE_MANAGER'=> $link_start.'site_manager',
85    'U_HISTORY'=> $link_start.'stats',
86    'U_FAQ'=> $link_start.'help',
87    'U_SITES'=> $link_start.'remote_site',
88    'U_MAINTENANCE'=> $link_start.'maintenance',
89    'U_NOTIFICATION_BY_MAIL'=> $link_start.'notification_by_mail',
90    'U_ADVANCED_FEATURE'=> $link_start.'advanced_feature',
91    'U_CONFIG_GENERAL'=> $conf_link.'general',
92    'U_CONFIG_COMMENTS'=> $conf_link.'comments',
93    'U_CONFIG_DISPLAY'=> $conf_link.'default',
94    'U_CATEGORIES'=> $link_start.'cat_list',
95    'U_MOVE'=> $link_start.'cat_move',
96    'U_CAT_UPLOAD'=> $opt_link.'upload',
97    'U_CAT_COMMENTS'=> $opt_link.'comments',
98    'U_CAT_VISIBLE'=> $opt_link.'visible',
99    'U_CAT_STATUS'=> $opt_link.'status',
100    'U_CAT_OPTIONS'=> $link_start.'cat_options',
101    'U_CAT_UPDATE'=> $link_start.'site_update&amp;site=1',
102    'U_WAITING'=> $link_start.'waiting',
103    'U_COMMENTS'=> $link_start.'comments',
104    'U_RATING'=> $link_start.'rating',
105    'U_CADDIE'=> $link_start.'element_set&amp;cat=caddie',
106    'U_TAGS'=> $link_start.'tags',
107    'U_THUMBNAILS'=> $link_start.'thumbnail',
108    'U_USERS'=> $link_start.'user_list',
109    'U_GROUPS'=> $link_start.'group_list',
110    'U_RETURN'=> make_index_url(),
111    'U_ADMIN'=> PHPWG_ROOT_PATH.'admin.php',
112    'L_ADMIN' => $lang['admin'],
113    'L_ADMIN_HINT' => $lang['hint_admin']
114    )
115  );
116if ($conf['allow_web_services'])
117{
118  $template->assign_block_vars(
119    'web_services',
120    array(
121      'U_WS_CHECKER'=> $link_start.'ws_checker',
122      )
123    );
124}
125if ($conf['allow_random_representative'])
126{
127  $template->assign_block_vars(
128    'representative',
129    array(
130      'URL' => $opt_link.'representative'
131      )
132    );
133}
134
135// required before plugin page inclusion
136trigger_action('plugin_admin_menu');
137
138include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php');
139
140//------------------------------------------------------------- content display
141$template->assign_block_vars('plugin_menu.menu_item',
142    array(
143      'NAME' => l10n('admin'),
144      'URL' => $link_start.'plugins'
145    )
146  );
147if ( isset($page['plugin_admin_menu']) )
148{
149  $plug_base_url = $link_start.'plugin&amp;section=';
150  foreach ($page['plugin_admin_menu'] as $menu)
151  {
152    $template->assign_block_vars('plugin_menu.menu_item',
153        array(
154          'NAME' => $menu['title'],
155          'URL' => $plug_base_url.$menu['uid']
156        )
157      );
158  }
159}
160
161// +-----------------------------------------------------------------------+
162// |                            errors & infos                             |
163// +-----------------------------------------------------------------------+
164
165if (count($page['errors']) != 0)
166{
167  foreach ($page['errors'] as $error)
168  {
169    $template->assign_block_vars('errors.error',array('ERROR'=>$error));
170  }
171}
172
173if (count($page['infos']) != 0)
174{
175  foreach ($page['infos'] as $info)
176  {
177    $template->assign_block_vars('infos.info',array('INFO'=>$info));
178  }
179}
180
181$template->parse('admin');
182include(PHPWG_ROOT_PATH.'include/page_tail.php');
183
184// +-----------------------------------------------------------------------+
185// |                     order permission refreshment                      |
186// +-----------------------------------------------------------------------+
187
188$query = '
189UPDATE '.USER_CACHE_TABLE.'
190  SET need_update = \'true\'
191;';
192pwg_query($query);
193?>
Note: See TracBrowser for help on using the repository browser.