[1116] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
[8728] | 3 | // | Piwigo - a PHP based photo gallery | |
---|
[2297] | 4 | // +-----------------------------------------------------------------------+ |
---|
[26461] | 5 | // | Copyright(C) 2008-2014 Piwigo Team http://piwigo.org | |
---|
[2297] | 6 | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | |
---|
| 7 | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | |
---|
| 8 | // +-----------------------------------------------------------------------+ |
---|
| 9 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 10 | // | it under the terms of the GNU General Public License as published by | |
---|
| 11 | // | the Free Software Foundation | |
---|
| 12 | // | | |
---|
| 13 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 14 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 15 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 16 | // | General Public License for more details. | |
---|
| 17 | // | | |
---|
| 18 | // | You should have received a copy of the GNU General Public License | |
---|
| 19 | // | along with this program; if not, write to the Free Software | |
---|
| 20 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 21 | // | USA. | |
---|
| 22 | // +-----------------------------------------------------------------------+ |
---|
[1116] | 23 | |
---|
| 24 | |
---|
[1851] | 25 | //--------------------------------------------------------------------- include |
---|
[1116] | 26 | define('PHPWG_ROOT_PATH','./'); |
---|
| 27 | include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); |
---|
[2325] | 28 | check_status(ACCESS_FREE); |
---|
[1116] | 29 | include_once(PHPWG_ROOT_PATH.'include/functions_notification.inc.php'); |
---|
| 30 | include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); |
---|
| 31 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
| 32 | include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php'); |
---|
| 33 | // Translations are in admin file too |
---|
[2126] | 34 | load_language('admin.lang'); |
---|
[1699] | 35 | // Need to update a second time |
---|
[28587] | 36 | trigger_notify('loading_lang'); |
---|
[8722] | 37 | load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) ); |
---|
[1116] | 38 | |
---|
[1699] | 39 | |
---|
[1116] | 40 | // +-----------------------------------------------------------------------+ |
---|
| 41 | // | Main | |
---|
| 42 | // +-----------------------------------------------------------------------+ |
---|
| 43 | if (isset($_GET['subscribe']) |
---|
| 44 | and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['subscribe'])) |
---|
| 45 | { |
---|
[1806] | 46 | subscribe_notification_by_mail(false, array($_GET['subscribe'])); |
---|
[1116] | 47 | } |
---|
[25018] | 48 | else if (isset($_GET['unsubscribe']) |
---|
[1116] | 49 | and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['unsubscribe'])) |
---|
| 50 | { |
---|
[1806] | 51 | unsubscribe_notification_by_mail(false, array($_GET['unsubscribe'])); |
---|
[1116] | 52 | } |
---|
| 53 | else |
---|
| 54 | { |
---|
[25018] | 55 | $page['errors'][] = l10n('Unknown identifier'); |
---|
[1116] | 56 | } |
---|
| 57 | |
---|
| 58 | // +-----------------------------------------------------------------------+ |
---|
[1118] | 59 | // | template initialization | |
---|
[1116] | 60 | // +-----------------------------------------------------------------------+ |
---|
[5021] | 61 | $title = l10n('Notification'); |
---|
[1118] | 62 | $page['body_id'] = 'theNBMPage'; |
---|
[1116] | 63 | |
---|
[1118] | 64 | $template->set_filenames(array('nbm'=>'nbm.tpl')); |
---|
| 65 | |
---|
[12764] | 66 | |
---|
[10812] | 67 | // include menubar |
---|
| 68 | $themeconf = $template->get_template_vars('themeconf'); |
---|
[10824] | 69 | if (!isset($themeconf['hide_menu_on']) OR !in_array('theNBMPage', $themeconf['hide_menu_on'])) |
---|
[10812] | 70 | { |
---|
| 71 | include( PHPWG_ROOT_PATH.'include/menubar.inc.php'); |
---|
| 72 | } |
---|
[1116] | 73 | |
---|
[1118] | 74 | // +-----------------------------------------------------------------------+ |
---|
| 75 | // | html code display | |
---|
| 76 | // +-----------------------------------------------------------------------+ |
---|
[10812] | 77 | include(PHPWG_ROOT_PATH.'include/page_header.php'); |
---|
[20609] | 78 | flush_page_messages(); |
---|
[1118] | 79 | $template->parse('nbm'); |
---|
| 80 | include(PHPWG_ROOT_PATH.'include/page_tail.php'); |
---|
[2278] | 81 | ?> |
---|