diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-06-09 16:34:40 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-06-09 16:34:40 +0000 |
commit | bcad40a05ab2dc2a341a3227e30b96668bce4500 (patch) | |
tree | 6fca27588d53a1b24705bd2834e9e643bb729bd1 /admin/access.php | |
download | ampache-bcad40a05ab2dc2a341a3227e30b96668bce4500.tar.gz ampache-bcad40a05ab2dc2a341a3227e30b96668bce4500.tar.bz2 ampache-bcad40a05ab2dc2a341a3227e30b96668bce4500.zip |
New Import
Diffstat (limited to 'admin/access.php')
-rw-r--r-- | admin/access.php | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/admin/access.php b/admin/access.php new file mode 100644 index 00000000..31793907 --- /dev/null +++ b/admin/access.php @@ -0,0 +1,85 @@ +<?php +/* + + Copyright (c) 2001 - 2005 Ampache.org + All rights reserved. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +require('../modules/init.php'); + + +/* Scrub in the Needed vars */ +$action = scrub_in($_REQUEST['action']); +$access_id = scrub_in($_REQUEST['access_id']); +$access = new Access($access_id); + +if (!$user->has_access(100)) { + header("Location: http://" . conf('web_path') . "/index.php?access=denied"); + exit(); +} + + +show_template('header'); + +show_menu_items('Admin'); +show_admin_menu('Access Lists'); +show_clear(); +if ( $action == 'show_confirm_delete' ) { + show_confirm_action(_("Do you really want to delete this Access Record?"), "admin/access.php", "access_id=" . $_REQUEST['access_id'] . "&action=delete_host"); +} +/*! + @action delete_host + @discussion deletes an access list entry +*/ +elseif ( $action == 'delete_host' ) { + $access->delete($_REQUEST['access_id']); + show_confirmation(_("Entry Deleted"),_("Your Access List Entry has been removed"),"admin/access.php"); + +} // delete_host +/*! + @action add_host + @discussion add a new access list entry +*/ +elseif ($action == 'add_host') { + + $access->create($_REQUEST['name'], $_REQUEST['start'],$_REQUEST['end'],$_REQUEST['level']); + show_confirmation(_("Entry Added"),_("Your new Access List Entry has been created"),"admin/access.php"); + +} // add_host +/*! + @action show_add_host + @discussion show the add host box +*/ +elseif ( $action == 'show_add_host' ) { + include(conf('prefix') . "/templates/show_add_access.inc"); +} +else { + $list = array(); + $list = $access->get_access_list(); + include(conf('prefix') ."/templates/show_access_list.inc"); +} +echo "<br /><br />"; + +show_admin_menu('Access Lists'); +show_menu_items('Admin'); + +?> + + +</body> +</html> |