diff options
author | Paul Arthur <flowerysong00@yahoo.com> | 2012-05-01 15:49:36 -0400 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2012-05-01 15:56:55 -0400 |
commit | 17562c8843a853f0248a97e156b6f616dd4db574 (patch) | |
tree | d799d9df9cf08a4715d1a3aa17c483f3f9e873b2 /admin | |
parent | 5f2f81fa8fe4d111b3f818be84f899f74645308d (diff) | |
download | ampache-17562c8843a853f0248a97e156b6f616dd4db574.tar.gz ampache-17562c8843a853f0248a97e156b6f616dd4db574.tar.bz2 ampache-17562c8843a853f0248a97e156b6f616dd4db574.zip |
Clean up the ACL UI a bit
Make it more consistent and remove outdated references to RPC keys.
Diffstat (limited to 'admin')
-rw-r--r-- | admin/access.php | 72 |
1 files changed, 15 insertions, 57 deletions
diff --git a/admin/access.php b/admin/access.php index 154d277a..b2caf1ef 100644 --- a/admin/access.php +++ b/admin/access.php @@ -59,64 +59,27 @@ switch ($_REQUEST['action']) { exit; } - // We need to pre-process this a little bit as stuff is coming in from all over - switch ($_GET['method']) { - case 'advanced': - Access::create($_POST); - break; - case 'local': - $_POST['type'] = 'network'; - Access::create($_POST); + Access::create($_POST); - // Create Additional stuff based on the type - if ($_POST['addtype'] == 'streamnetwork' OR $_POST['addtype'] == 'allnetwork') { - $_POST['type'] = 'stream'; - Access::create($_POST); - } - if ($_POST['addtype'] == 'allnetwork') { - $_POST['type'] = 'interface'; - Access::create($_POST); - } - break; - case 'current': - $_POST['start'] = $_SERVER['REMOTE_ADDR']; - $_POST['end'] = $_SERVER['REMOTE_ADDR']; - $_POST['type'] = 'interface'; - Access::create($_POST); - $_POST['type'] = 'stream'; - Access::create($_POST); - break; - case 'rpc': - $_POST['type'] = 'rpc'; - Access::create($_POST); - - // Create Additional stuff based on the type - if ($_POST['addtype'] == 'streamrpc' OR $_POST['addtype'] == 'allrpc') { - $_POST['type'] = 'stream'; - Access::create($_POST); - } - if ($_POST['addtype'] == 'allrpc') { - $_POST['type'] = 'interface'; - Access::create($_POST); - } - break; - default: - // Do nothing they f'ed something up - break; - } // end switch on method + // Create Additional stuff based on the type + if ($_POST['addtype'] == 'stream' || + $_POST['addtype'] == 'all' + ) { + $_POST['type'] = 'stream'; + Access::create($_POST); + } + if ($_POST['addtype'] == 'all') { + $_POST['type'] = 'interface'; + Access::create($_POST); + } if (!Error::occurred()) { $url = Config::get('web_path') . '/admin/access.php'; show_confirmation(T_('Added'), T_('Your new Access Control List(s) have been created'),$url); } else { - switch ($_GET['method']) { - case 'rpc': require_once Config::get('prefix') . '/templates/show_add_access_rpc.inc.php'; break; - case 'local': require_once Config::get('prefix') . '/templates/show_add_access_local.inc.php'; break; - case 'current': require_once Config::get('prefix') . '/templates/show_add_access_current.inc.php'; break; - case 'advanced': require_once Config::get('prefix') . '/templates/show_add_access.inc.php'; break; - default: require_once Config::get('prefix') . '/templates/show_access_list.inc.php'; break; - } + $action = 'show_add_' . $_POST['type']; + require_once Config::get('prefix') . '/templates/show_add_access.inc.php'; } break; case 'update_record': @@ -135,15 +98,10 @@ switch ($_REQUEST['action']) { } break; case 'show_add_current': - require_once Config::get('prefix') . '/templates/show_add_access_current.inc.php'; - break; case 'show_add_rpc': - require_once Config::get('prefix') . '/templates/show_add_access_rpc.inc.php'; - break; case 'show_add_local': - require_once Config::get('prefix') . '/templates/show_add_access_local.inc.php'; - break; case 'show_add_advanced': + $action = $_REQUEST['action']; require_once Config::get('prefix') . '/templates/show_add_access.inc.php'; break; case 'show_edit_record': |