[217] | 1 | <?php |
---|
[354] | 2 | // +-----------------------------------------------------------------------+ |
---|
[593] | 3 | // | PhpWebGallery - a PHP based picture gallery | |
---|
| 4 | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | |
---|
[1058] | 5 | // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | |
---|
[354] | 6 | // +-----------------------------------------------------------------------+ |
---|
[593] | 7 | // | branch : BSF (Best So Far) |
---|
[354] | 8 | // | file : $RCSfile$ |
---|
| 9 | // | last update : $Date: 2006-04-02 22:26:19 +0000 (Sun, 02 Apr 2006) $ |
---|
| 10 | // | last modifier : $Author: plg $ |
---|
| 11 | // | revision : $Revision: 1119 $ |
---|
| 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 | // +-----------------------------------------------------------------------+ |
---|
[217] | 27 | |
---|
[345] | 28 | //----------------------------------------------------------- include |
---|
[364] | 29 | define('PHPWG_ROOT_PATH','./'); |
---|
[393] | 30 | define('IN_ADMIN', true); |
---|
[364] | 31 | include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); |
---|
[808] | 32 | |
---|
[1072] | 33 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
| 34 | |
---|
[808] | 35 | // +-----------------------------------------------------------------------+ |
---|
[1072] | 36 | // | Check Access and exit when user status is not ok | |
---|
| 37 | // +-----------------------------------------------------------------------+ |
---|
| 38 | check_status(ACCESS_ADMINISTRATOR); |
---|
| 39 | |
---|
| 40 | // +-----------------------------------------------------------------------+ |
---|
[808] | 41 | // | synchronize user informations | |
---|
| 42 | // +-----------------------------------------------------------------------+ |
---|
| 43 | |
---|
| 44 | sync_users(); |
---|
| 45 | |
---|
[817] | 46 | // +-----------------------------------------------------------------------+ |
---|
| 47 | // | variables init | |
---|
| 48 | // +-----------------------------------------------------------------------+ |
---|
[708] | 49 | |
---|
[817] | 50 | if (isset($_GET['page']) |
---|
| 51 | and preg_match('/^[a-z_]*$/', $_GET['page']) |
---|
| 52 | and is_file(PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php')) |
---|
[217] | 53 | { |
---|
[817] | 54 | $page['page'] = $_GET['page']; |
---|
[217] | 55 | } |
---|
[817] | 56 | else |
---|
[217] | 57 | { |
---|
[817] | 58 | $page['page'] = 'intro'; |
---|
[217] | 59 | } |
---|
[393] | 60 | |
---|
| 61 | $link_start = PHPWG_ROOT_PATH.'admin.php?page='; |
---|
[602] | 62 | $conf_link = $link_start.'configuration&section='; |
---|
[614] | 63 | $opt_link = $link_start.'cat_options&section='; |
---|
[393] | 64 | //----------------------------------------------------- template initialization |
---|
[862] | 65 | $title = l10n('PhpWebGallery Administration'); // for include/page_header.php |
---|
[1071] | 66 | $page['page_banner'] = '<h1>'.l10n('PhpWebGallery Administration').'</h1>'; |
---|
[850] | 67 | $page['body_id'] = 'theAdminPage'; |
---|
[393] | 68 | include(PHPWG_ROOT_PATH.'include/page_header.php'); |
---|
| 69 | |
---|
[817] | 70 | $template->set_filenames(array('admin' => 'admin.tpl')); |
---|
[614] | 71 | |
---|
[817] | 72 | $template->assign_vars( |
---|
| 73 | array( |
---|
[1029] | 74 | 'U_SITE_MANAGER'=> $link_start.'site_manager', |
---|
[1004] | 75 | 'U_HISTORY'=> $link_start.'stats', |
---|
| 76 | 'U_FAQ'=> $link_start.'help', |
---|
| 77 | 'U_SITES'=> $link_start.'remote_site', |
---|
| 78 | 'U_MAINTENANCE'=> $link_start.'maintenance', |
---|
[1091] | 79 | 'U_NOTIFICATION_BY_MAIL'=> $link_start.'notification_by_mail', |
---|
[1004] | 80 | 'U_CONFIG_GENERAL'=> $conf_link.'general', |
---|
| 81 | 'U_CONFIG_COMMENTS'=> $conf_link.'comments', |
---|
| 82 | 'U_CONFIG_DISPLAY'=> $conf_link.'default', |
---|
| 83 | 'U_CATEGORIES'=> $link_start.'cat_list', |
---|
| 84 | 'U_MOVE'=> $link_start.'cat_move', |
---|
| 85 | 'U_CAT_UPLOAD'=> $opt_link.'upload', |
---|
| 86 | 'U_CAT_COMMENTS'=> $opt_link.'comments', |
---|
| 87 | 'U_CAT_VISIBLE'=> $opt_link.'visible', |
---|
| 88 | 'U_CAT_STATUS'=> $opt_link.'status', |
---|
| 89 | 'U_CAT_OPTIONS'=> $link_start.'cat_options', |
---|
[1058] | 90 | 'U_CAT_UPDATE'=> $link_start.'site_update&site=1', |
---|
[1004] | 91 | 'U_WAITING'=> $link_start.'waiting', |
---|
| 92 | 'U_COMMENTS'=> $link_start.'comments', |
---|
[1042] | 93 | 'U_RATING'=> $link_start.'rating', |
---|
[1004] | 94 | 'U_CADDIE'=> $link_start.'element_set&cat=caddie', |
---|
[1119] | 95 | 'U_TAGS'=> $link_start.'tags', |
---|
[1004] | 96 | 'U_THUMBNAILS'=> $link_start.'thumbnail', |
---|
| 97 | 'U_USERS'=> $link_start.'user_list', |
---|
| 98 | 'U_GROUPS'=> $link_start.'group_list', |
---|
[1082] | 99 | 'U_RETURN'=> make_index_url(), |
---|
[1004] | 100 | 'U_ADMIN'=> PHPWG_ROOT_PATH.'admin.php', |
---|
[948] | 101 | 'L_ADMIN' => $lang['admin'], |
---|
| 102 | 'L_ADMIN_HINT' => $lang['hint_admin'] |
---|
[817] | 103 | ) |
---|
| 104 | ); |
---|
[393] | 105 | |
---|
[809] | 106 | if ($conf['allow_random_representative']) |
---|
| 107 | { |
---|
| 108 | $template->assign_block_vars( |
---|
| 109 | 'representative', |
---|
| 110 | array( |
---|
[1004] | 111 | 'URL' => $opt_link.'representative' |
---|
[809] | 112 | ) |
---|
| 113 | ); |
---|
| 114 | } |
---|
[1058] | 115 | |
---|
[217] | 116 | //------------------------------------------------------------- content display |
---|
[792] | 117 | $page['errors'] = array(); |
---|
[817] | 118 | $page['infos'] = array(); |
---|
[792] | 119 | |
---|
[817] | 120 | include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php'); |
---|
| 121 | |
---|
[792] | 122 | // +-----------------------------------------------------------------------+ |
---|
| 123 | // | errors & infos | |
---|
| 124 | // +-----------------------------------------------------------------------+ |
---|
[817] | 125 | |
---|
[792] | 126 | if (count($page['errors']) != 0) |
---|
| 127 | { |
---|
| 128 | $template->assign_block_vars('errors',array()); |
---|
| 129 | foreach ($page['errors'] as $error) |
---|
| 130 | { |
---|
| 131 | $template->assign_block_vars('errors.error',array('ERROR'=>$error)); |
---|
| 132 | } |
---|
| 133 | } |
---|
[817] | 134 | |
---|
[792] | 135 | if (count($page['infos']) != 0) |
---|
| 136 | { |
---|
| 137 | $template->assign_block_vars('infos',array()); |
---|
| 138 | foreach ($page['infos'] as $info) |
---|
| 139 | { |
---|
| 140 | $template->assign_block_vars('infos.info',array('INFO'=>$info)); |
---|
| 141 | } |
---|
| 142 | } |
---|
| 143 | |
---|
[688] | 144 | $template->parse('admin'); |
---|
[393] | 145 | include(PHPWG_ROOT_PATH.'include/page_tail.php'); |
---|
[817] | 146 | |
---|
[657] | 147 | // +-----------------------------------------------------------------------+ |
---|
| 148 | // | order permission refreshment | |
---|
| 149 | // +-----------------------------------------------------------------------+ |
---|
[817] | 150 | |
---|
[657] | 151 | $query = ' |
---|
[808] | 152 | UPDATE '.USER_CACHE_TABLE.' |
---|
[657] | 153 | SET need_update = \'true\' |
---|
| 154 | ;'; |
---|
| 155 | pwg_query($query); |
---|
[362] | 156 | ?> |
---|