| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | |
|---|
| 4 | Copyright (c) Ampache.org |
|---|
| 5 | All rights reserved. |
|---|
| 6 | |
|---|
| 7 | This program is free software; you can redistribute it and/or |
|---|
| 8 | modify it under the terms of the GNU General Public License v2 |
|---|
| 9 | as published by the Free Software Foundation |
|---|
| 10 | |
|---|
| 11 | This program is distributed in the hope that it will be useful, |
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | GNU General Public License for more details. |
|---|
| 15 | |
|---|
| 16 | You should have received a copy of the GNU General Public License |
|---|
| 17 | along with this program; if not, write to the Free Software |
|---|
| 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 19 | |
|---|
| 20 | */ |
|---|
| 21 | require_once 'lib/init.php'; |
|---|
| 22 | |
|---|
| 23 | show_header(); |
|---|
| 24 | |
|---|
| 25 | // Switch on the incomming action |
|---|
| 26 | switch ($_REQUEST['action']) { |
|---|
| 27 | case 'add_shout': |
|---|
| 28 | // Must be at least a user to do this |
|---|
| 29 | if (!Access::check('interface','25')) { |
|---|
| 30 | access_denied(); |
|---|
| 31 | exit; |
|---|
| 32 | } |
|---|
| 33 | $shout_id = shoutBox::create($_POST); |
|---|
| 34 | header("Location:" . Config::get('web_path')); |
|---|
| 35 | break; |
|---|
| 36 | case 'show_add_shout': |
|---|
| 37 | // Get our object first |
|---|
| 38 | $object = shoutBox::get_object($_REQUEST['type'],$_REQUEST['id']); |
|---|
| 39 | |
|---|
| 40 | if (!$object->id) { |
|---|
| 41 | Error::add('general',_('Invalid Object Selected')); |
|---|
| 42 | Error::display('general'); |
|---|
| 43 | break; |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | // Now go ahead and display the page where we let them add a comment etc |
|---|
| 47 | require_once Config::get('prefix') . '/templates/show_add_shout.inc.php'; |
|---|
| 48 | break; |
|---|
| 49 | default: |
|---|
| 50 | header("Location:" . Config::get('web_path')); |
|---|
| 51 | break; |
|---|
| 52 | } // end switch on action |
|---|
| 53 | |
|---|
| 54 | show_footer(); |
|---|
| 55 | ?> |
|---|