PDA

View Full Version : Invalid Action Specified


SeToY
22 Jul 2010, 09:24
Hey,

when i want to create an issue out of a posts, it's redirecting me to a page saying "Invalid Action Specified".

Greetings

PitchouneN64ngc
22 Jul 2010, 20:32
Already fixed for 2.1.2.

Open projectpost.php, find this:

require_once(DIR . '/includes/functions_ptimporter.php');
$threadinfo = verify_id('thread', $threadid, 1, 1);

Replace with this:

if (in_array($_REQUEST['do'], array('processimportthread', 'importthread', 'importthread2')))
{
require_once(DIR . '/includes/functions_ptimporter.php');
$threadinfo = verify_id('thread', $threadid, 1, 1);
}

chiptz
24 Jul 2010, 14:48
changed this however problem still presists.

vB 4.0.5

SeToY
16 Sep 2010, 19:56
Me2, this happens for me nevertheless i changed the lines.

My projectpost.php:

<?php
[...]

$optgroup_options = '';
foreach (array_keys($projectinfo['types']) AS $type)
{
// Check we can both view and post the target issue type
if (!($project_perms["$projectid"]["$type"]['generalpermissions'] & $vbulletin->pt_bitfields['general']['canview']) OR !($project_perms["$projectid"]["$type"]['postpermissions'] & $vbulletin->pt_bitfields['post']['canpostnew']))
{
continue;
}
$optionvalue = $projectinfo['projectid'] . '-' . $type;
$optiontitle = $vbphrase["issuetype_{$type}_singular"];
$optionselected = (($issue['issuetypeid'] == $type AND $issue['projectid'] == $projectid) ? ' selected="selected"' : '');
$optgroup_options .= render_option_template($optiontitle, $optionvalue, $optionselected, $optionclass);
}

if (empty($optgroup_options))
{
continue;
}

$optgroup_label = $projectinfo['title'];
$templater = vB_Template::create('optgroup');
$templater->register('optgroup_extra', $optgroup_extra);
$templater->register('optgroup_label', $optgroup_label);
$templater->register('optgroup_options', $optgroup_options);
$project_type_select .= $templater->render();
}

$navbits = array(
'project.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['projects'],
"project.php?" . $vbulletin->session->vars['sessionurl'] . "projectid=$project[projectid]" => $project['title_clean'],
'project.php?' . $vbulletin->session->vars['sessionurl'] . "issueid=$issue[issueid]" => $issue['title'],
'' => $vbphrase['edit_issue']
);

$navbits = construct_navbits($navbits);
$navbar = render_navbar_template($navbits);

$templater = vB_Template::create('pt_move_issue');
$templater->register_page_templates();
$templater->register('issue', $issue);
$templater->register('navbar', $navbar);
$templater->register('project', $project);
$templater->register('project_type_select', $project_type_select);
print_output($templater->render());

}

//require_once(DIR . '/includes/functions_ptimporter.php');
//$threadinfo = verify_id('thread', $threadid, 1, 1);

if (in_array($_REQUEST['do'], array('processimportthread', 'importthread', 'importthread2')))
{
require_once(DIR . '/includes/functions_ptimporter.php');
$threadinfo = verify_id('thread', $threadid, 1, 1);
}

// #######################################################################
if ($_POST['do'] == 'processimportthread')
{
$vbulletin->input->clean_array_gpc('p', array(
'projectid' => TYPE_UINT,
'issuetypeid' => TYPE_NOHTML,
'title' => TYPE_NOHTML,
'summary' => TYPE_NOHTML,
'priority' => TYPE_UINT,
'projectcategoryid' => TYPE_UINT,
'appliesversionid' => TYPE_UINT,
'addressedversionid' => TYPE_INT,
'issuestatusid' => TYPE_UINT,
'milestoneid' => TYPE_UINT
));

// Do our own checking to make sure we have all permissions needed to create issues
$project = ptimporter_verify_issuetypeid($vbulletin->GPC['issuetypeid'], $vbulletin->GPC['projectid']);
$posting_perms = ptimporter_prepare_issue_posting_pemissions($project['projectid'], $vbulletin->GPC['issuetypeid']);

// Make sure the new issue status is valid
ptimporter_verify_issuestatusid($vbulletin->GPC['issuestatusid'], $vbulletin->GPC['issuetypeid']);

// Finally, run the import
require_once(DIR . '/includes/class_ptimporter.php');

$importer = new vB_PtImporter($vbulletin, $threadinfo, $project, $posting_perms, array(), array());
$issueid = $importer->import_all();

$vbulletin->url = 'project.php?' . $vbulletin->session->vars['sessionurl'] . "issueid=$issueid";
eval(print_standard_redirect('pt_issue_inserted'));
}

// #######################################################################
if ($_REQUEST['do'] == 'importthread2')
{
$vbulletin->input->clean_array_gpc('r', array(
'project-issuetype' => TYPE_NOHTML
));

list($projectid, $issuetypeid) = explode('-', $vbulletin->GPC['project-issuetype']);

$project = verify_project($projectid);
$posting_perms = ptimporter_prepare_issue_posting_pemissions($project['projectid'], $issuetypeid);

verify_issuetypeid($issuetypeid, $project['projectid']);

$issuetype = $vbphrase["issuetype_{$issuetypeid}_singular"];

$issueperms = fetch_project_permissions($vbulletin->userinfo, $project['projectid'], $issuetypeid);

// Check we can both view and post the target issue type
if (!($issueperms['generalpermissions'] & $vbulletin->pt_bitfields['general']['canview']) OR !($issueperms['postpermissions'] & $vbulletin->pt_bitfields['post']['canpostnew']))
{
print_no_permission();
}

[...]
?>