Esempio n. 1
0
if( ! is_object( @$xoopsUser ) || ! $moduleperm_handler->checkRight( 'module_admin' , $mid , $xoopsUser->getGroups() ) ) {
	die( 'Only administrator can use this feature.' ) ;
}

$iserror = 0 ;
$broken = $message = $errors = array() ;
$error_message = '' ;

// GET BROKEN LIST
$broken_download = new broken_download( $mydirname ) ;
$broken_sum = $broken_download->Total_Num();
$total_num4assign = ! empty( $broken_sum ) ? intval( $broken_sum ) : 0 ;
$total_broken4assign = sprintf( _MD_D3DOWNLOADS_BROKENNUM , $total_num4assign ) ;
$broken = $broken_download->get_broken_data();

$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 );
Esempio n. 2
0
<?php

require_once dirname( dirname(__FILE__) ).'/class/broken_download.php' ;

$broken_report = new broken_report( $mydirname ) ;
$broken_report->broken_check_by_cron() ;

?>
Esempio n. 3
0
require_once dirname( dirname(__FILE__) ).'/class/broken_download.php' ;
require_once dirname( dirname(__FILE__) ).'/class/post_check.php' ;
require_once dirname( dirname(__FILE__) ).'/class/spam_check.php' ;
require_once dirname( dirname(__FILE__) ).'/include/common_functions.php' ;
require_once dirname( dirname(__FILE__) ).'/include/transact_functions.php' ;
require_once dirname( dirname(__FILE__) ).'/include/broken_file_rules.inc.php' ;

$xoopsOption['template_main'] = $mydirname.'_main_brokenfile.html';

$report = $errors = array() ;
$error_message = $liveValidator = '' ;

$cid = ! empty( $_GET['cid'] ) ? intval( $_GET['cid'] ) : 0 ;
$lid = ! empty( $_GET['lid'] ) ? intval( $_GET['lid'] ) : 0 ;

$broken_report = new broken_report( $mydirname ) ;
$user_access   = new user_access( $mydirname ) ;
$liveform      = new My_MassValidatePHP( 'brokenreport', $_POST ) ;
$spam_check    = new spam_check( $mydirname ) ;

$whr_cat = "cid IN (".implode(",", $user_access->can_read() ).")" ;
$whr_cat4read = "d.".$whr_cat ;

$bc[0] = d3download_breadcrumbs( $mydirname ) ;
$breadcrumbs = array_merge( $bc ,d3download_breadcrumbs_tree( $mydirname, $cid, $whr_cat, '', 1 ) ) ;
$download4assign = d3download_get_title( $mydirname, $lid, $whr_cat4read ) ;
$title4assign = $download4assign['title'] ;
$breadcrumbs[] = array( 'name' => $title4assign ) ;

$liveformrules = $formRules['brokenreport'] ;
$liveform->addRules( $liveformrules ) ;
Esempio n. 4
0
<?php

require_once dirname( dirname(__FILE__) ).'/class/gtickets.php' ;
require_once dirname( dirname(__FILE__) ).'/class/broken_download.php' ;

$broken_report = new broken_report( $mydirname ) ;

// THIS PAGE CAN BE CALLED ONLY FROM D3DOWNLOADS
if( $xoopsModule->getVar('dirname') != $mydirname ) die( 'this page can be called only from '.$mydirname ) ;

// PERMISSION ERROR
$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&amp;cid=$cid&amp;lid=$lid" , 2 , $error ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE , $error ) : _MD_D3DOWNLOADS_BROKENDELETED ) ;
Esempio n. 5
0
} elseif ( ! is_dir( $upload_dir ) ) {
	if( $safe_mode ) {
		echo '<br /><span style="color:red;font-weight:bold;padding-left:1em;">'._MD_D3DOWNLOADS_UPLOADDIR_NOT_IS_DIR.'</span>';
	} elseif ( ! mkdir( $upload_dir , 0777 ) ) {
		echo '<br /><span style="color:red;font-weight:bold;padding-left:1em;">'._MD_D3DOWNLOADS_UPLOADDIR_NOT_MKDIR.'</span>';
	}
} elseif ( ! is_writeable( $upload_dir ) ) {
	if( ! chmod( $upload_dir , 0777 ) ) {
		echo '<br /><span style="color:red;font-weight:bold;padding-left:1em;">'._MD_D3DOWNLOADS_UPLOADDIR_NOT_IS_WRITEABLE.'</span>';
	}
} else {
	echo '<span style="color:green;font-weight:bold;padding-left:1em;">OK</span></li>';
}
if( is_dir( $upload_dir ) ) {
	require_once dirname( dirname(__FILE__) ).'/class/broken_download.php' ;
	$broken_report = new broken_report( $mydirname ) ;
	$filecount = $broken_report->File_Count();
	$nolinkfile = $filecount['nolink'];
	$totalfile = $filecount['total'];
	echo '<li>'._MD_D3DOWNLOADS_NOLINK_CHECK.'<span style="color:green;font-weight:bold;padding-left:1em;">'.$nolinkfile.' Files ( total '.$totalfile.' Files )</span>';
}

echo '</ul>';

// cachedir_check
echo '<li>'._MD_D3DOWNLOADS_CACHEDIR_CHECK ;
echo '<ul style="margin-left:2em">';
$cache_dir = XOOPS_TRUST_PATH.'/cache/' ;
echo '<li>'._MD_D3DOWNLOADS_CACHEDIR_CONFIFG.'<span style="padding-left:1em">'.$cache_dir.'</span>';
if( ! is_dir( $cache_dir ) ) {
	if( $safe_mode ) {
Esempio n. 6
0
	$pagetitle4assign = $xoopsModule->getVar('name') ;

	// 全体登録件数を取得
	$total = $mydownload->Total_Num( $whr_cat ) ;
	$total_num = sprintf( _MD_D3DOWNLOADS_TOTAL_NUM , $total ) ;

	if( $module_admin ){
		include_once dirname( dirname(__FILE__) ).'/class/broken_download.php' ;
		$broken_download = new broken_download( $mydirname ) ;
		// 破損報告件数をアサイン
		$broken_num = $broken_download->Broken_Num() ;
		$xoopsTpl->assign( 'broken_num' , $broken_num['num']  ) ;
		$xoopsTpl->assign( 'broken_link' , $broken_num['link']  ) ;
		// アップロードファイル破損チェック
		if( ! empty( $_POST['brokencheck'] ) ) {
			$broken_report = new broken_report( $mydirname ) ;
			$broken_report->broken_check() ;
		}
		// 承認待ち件数をアサイン
		include_once dirname( dirname(__FILE__) ).'/class/unapproval_download.php' ;
		$unapproval_download = new unapproval_download( $mydirname ) ;
		$unapproval_num = $unapproval_download->Unapproval_Num() ;
		$xoopsTpl->assign( 'unapproval_num' , $unapproval_num['num']  ) ;
		$xoopsTpl->assign( 'unapproval_link' , $unapproval_num['link']  ) ;
	}
}

// ページナビなどをアサイン
if( ! empty( $cid ) || ! empty( $mypost ) ){
	$perpage4assign = d3download_items_perpage() ;
	$select_perpage = d3download_select_perpage( $mydirname ) ;