Skip to content

Commit

Permalink
Cosmetics: death to tabs
Browse files Browse the repository at this point in the history
The refactoring I've been doing has reminded me of my strong preference
for spaces, and I feel inclined to impose my will on the tree.
  • Loading branch information
flowerysong committed Jan 26, 2013
1 parent 8a750c3 commit ef4d366
Show file tree
Hide file tree
Showing 304 changed files with 31,804 additions and 31,803 deletions.
154 changes: 77 additions & 77 deletions admin/access.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
Expand All @@ -23,91 +23,91 @@
require_once '../lib/init.php';

if (!Access::check('interface','100')) {
UI::access_denied();
exit();
UI::access_denied();
exit();
}

UI::show_header();

switch ($_REQUEST['action']) {
case 'delete_record':
if (!Core::form_verify('delete_access')) {
UI::access_denied();
exit;
}
Access::delete($_REQUEST['access_id']);
$url = Config::get('web_path') . '/admin/access.php';
show_confirmation(T_('Deleted'), T_('Your Access List Entry has been removed'),$url);
break;
case 'show_delete_record':
if (Config::get('demo_mode')) { break; }
$access = new Access($_GET['access_id']);
show_confirmation(T_('Deletion Request'), T_('Are you sure you want to permanently delete') . ' ' . $access->name,
'admin/access.php?action=delete_record&amp;access_id=' . $access->id,1,'delete_access');
break;
case 'add_host':
case 'delete_record':
if (!Core::form_verify('delete_access')) {
UI::access_denied();
exit;
}
Access::delete($_REQUEST['access_id']);
$url = Config::get('web_path') . '/admin/access.php';
show_confirmation(T_('Deleted'), T_('Your Access List Entry has been removed'),$url);
break;
case 'show_delete_record':
if (Config::get('demo_mode')) { break; }
$access = new Access($_GET['access_id']);
show_confirmation(T_('Deletion Request'), T_('Are you sure you want to permanently delete') . ' ' . $access->name,
'admin/access.php?action=delete_record&amp;access_id=' . $access->id,1,'delete_access');
break;
case 'add_host':

// Make sure we've got a valid form submission
if (!Core::form_verify('add_acl','post')) {
UI::access_denied();
exit;
}
// Make sure we've got a valid form submission
if (!Core::form_verify('add_acl','post')) {
UI::access_denied();
exit;
}

Access::create($_POST);
Access::create($_POST);

// 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);
}
// 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 {
$action = 'show_add_' . $_POST['type'];
require_once Config::get('prefix') . '/templates/show_add_access.inc.php';
}
break;
case 'update_record':
if (!Core::form_verify('edit_acl')) {
UI::access_denied();
exit;
}
$access = new Access($_REQUEST['access_id']);
$access->update($_POST);
if (!Error::occurred()) {
show_confirmation(T_('Updated'), T_('Access List Entry updated'), Config::get('web_path').'/admin/access.php');
}
else {
$access->format();
require_once Config::get('prefix') . '/templates/show_edit_access.inc.php';
}
break;
case 'show_add_current':
case 'show_add_rpc':
case 'show_add_local':
case 'show_add_advanced':
$action = $_REQUEST['action'];
require_once Config::get('prefix') . '/templates/show_add_access.inc.php';
break;
case 'show_edit_record':
$access = new Access($_REQUEST['access_id']);
$access->format();
require_once Config::get('prefix') . '/templates/show_edit_access.inc.php';
break;
default:
$list = array();
$list = Access::get_access_lists();
require_once Config::get('prefix') .'/templates/show_access_list.inc.php';
break;
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 {
$action = 'show_add_' . $_POST['type'];
require_once Config::get('prefix') . '/templates/show_add_access.inc.php';
}
break;
case 'update_record':
if (!Core::form_verify('edit_acl')) {
UI::access_denied();
exit;
}
$access = new Access($_REQUEST['access_id']);
$access->update($_POST);
if (!Error::occurred()) {
show_confirmation(T_('Updated'), T_('Access List Entry updated'), Config::get('web_path').'/admin/access.php');
}
else {
$access->format();
require_once Config::get('prefix') . '/templates/show_edit_access.inc.php';
}
break;
case 'show_add_current':
case 'show_add_rpc':
case 'show_add_local':
case 'show_add_advanced':
$action = $_REQUEST['action'];
require_once Config::get('prefix') . '/templates/show_add_access.inc.php';
break;
case 'show_edit_record':
$access = new Access($_REQUEST['access_id']);
$access->format();
require_once Config::get('prefix') . '/templates/show_edit_access.inc.php';
break;
default:
$list = array();
$list = Access::get_access_lists();
require_once Config::get('prefix') .'/templates/show_access_list.inc.php';
break;
} // end switch on action
UI::show_footer();
?>
Loading

0 comments on commit ef4d366

Please sign in to comment.