[809] | 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-2005 PhpWebGallery Team - http://phpwebgallery.net | |
---|
| 6 | // +-----------------------------------------------------------------------+ |
---|
| 7 | // | branch : BSF (Best So Far) |
---|
| 8 | // | file : $RCSfile$ |
---|
| 9 | // | last update : $Date: 2006-04-21 21:16:37 +0000 (Fri, 21 Apr 2006) $ |
---|
| 10 | // | last modifier : $Author: nikrou $ |
---|
| 11 | // | revision : $Revision: 1250 $ |
---|
| 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 | if (!defined('PHPWG_ROOT_PATH')) |
---|
| 29 | { |
---|
| 30 | die ("Hacking attempt!"); |
---|
| 31 | } |
---|
| 32 | |
---|
[1072] | 33 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
| 34 | |
---|
[809] | 35 | // +-----------------------------------------------------------------------+ |
---|
[1072] | 36 | // | Check Access and exit when user status is not ok | |
---|
| 37 | // +-----------------------------------------------------------------------+ |
---|
| 38 | check_status(ACCESS_ADMINISTRATOR); |
---|
| 39 | |
---|
| 40 | // +-----------------------------------------------------------------------+ |
---|
[809] | 41 | // | actions | |
---|
| 42 | // +-----------------------------------------------------------------------+ |
---|
| 43 | |
---|
[1111] | 44 | $action = (isset($_GET['action']) and !is_adviser()) ? $_GET['action'] : ''; |
---|
[809] | 45 | |
---|
| 46 | switch ($action) |
---|
| 47 | { |
---|
| 48 | case 'categories' : |
---|
| 49 | { |
---|
| 50 | update_uppercats(); |
---|
| 51 | update_category('all'); |
---|
| 52 | ordering(); |
---|
| 53 | update_global_rank(); |
---|
| 54 | break; |
---|
| 55 | } |
---|
| 56 | case 'images' : |
---|
| 57 | { |
---|
| 58 | update_path(); |
---|
| 59 | update_average_rate(); |
---|
| 60 | break; |
---|
| 61 | } |
---|
| 62 | case 'history' : |
---|
| 63 | { |
---|
| 64 | $query = ' |
---|
| 65 | DELETE |
---|
| 66 | FROM '.HISTORY_TABLE.' |
---|
| 67 | ;'; |
---|
| 68 | pwg_query($query); |
---|
| 69 | break; |
---|
| 70 | } |
---|
| 71 | case 'sessions' : |
---|
| 72 | { |
---|
[1080] | 73 | pwg_session_gc(); |
---|
[809] | 74 | break; |
---|
| 75 | } |
---|
[833] | 76 | case 'feeds' : |
---|
| 77 | { |
---|
| 78 | $query = ' |
---|
| 79 | DELETE |
---|
| 80 | FROM '.USER_FEED_TABLE.' |
---|
| 81 | WHERE last_check IS NULL |
---|
| 82 | ;'; |
---|
| 83 | pwg_query($query); |
---|
| 84 | break; |
---|
| 85 | } |
---|
[1111] | 86 | case 'database' : |
---|
| 87 | { |
---|
| 88 | do_maintenance_all_tables(); |
---|
| 89 | break; |
---|
| 90 | } |
---|
[809] | 91 | default : |
---|
| 92 | { |
---|
| 93 | break; |
---|
| 94 | } |
---|
| 95 | } |
---|
| 96 | |
---|
| 97 | // +-----------------------------------------------------------------------+ |
---|
| 98 | // | template init | |
---|
| 99 | // +-----------------------------------------------------------------------+ |
---|
| 100 | |
---|
| 101 | $template->set_filenames(array('maintenance'=>'admin/maintenance.tpl')); |
---|
| 102 | |
---|
| 103 | $start_url = PHPWG_ROOT_PATH.'admin.php?page=maintenance&action='; |
---|
| 104 | |
---|
[1111] | 105 | $template->assign_vars( |
---|
| 106 | array( |
---|
| 107 | 'U_MAINT_CATEGORIES' => $start_url.'categories', |
---|
| 108 | 'U_MAINT_IMAGES' => $start_url.'images', |
---|
| 109 | 'U_MAINT_HISTORY' => $start_url.'history', |
---|
| 110 | 'U_MAINT_SESSIONS' => $start_url.'sessions', |
---|
| 111 | 'U_MAINT_FEEDS' => $start_url.'feeds', |
---|
| 112 | 'U_MAINT_DATABASE' => $start_url.'database', |
---|
[1250] | 113 | 'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=maintenance', |
---|
[1111] | 114 | ) |
---|
| 115 | ); |
---|
[1080] | 116 | |
---|
[809] | 117 | // +-----------------------------------------------------------------------+ |
---|
| 118 | // | sending html code | |
---|
| 119 | // +-----------------------------------------------------------------------+ |
---|
| 120 | |
---|
| 121 | $template->assign_var_from_handle('ADMIN_CONTENT', 'maintenance'); |
---|
| 122 | ?> |
---|