// Will EXIT // We have EXITed already at this point!! } break; case 'delete': // Delete file type: // Check that this action request is not a CSRF hacked request: $Session->assert_received_crumb('filetype'); // Check permission: $current_User->check_perm('options', 'edit', true); // Make sure we got an ftyp_ID: param('ftyp_ID', 'integer', true); if (param('confirm', 'integer', 0)) { // confirmed, Delete from DB: $msg = sprintf(T_('File type «%s» deleted.'), $edited_Filetype->dget('name')); $edited_Filetype->dbdelete(true); unset($edited_Filetype); forget_param('ftyp_ID'); $Messages->add($msg, 'success'); $action = 'list'; // Redirect so that a reload doesn't write to the DB twice: header_redirect('?ctrl=filetypes', 303); // Will EXIT // We have EXITed already at this point!! } else { // not confirmed, Check for restrictions: if (!$edited_Filetype->check_delete(sprintf(T_('Cannot delete file type «%s»'), $edited_Filetype->dget('name')))) { // There are restrictions: $action = 'view'; } }
// Will EXIT // We have EXITed already at this point!! } break; case 'delete': // Delete file type: // Check that this action request is not a CSRF hacked request: $Session->assert_received_crumb('filetype'); // Check permission: $current_User->check_perm('options', 'edit', true); // Make sure we got an ftyp_ID: param('ftyp_ID', 'integer', true); if (param('confirm', 'integer', 0)) { // confirmed, Delete from DB: $msg = sprintf(T_('File type «%s» deleted.'), $edited_Filetype->dget('name')); $edited_Filetype->dbdelete(); unset($edited_Filetype); forget_param('ftyp_ID'); $Messages->add($msg, 'success'); $action = 'list'; // Redirect so that a reload doesn't write to the DB twice: header_redirect('?ctrl=filetypes', 303); // Will EXIT // We have EXITed already at this point!! } else { // not confirmed, Check for restrictions: if (!$edited_Filetype->check_delete(sprintf(T_('Cannot delete file type «%s»'), $edited_Filetype->dget('name')))) { // There are restrictions: $action = 'view'; } }