예제 #1
0
	if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) {
		redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors());
	}
	// GROUP UPDATE
	$error = $user_access->group_update( $cid ) ;
	d3download_delete_cache_of_categories( $mydirname ) ;
	redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=user_access&cid=$cid" , 2 , $error ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE , $error ) : _MD_D3DOWNLOADS_REGSTERED ) ;
	exit();
}

if( isset( $_POST['user_update'] ) ){
	if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) {
		redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors());
	}
	// USER UPDATE
	$error = $user_access->user_update( $cid ) ;
	d3download_delete_cache_of_categories( $mydirname ) ;
	redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=user_access&cid=$cid" , 2 , $error ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE , $error ) : _MD_D3DOWNLOADS_REGSTERED ) ;
	exit();
}

// GROUP COPY
if( ! empty( $_POST['group_copy'] ) ) {
	if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) {
		redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors());
	}
	$selectid = intval( @$_POST['copy_select_group'] ) ;
	$error = $user_access->group_update( $cid ) ;
	if( empty( $_POST['copy_select_group'] ) ) $message[] = _MD_D3DOWNLOADS_ERROR_SEL_CATEGORY ;
	if( empty( $_POST['action_selects'] ) ) $message[] = _MD_D3DOWNLOADS_ERROR_SEL_GROUP ;
	if( ! empty( $message ) ){
예제 #2
0
			list( $count ) = $db->fetchRow( $db->query( $sql) );
			if( $count > 0 ){
				$result = $post_cat->db_update( $set4sql, $edit_id );
				if( ! $result ) $error = $edit_id ;
			}
		}
		if( empty( $edit_id ) ) $edit_id = $new_cid ;
		if( $old_pid != 0  && $pid == 0 ){
			// SET DEFAULT USER ACCESS
			$my_maincid= $category_edit->get_my_maincid( $old_pid ) ;
			$error = $category_edit->my_user_access_copy( $my_maincid, $edit_id, 1 ) ;
		} elseif( $old_pid == 0 ){
			// GROUP UPDATE
			$error = $user_access->group_update( $edit_id, $pid ) ;
			// USER UPDATE
			$error = $user_access->user_update( $edit_id, $pid ) ;
		} else {
			$category_edit->date_save_cat_table( $edit_id ) ;
		}
		$category_edit->serialize_insertdb() ;
		$category_edit->category_tree_check() ;
		$user_access->my_user_access_check() ;
		d3download_delete_cache_of_categories( $mydirname ) ;
		if( ! empty( $_POST['categoryform_post'] ) ) {
			redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=categorymanager" , 2 , $error ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE , $error ) : _MD_D3DOWNLOADS_REGSTERED ) ;
		} else {
			redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=categoryedit&cid=$edit_id" , 2 , $error ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE , $error ) : _MD_D3DOWNLOADS_REGSTERED ) ;
		}
		exit();
	}
}