- Moderated by:
- Support
-
- rank:
-
Legend
- registered:
- December 1969
- Status:
- offline
- last visit:
- 01.12.08
- Posts:
- 6534
For some reason, when confirmed, this is not sending the value of $asn through. It's showing fine when it's first loaded, but not passing through on confirm..
Code
function pnSerialTracker_user_delete( $args )
{
list( $asn, $confirmation ) = pnVarCleanFromInput( 'asn', 'confirmation' );
extract( $args );
$output = new pnHTML();
$output->SetInputMode( _PNH_VERBATIMINPUT );
$output->Text( pnSerialTracker_usermenu() );
$output->SetInputMode( _PNH_PARSEINPUT );
if ( !pnModAPILoad( 'pnSerialTracker', 'user' ) )
{
pnSessionSetVar( 'errormsg', _LOADFAILED );
return $output->GetOutput();
}
if ( empty( $confirmation ) )
{
$output->Title( _PNSTDELETEITEM );
$output->ConfirmAction( _PNSTSURE . $asn ,
pnModURL( 'pnSerialTracker',
'user',
'delete ' ),
_CANCELITEMDELETE,
pnModURL( 'pnSerialTracker',
'user',
'do_search',
array( 'loc' => 1,
'term' => pnUserGetVar( uname ) )
) );
return $output->GetOutput();
}
if ( !pnModAPILoad( 'pnSerialTracker', 'user' ) )
{
$output->Text( _LOADFAILED );
return $output->GetOutput();
}
if ( pnModAPIFunc( 'pnSerialTracker',
'user',
'delete_item',
array( 'asn' => $asn ) ) )
{
pnSessionSetVar( 'statusmsg', _PNSTITEMDELETED );
}
pnRedirect( pnModURL( 'pnSerialTracker',
'user',
'do_search',
array( 'loc' => 1,
'term' => pnUserGetVar( uname ) )
) );
return true;
} -
- rank:
-
Helper
- registered:
- January 2004
- Status:
- offline
- last visit:
- 22.02.08
- Posts:
- 381
I have no clue what this module is, but the first thing I would ask is why you are loading the API twice. Then I would want to look at the code that called the user_delete function to see if it is passing a value for asn that is overwriting the value that you get from pnVarCleanFromInput() when you do the extract($args); Then I would want to see the delete_item function to make sure that it wasn't that function that was losing the value.
Right off hand it looks like this function should work.
-Chris -
- rank:
-
Helper
- registered:
- January 2004
- Status:
- offline
- last visit:
- 22.02.08
- Posts:
- 381
