Beispiel #1
0
$permissions = $downdata = $category = $select_platform = $select_license = $img_ar = $history4assign = $liveformErrors = $copy_select = array() ;
$shots_help =  $preview_title = $preview_body = $error_message =  '' ;

if( ! empty( $_GET['cid'] ) ) $cid = intval( $_GET['cid'] ) ;
elseif( ! empty( $_POST['cid'] ) ) $cid = intval( $_POST['cid'] ) ;

// 登録は CID の指定を必要とします
if( empty( $cid ) ){
	redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/index.php',3, _MD_D3DOWNLOADS_NO_CID );
	exit();
}

// 編集権限をチェック(管理者は除く)
$user_access = new user_access( $mydirname ) ;
$whr_cat4edit = "cid IN (".implode(",", $user_access->can_edit() ).")" ;
$permissions = $user_access->permissions_of_current_user( $cid ) ;
$can_edit = $permissions['can_edit'] ;
if( empty( $can_edit ) ) {
	redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/',3, _MD_D3DOWNLOADS_NOEDITTPERM );
	exit();
}

// 自動承認のチェック(管理者は除く)
$auto_approved = $permissions['edit_approved'] ;

// HTML許可のチェック(登録ユーザー以外は HTMLを無効とする)
$canhtml = $permissions['can_html'] ;

// アップロード許可のチェック
$canupload = $permissions['can_upload'] ;