$broken_report = new broken_report( $mydirname ) ; // BROKEN DATA UPDATE if( ! empty( $_POST['brokenmanager_update'] ) ) { if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) { redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors()) ; } if( empty( $_POST['brokendel'] ) ) $message[] = _MD_D3DOWNLOADS_ERROR_SEL_REPORT ; if( ! empty( $message ) ){ $iserror = 1 ; $error_message = implode( '<br />' , $message ) ; } if( empty( $iserror ) ) { foreach( $_POST['brokendel'] as $id => $value ) { $lid = intval( $id ) ; $result = $broken_report->Delete_Report_by_select_lid( $lid ); if( ! empty( $result ) ) $errors[] = $lid ; } redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=brokenmanager" , 2 , $errors ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE , implode( ',' , $errors ) ) : _MD_D3DOWNLOADS_BROKENDELETED ) ; exit() ; } } // DELETE if( ! empty( $_POST['delete'] ) ) { if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) { redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors()) ; } if( empty( $_POST['action_selects'] ) ) $message[] = _MD_D3DOWNLOADS_ERROR_SEL_FILSE ; if( ! empty( $message ) ){ $iserror = 1 ;
$module_handler =& xoops_gethandler( 'module' ) ; $module =& $module_handler->getByDirname( $mydirname ) ; $moduleperm_handler =& xoops_gethandler( 'groupperm' ) ; $mid = $module->getVar('mid') ; if( ! is_object( @$xoopsUser ) || ! $moduleperm_handler->checkRight( 'module_admin' , $mid , $xoopsUser->getGroups() ) ) { die( 'Only administrator can use this feature.' ) ; } if( ! empty( $_POST['delbroken_post']) ){ if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) { redirect_header( XOOPS_URL."/modules/$mydirname/" , 3 , $xoopsGTicket->getErrors() ); } $cid = isset( $_POST['cid'] ) ? intval( $_POST['cid'] ) : 0 ; $lid = isset( $_POST['lid'] ) ? intval( $_POST['lid'] ) : 0 ; $error = 0 ; if( ! empty( $lid ) ) { $error = $broken_report->Delete_Report_by_select_lid( $lid ) ; redirect_header( XOOPS_URL."/modules/$mydirname/index.php?page=modfile&cid=$cid&lid=$lid" , 2 , $error ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE , $error ) : _MD_D3DOWNLOADS_BROKENDELETED ) ; exit(); } else { redirect_header( XOOPS_URL."/modules/$mydirname/index.php?page=modfile&cid=$cid&lid=$lid" , 2 , _MD_D3DOWNLOADS_NONDELETED ) ; exit(); } } else { redirect_header( XOOPS_URL."/modules/$mydirname/index.php?page=modfile&cid=$cid&lid=$lid" , 2 , _MD_D3DOWNLOADS_NONDELETED ) ; exit(); } ?>