2003-11-02 10:22:14 +00:00
|
|
|
<?php
|
2004-02-07 19:36:44 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
2019-06-04 17:13:51 +02:00
|
|
|
// | This file is part of Piwigo. |
|
2004-02-07 19:36:44 +00:00
|
|
|
// | |
|
2019-06-04 17:13:51 +02:00
|
|
|
// | For copyright and license information, please view the COPYING.txt |
|
|
|
|
// | file that was distributed with this source code. |
|
2004-02-07 19:36:44 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
2003-11-02 10:22:14 +00:00
|
|
|
|
2011-02-24 14:08:11 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | Basic constants and includes |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
2004-02-19 00:31:09 +00:00
|
|
|
define('PHPWG_ROOT_PATH','./');
|
2004-03-20 00:52:37 +00:00
|
|
|
define('IN_ADMIN', true);
|
2006-03-09 22:46:28 +00:00
|
|
|
|
2011-02-24 14:08:11 +00:00
|
|
|
include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
|
2006-03-09 22:46:28 +00:00
|
|
|
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
2006-12-14 00:58:57 +00:00
|
|
|
include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php');
|
2012-07-23 11:50:41 +00:00
|
|
|
include_once(PHPWG_ROOT_PATH.'admin/include/add_core_tabs.inc.php');
|
2006-03-09 22:46:28 +00:00
|
|
|
|
2014-06-02 07:55:46 +00:00
|
|
|
trigger_notify('loc_begin_admin');
|
2010-04-21 12:51:48 +00:00
|
|
|
|
2006-03-09 22:46:28 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | Check Access and exit when user status is not ok |
|
|
|
|
// +-----------------------------------------------------------------------+
|
2011-02-24 14:08:11 +00:00
|
|
|
|
2006-03-09 22:46:28 +00:00
|
|
|
check_status(ACCESS_ADMINISTRATOR);
|
2005-08-08 20:52:19 +00:00
|
|
|
|
2017-06-12 11:36:28 +02:00
|
|
|
check_input_parameter('page', $_GET, false, '/^[a-zA-Z\d_-]+$/');
|
2018-07-11 11:22:31 +02:00
|
|
|
check_input_parameter('section', $_GET, false, '/^[a-z]+[a-z_\/-]*(\.php)?$/i');
|
2017-06-12 11:36:28 +02:00
|
|
|
|
2011-02-24 14:08:11 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
2022-12-16 15:09:54 +01:00
|
|
|
// | Filesystem checks |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
|
|
|
if ($conf['fs_quick_check_period'] > 0)
|
|
|
|
{
|
|
|
|
$perform_fsqc = false;
|
|
|
|
if (isset($conf['fs_quick_check_last_check']))
|
|
|
|
{
|
|
|
|
if (strtotime($conf['fs_quick_check_last_check']) < strtotime($conf['fs_quick_check_period'].' seconds ago'))
|
|
|
|
{
|
|
|
|
$perform_fsqc = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$perform_fsqc = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($perform_fsqc)
|
|
|
|
{
|
|
|
|
fs_quick_check();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// +-----------------------------------------------------------------------+
|
2011-02-24 14:08:11 +00:00
|
|
|
// | Direct actions |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
2011-06-03 22:25:01 +00:00
|
|
|
// save plugins_new display order (AJAX action)
|
|
|
|
if (isset($_GET['plugins_new_order']))
|
|
|
|
{
|
|
|
|
pwg_set_session_var('plugins_new_order', $_GET['plugins_new_order']);
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2010-03-09 23:19:11 +00:00
|
|
|
// theme changer
|
|
|
|
if (isset($_GET['change_theme']))
|
|
|
|
{
|
2010-03-13 00:00:52 +00:00
|
|
|
$admin_themes = array('roma', 'clear');
|
2022-03-31 18:23:26 +02:00
|
|
|
$admin_theme_array = array(userprefs_get_param('admin_theme', 'clear'));
|
2017-09-19 11:25:00 +02:00
|
|
|
$result = array_diff(
|
|
|
|
$admin_themes,
|
|
|
|
$admin_theme_array
|
|
|
|
);
|
2010-03-09 23:19:11 +00:00
|
|
|
|
|
|
|
$new_admin_theme = array_pop(
|
2017-09-19 11:25:00 +02:00
|
|
|
$result
|
2010-03-09 23:19:11 +00:00
|
|
|
);
|
|
|
|
|
2022-03-31 18:23:26 +02:00
|
|
|
userprefs_update_param('admin_theme', $new_admin_theme);
|
2010-03-09 23:19:11 +00:00
|
|
|
|
2011-09-08 10:03:04 +00:00
|
|
|
$url_params = array();
|
|
|
|
foreach (array('page', 'tab', 'section') as $url_param)
|
|
|
|
{
|
|
|
|
if (isset($_GET[$url_param]))
|
|
|
|
{
|
|
|
|
$url_params[] = $url_param.'='.$_GET[$url_param];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$redirect_url = 'admin.php';
|
|
|
|
if (count($url_params) > 0)
|
|
|
|
{
|
|
|
|
$redirect_url.= '?'.implode('&', $url_params);
|
|
|
|
}
|
|
|
|
|
|
|
|
redirect($redirect_url);
|
2010-03-09 23:19:11 +00:00
|
|
|
}
|
|
|
|
|
2005-08-08 20:52:19 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
2011-02-24 14:08:11 +00:00
|
|
|
// | Synchronize user informations |
|
2005-08-08 20:52:19 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
2011-02-24 14:08:11 +00:00
|
|
|
|
2011-06-11 22:57:21 +00:00
|
|
|
// sync_user() is only useful when external authentication is activated
|
|
|
|
if ($conf['external_authentification'])
|
2011-01-18 20:57:36 +00:00
|
|
|
{
|
|
|
|
sync_users();
|
|
|
|
}
|
2005-08-08 20:52:19 +00:00
|
|
|
|
2005-08-17 14:25:38 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
2011-02-24 14:08:11 +00:00
|
|
|
// | Variables init |
|
2005-08-17 14:25:38 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
2004-03-20 00:52:37 +00:00
|
|
|
|
2011-09-08 10:03:04 +00:00
|
|
|
$change_theme_url = PHPWG_ROOT_PATH.'admin.php?';
|
|
|
|
$test_get = $_GET;
|
|
|
|
unset($test_get['page']);
|
|
|
|
unset($test_get['section']);
|
|
|
|
unset($test_get['tag']);
|
2013-12-12 10:40:39 +00:00
|
|
|
if (count($test_get) == 0 and !empty($_SERVER['QUERY_STRING']))
|
2011-09-08 10:03:04 +00:00
|
|
|
{
|
|
|
|
$change_theme_url.= str_replace('&', '&', $_SERVER['QUERY_STRING']).'&';
|
|
|
|
}
|
|
|
|
$change_theme_url.= 'change_theme=1';
|
|
|
|
|
2011-02-23 09:24:43 +00:00
|
|
|
// ?page=plugin-community-pendings is an clean alias of
|
|
|
|
// ?page=plugin§ion=community/admin.php&tab=pendings
|
2011-02-23 09:27:57 +00:00
|
|
|
if (isset($_GET['page']) and preg_match('/^plugin-([^-]*)(?:-(.*))?$/', $_GET['page'], $matches))
|
2011-02-23 09:24:43 +00:00
|
|
|
{
|
|
|
|
$_GET['page'] = 'plugin';
|
2021-12-30 16:54:42 +01:00
|
|
|
|
|
|
|
if (preg_match('/^piwigo_(videojs|openstreetmap)$/', $matches[1]))
|
|
|
|
{
|
|
|
|
$matches[1] = str_replace('_', '-', $matches[1]);
|
|
|
|
}
|
|
|
|
|
2011-02-23 09:24:43 +00:00
|
|
|
$_GET['section'] = $matches[1].'/admin.php';
|
|
|
|
if (isset($matches[2]))
|
|
|
|
{
|
|
|
|
$_GET['tab'] = $matches[2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-01 23:03:35 +00:00
|
|
|
// ?page=album-134-properties is an clean alias of
|
|
|
|
// ?page=album&cat_id=134&tab=properties
|
|
|
|
if (isset($_GET['page']) and preg_match('/^album-(\d+)(?:-(.*))?$/', $_GET['page'], $matches))
|
|
|
|
{
|
|
|
|
$_GET['page'] = 'album';
|
|
|
|
$_GET['cat_id'] = $matches[1];
|
|
|
|
if (isset($matches[2]))
|
|
|
|
{
|
|
|
|
$_GET['tab'] = $matches[2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-10 10:52:07 +00:00
|
|
|
// ?page=photo-1234-properties is an clean alias of
|
|
|
|
// ?page=photo&image_id=1234&tab=properties
|
|
|
|
if (isset($_GET['page']) and preg_match('/^photo-(\d+)(?:-(.*))?$/', $_GET['page'], $matches))
|
|
|
|
{
|
|
|
|
$_GET['page'] = 'photo';
|
|
|
|
$_GET['image_id'] = $matches[1];
|
|
|
|
if (isset($matches[2]))
|
|
|
|
{
|
|
|
|
$_GET['tab'] = $matches[2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-01-09 11:38:54 +00:00
|
|
|
if (isset($_GET['page'])
|
2005-08-17 14:25:38 +00:00
|
|
|
and preg_match('/^[a-z_]*$/', $_GET['page'])
|
2007-01-09 11:38:54 +00:00
|
|
|
and is_file(PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php'))
|
2003-11-02 10:22:14 +00:00
|
|
|
{
|
2007-01-09 11:38:54 +00:00
|
|
|
$page['page'] = $_GET['page'];
|
2003-11-02 10:22:14 +00:00
|
|
|
}
|
2007-01-09 11:38:54 +00:00
|
|
|
else
|
2003-11-02 10:22:14 +00:00
|
|
|
{
|
2007-01-09 11:38:54 +00:00
|
|
|
$page['page'] = 'intro';
|
2003-11-02 10:22:14 +00:00
|
|
|
}
|
2004-03-20 00:52:37 +00:00
|
|
|
|
|
|
|
$link_start = PHPWG_ROOT_PATH.'admin.php?page=';
|
2004-11-13 13:43:53 +00:00
|
|
|
$conf_link = $link_start.'configuration&section=';
|
2011-02-24 14:08:11 +00:00
|
|
|
|
2017-06-02 10:10:50 +02:00
|
|
|
// $_GET['tab'] is often used to perform and
|
|
|
|
// include('admin_page_'.$_GET['tab'].'.php') : we need to protect it to
|
|
|
|
// avoid any unexpected file inclusion
|
|
|
|
check_input_parameter('tab', $_GET, false, '/^[a-zA-Z\d_-]+$/');
|
|
|
|
|
2011-02-24 14:08:11 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | Template init |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
2008-05-15 18:43:33 +00:00
|
|
|
$title = l10n('Piwigo Administration'); // for include/page_header.php
|
|
|
|
$page['page_banner'] = '<h1>'.l10n('Piwigo Administration').'</h1>';
|
- new : HTML BODY identifier to let CSS stylesheets manage specific
behaviour.
- deletion : admin/search useless
- improvement : in admin/user_list, special behaviour for true/false fields
(expand, show_comments)
- new : gallery_title and gallery_description are displayed at the top of
each page.
- improvement : simplification in HTML for categories menu.
- improvement : standardization of presentation in all public pages
(identification, registration, search, profile, notification, comments,
etc.)
(not in ChangeLog, below this line)
- add forgotten notification.php (should have been added in a previous
commit)
- [template cclear] deletion of useless class .bouton
- [template cclear] for test purpose, new presentation of register page
(using FORM.filter)
- [template cclear] adaptation of admin/group_list from template default
- [template cclear] deletion of obsolete admin/infos_images
- [template cclear] deletion of obsolete admin/search_username
- [template cclear] new icon register.png
git-svn-id: http://piwigo.org/svn/trunk@850 68402e56-0260-453c-a942-63ccdbb3a9ee
2005-08-25 22:43:47 +00:00
|
|
|
$page['body_id'] = 'theAdminPage';
|
2004-03-20 00:52:37 +00:00
|
|
|
|
2005-08-17 14:25:38 +00:00
|
|
|
$template->set_filenames(array('admin' => 'admin.tpl'));
|
2004-11-23 22:31:24 +00:00
|
|
|
|
2008-02-27 02:31:51 +00:00
|
|
|
$template->assign(
|
2005-08-17 14:25:38 +00:00
|
|
|
array(
|
2010-03-09 23:19:11 +00:00
|
|
|
'USERNAME' => $user['username'],
|
2010-05-26 00:20:07 +00:00
|
|
|
'ENABLE_SYNCHRONIZATION' => $conf['enable_synchronization'],
|
2006-02-08 01:17:07 +00:00
|
|
|
'U_SITE_MANAGER'=> $link_start.'site_manager',
|
2017-01-27 16:49:40 +01:00
|
|
|
'U_HISTORY_STAT'=> $link_start.'stats&year='.date('Y').'&month='.date('n'),
|
2006-01-15 13:45:42 +00:00
|
|
|
'U_FAQ'=> $link_start.'help',
|
|
|
|
'U_SITES'=> $link_start.'remote_site',
|
|
|
|
'U_MAINTENANCE'=> $link_start.'maintenance',
|
2006-03-21 22:58:59 +00:00
|
|
|
'U_NOTIFICATION_BY_MAIL'=> $link_start.'notification_by_mail',
|
2007-03-11 23:02:13 +00:00
|
|
|
'U_CONFIG_GENERAL'=> $link_start.'configuration',
|
2006-01-15 13:45:42 +00:00
|
|
|
'U_CONFIG_DISPLAY'=> $conf_link.'default',
|
2008-07-14 21:42:40 +00:00
|
|
|
'U_CONFIG_EXTENTS'=> $link_start.'extend_for_templates',
|
2008-08-28 00:32:39 +00:00
|
|
|
'U_CONFIG_MENUBAR'=> $link_start.'menubar',
|
2011-04-23 12:48:05 +00:00
|
|
|
'U_CONFIG_LANGUAGES' => $link_start.'languages',
|
|
|
|
'U_CONFIG_THEMES'=> $link_start.'themes',
|
2006-01-15 13:45:42 +00:00
|
|
|
'U_CATEGORIES'=> $link_start.'cat_list',
|
2022-02-14 16:01:08 +01:00
|
|
|
'U_ALBUMS'=> $link_start.'albums',
|
2006-01-15 13:45:42 +00:00
|
|
|
'U_CAT_OPTIONS'=> $link_start.'cat_options',
|
2020-09-03 15:18:44 +02:00
|
|
|
'U_CAT_SEARCH'=> $link_start.'cat_search',
|
2006-02-28 01:13:16 +00:00
|
|
|
'U_CAT_UPDATE'=> $link_start.'site_update&site=1',
|
2006-02-15 02:29:26 +00:00
|
|
|
'U_RATING'=> $link_start.'rating',
|
2013-10-10 11:07:45 +00:00
|
|
|
'U_RECENT_SET'=> $link_start.'batch_manager&filter=prefilter-last_import',
|
2010-12-30 14:36:02 +00:00
|
|
|
'U_BATCH'=> $link_start.'batch_manager',
|
2006-04-02 22:26:19 +00:00
|
|
|
'U_TAGS'=> $link_start.'tags',
|
2006-01-15 13:45:42 +00:00
|
|
|
'U_USERS'=> $link_start.'user_list',
|
|
|
|
'U_GROUPS'=> $link_start.'group_list',
|
2011-06-14 12:14:29 +00:00
|
|
|
'U_RETURN'=> get_gallery_home_url(),
|
2008-09-23 17:56:54 +00:00
|
|
|
'U_ADMIN'=> PHPWG_ROOT_PATH.'admin.php',
|
2009-07-04 21:26:42 +00:00
|
|
|
'U_LOGOUT'=> PHPWG_ROOT_PATH.'index.php?act=logout',
|
2011-04-23 12:48:05 +00:00
|
|
|
'U_PLUGINS'=> $link_start.'plugins',
|
2010-03-08 23:39:53 +00:00
|
|
|
'U_ADD_PHOTOS' => $link_start.'photos_add',
|
2011-09-08 10:03:04 +00:00
|
|
|
'U_CHANGE_THEME' => $change_theme_url,
|
2019-05-28 16:05:09 +02:00
|
|
|
'ADMIN_PAGE_TITLE' => 'Piwigo Administration Page',
|
2023-01-02 16:18:34 +01:00
|
|
|
'ADMIN_PAGE_OBJECT_ID' => '',
|
2021-07-21 15:57:16 +02:00
|
|
|
'U_SHOW_TEMPLATE_TAB' => $conf['show_template_in_side_menu'],
|
2021-07-23 15:12:00 +02:00
|
|
|
'SHOW_RATING' => $conf['rate'],
|
2005-08-17 14:25:38 +00:00
|
|
|
)
|
|
|
|
);
|
2023-01-20 18:32:10 +01:00
|
|
|
|
|
|
|
if ($conf['enable_core_update'])
|
|
|
|
{
|
|
|
|
$template->assign('U_UPDATES', $link_start.'updates');
|
|
|
|
}
|
|
|
|
|
2012-01-14 22:29:10 +00:00
|
|
|
if ($conf['activate_comments'])
|
|
|
|
{
|
2013-10-22 20:39:10 +00:00
|
|
|
$template->assign('U_COMMENTS', $link_start.'comments');
|
|
|
|
|
|
|
|
// pending comments
|
|
|
|
$query = '
|
|
|
|
SELECT COUNT(*)
|
|
|
|
FROM '.COMMENTS_TABLE.'
|
|
|
|
WHERE validated=\'false\'
|
|
|
|
;';
|
|
|
|
list($nb_comments) = pwg_db_fetch_row(pwg_query($query));
|
|
|
|
|
|
|
|
if ($nb_comments > 0)
|
|
|
|
{
|
|
|
|
$template->assign('NB_PENDING_COMMENTS', $nb_comments);
|
2016-10-07 14:30:54 +02:00
|
|
|
$page['nb_pending_comments'] = $nb_comments;
|
2013-10-22 20:39:10 +00:00
|
|
|
}
|
2012-01-14 22:29:10 +00:00
|
|
|
}
|
2006-02-28 01:13:16 +00:00
|
|
|
|
2012-07-25 11:45:08 +00:00
|
|
|
// any photo in the caddie?
|
|
|
|
$query = '
|
|
|
|
SELECT COUNT(*)
|
|
|
|
FROM '.CADDIE_TABLE.'
|
|
|
|
WHERE user_id = '.$user['id'].'
|
|
|
|
;';
|
|
|
|
list($nb_photos_in_caddie) = pwg_db_fetch_row(pwg_query($query));
|
|
|
|
|
|
|
|
if ($nb_photos_in_caddie > 0)
|
|
|
|
{
|
|
|
|
$template->assign(
|
|
|
|
array(
|
|
|
|
'NB_PHOTOS_IN_CADDIE' => $nb_photos_in_caddie,
|
2013-10-10 11:07:45 +00:00
|
|
|
'U_CADDIE' => $link_start.'batch_manager&filter=prefilter-caddie',
|
2012-07-25 11:45:08 +00:00
|
|
|
)
|
|
|
|
);
|
2021-01-18 15:18:40 +00:00
|
|
|
} else {
|
|
|
|
$template->assign(
|
|
|
|
array(
|
|
|
|
'NB_PHOTOS_IN_CADDIE' => 0,
|
|
|
|
'U_CADDIE' => '',
|
|
|
|
)
|
|
|
|
);
|
2012-07-25 11:45:08 +00:00
|
|
|
}
|
|
|
|
|
2019-01-22 10:26:52 +01:00
|
|
|
// any photos with no md5sum ?
|
2019-10-14 14:14:54 +02:00
|
|
|
if (in_array($page['page'], array('site_update', 'batch_manager')))
|
2019-01-22 10:26:52 +01:00
|
|
|
{
|
2019-10-14 14:14:54 +02:00
|
|
|
$nb_no_md5sum = count(get_photos_no_md5sum());
|
|
|
|
|
|
|
|
if ($nb_no_md5sum > 0)
|
|
|
|
{
|
|
|
|
$page['no_md5sum_number'] = $nb_no_md5sum;
|
|
|
|
}
|
2019-01-22 10:26:52 +01:00
|
|
|
}
|
|
|
|
|
2022-11-22 12:23:12 +01:00
|
|
|
// only calculate number of orphans on all pages if the number of images is "not huge"
|
|
|
|
$page['nb_orphans'] = 0;
|
2015-10-09 19:13:30 +02:00
|
|
|
|
2022-11-22 12:23:12 +01:00
|
|
|
list($page['nb_photos_total']) = pwg_db_fetch_row(pwg_query('SELECT COUNT(*) FROM '.IMAGES_TABLE));
|
|
|
|
if ($page['nb_photos_total'] < 100000) // 100k is already a big gallery
|
2015-10-09 19:13:30 +02:00
|
|
|
{
|
2023-10-06 15:03:22 +02:00
|
|
|
$page['nb_orphans'] = count_orphans();
|
2015-10-09 19:13:30 +02:00
|
|
|
}
|
|
|
|
|
2022-11-22 12:23:12 +01:00
|
|
|
$template->assign(
|
|
|
|
array(
|
|
|
|
'NB_ORPHANS' => $page['nb_orphans'],
|
|
|
|
'U_ORPHANS' => $link_start.'batch_manager&filter=prefilter-no_album',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2005-06-11 14:10:04 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
2011-02-24 14:08:11 +00:00
|
|
|
// | Refresh permissions |
|
2005-06-11 14:10:04 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
2005-08-17 14:25:38 +00:00
|
|
|
|
2007-04-07 21:49:38 +00:00
|
|
|
// Only for pages witch change permissions
|
2007-04-11 00:49:45 +00:00
|
|
|
if (
|
|
|
|
in_array($page['page'],
|
|
|
|
array(
|
|
|
|
'site_manager', // delete site
|
|
|
|
'site_update', // ?only POST
|
|
|
|
)
|
|
|
|
)
|
2011-02-08 20:33:40 +00:00
|
|
|
or ( !empty($_POST) and in_array($page['page'],
|
2011-01-18 20:57:36 +00:00
|
|
|
array(
|
2012-02-19 19:59:22 +00:00
|
|
|
'album', // public/private; lock/unlock, permissions
|
2022-02-14 16:01:08 +01:00
|
|
|
'albums',
|
2013-12-16 20:18:56 +00:00
|
|
|
'cat_options', // public/private; lock/unlock
|
2011-02-08 20:33:40 +00:00
|
|
|
'user_list', // group assoc; user level
|
2013-12-16 20:18:56 +00:00
|
|
|
'user_perm',
|
2011-01-18 20:57:36 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2007-04-11 00:49:45 +00:00
|
|
|
)
|
2007-04-07 21:49:38 +00:00
|
|
|
{
|
2007-04-26 01:59:39 +00:00
|
|
|
invalidate_user_cache();
|
2007-04-07 21:49:38 +00:00
|
|
|
}
|
|
|
|
|
2024-11-08 16:35:27 +01:00
|
|
|
$show_whats_new = false;
|
|
|
|
|
|
|
|
$whats_new_major_version = get_branch_from_version(PHPWG_VERSION);
|
|
|
|
|
|
|
|
if (userprefs_get_param('show_whats_new_'.$whats_new_major_version, true) and pwg_is_dbconf_writeable())
|
|
|
|
{
|
|
|
|
if ($user['registration_date'] > $conf['last_major_update'])
|
|
|
|
{
|
|
|
|
userprefs_update_param('show_whats_new_'.$whats_new_major_version, false);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// purge old whats_new_*
|
|
|
|
if (isset($user['preferences']))
|
|
|
|
{
|
|
|
|
$userprefs_params_to_delete = array();
|
|
|
|
|
|
|
|
foreach (array_keys($user['preferences']) as $pref_param)
|
|
|
|
{
|
|
|
|
if (preg_match('/^whats_new_/', $pref_param))
|
|
|
|
{
|
|
|
|
$userprefs_params_to_delete[] = $pref_param;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (count($userprefs_params_to_delete) > 0)
|
|
|
|
{
|
|
|
|
userprefs_delete_param($userprefs_params_to_delete);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$show_whats_new = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$release_note_url = PHPWG_URL.'/releases/'.$whats_new_major_version.'.0.0';
|
|
|
|
|
|
|
|
$whats_new_imgs = array(
|
|
|
|
'1' =>'https://ressources.piwigo.com/uploads/c/v/7/cv7jpz6hf8//2024/11/07/20241107171642-58ded6af.png',
|
|
|
|
'2' =>'https://ressources.piwigo.com/uploads/c/v/7/cv7jpz6hf8//2024/11/07/20241107171642-9d651969.png',
|
|
|
|
'3' =>'https://ressources.piwigo.com/uploads/c/v/7/cv7jpz6hf8//2024/11/07/20241107171643-d659d017.png',
|
|
|
|
'4' =>'https://ressources.piwigo.com/uploads/c/v/7/cv7jpz6hf8//2024/11/07/20241107171642-1109101f.png',
|
|
|
|
);
|
|
|
|
|
|
|
|
$display_bell = false;
|
|
|
|
if (strtotime($conf['last_major_update']) > strtotime('1 month ago'))
|
|
|
|
{
|
|
|
|
$display_bell = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
$template->assign(
|
|
|
|
array(
|
|
|
|
'SHOW_WHATS_NEW' => $show_whats_new,
|
|
|
|
'WHATS_NEW_MAJOR_VERSION' => $whats_new_major_version,
|
|
|
|
'RELEASE_NOTE_URL' => $release_note_url,
|
|
|
|
'WHATS_NEW_IMGS' => $whats_new_imgs,
|
|
|
|
'DISPLAY_BELL' => $display_bell,
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2011-02-24 14:08:11 +00:00
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | Include specific page |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
2014-06-02 07:55:46 +00:00
|
|
|
trigger_notify('loc_begin_admin_page');
|
2011-02-24 14:08:11 +00:00
|
|
|
include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php');
|
|
|
|
|
|
|
|
$template->assign('ACTIVE_MENU', get_active_menu($page['page']));
|
|
|
|
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | Sending html code |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
|
|
|
|
// Add the Piwigo Official menu
|
|
|
|
$template->assign( 'pwgmenu', pwg_URL() );
|
|
|
|
|
|
|
|
include(PHPWG_ROOT_PATH.'include/page_header.php');
|
|
|
|
|
2014-06-02 07:55:46 +00:00
|
|
|
trigger_notify('loc_end_admin');
|
2011-02-24 14:08:11 +00:00
|
|
|
|
2013-02-07 21:17:08 +00:00
|
|
|
flush_page_messages();
|
2012-10-04 16:03:25 +00:00
|
|
|
|
2011-02-24 14:08:11 +00:00
|
|
|
$template->pparse('admin');
|
|
|
|
|
2007-04-26 01:59:39 +00:00
|
|
|
include(PHPWG_ROOT_PATH.'include/page_tail.php');
|
2024-11-08 16:35:27 +01:00
|
|
|
|
2004-02-11 23:20:38 +00:00
|
|
|
?>
|