/** * Deletes a user log * * @param int $id * @param UserTable $user */ private function deleteLog( $id, $user ) { global $_CB_framework; $row = new cbantispamLogTable(); $row->load( (int) $id ); $profileUrl = $_CB_framework->userProfileUrl( (int) $user->get( 'id' ), false, $this->_tab ); if ( ! $row->get( 'id' ) ) { cbRedirect( $profileUrl, CBTxt::T( 'Not authorized.' ), 'error' ); } if ( ! $row->delete() ) { cbRedirect( $profileUrl, CBTxt::T( 'LOG_DELETE_FAILED', 'Log failed to delete! Error: [error]', array( '[error]' => $row->getError() ) ), 'error' ); } cbRedirect( $profileUrl, CBTxt::T( 'Log deleted successfully!' ) ); }