Ejemplo n.º 1
0
	function d3download_myuser_useraccess_info( $mydirname, $cid )
	{
		$pid = d3download_cat_pid( $mydirname, $cid ) ;
		require_once dirname( dirname(__FILE__) ).'/class/user_access.php' ;
		$user_access = new user_access( $mydirname ) ;
		return $user_access->get_user_form( $cid, $pid, 1 ) ;
	}
Ejemplo n.º 2
0
// GET CATEGORY TITLE
$mycategory = new MyCategory( $mydirname, 'Show', $cid ) ;
$title = $mycategory->return_title() ;
$formtitle = ( $title ) ? sprintf( _MD_D3DOWNLOADS_H2USERACCESS , $title ) : _MD_D3DOWNLOADS_NEWCID_USERACCESS ;

$parentid = $mycategory->return_pid() ;
$maincid = ( $parentid != 0 ) ? $mycategory->get_my_maincid( $cid ) : 0 ;
$category_tree = ( $parentid != 0 ) ? d3download_category_tree( $mydirname, $cid, 'index.php?page=user_access' ) : '' ;
$copyselect = d3download_categories_selbox( $mydirname, '', 0, 0, 1, '----' , 1, $cid ) ;
$categorycount = count( $copyselect ) ;

// GROUP FORM
$group_trs = ( $categorycount > 1 ) ? $user_access->get_group_form( $cid, $parentid, 0, 1 ) : $user_access->get_group_form( $cid, $parentid ) ;

// USER FORM
$user_trs = ( $categorycount > 1 ) ? $user_access->get_user_form( $cid, $parentid, 0, 1  ) : $user_access->get_user_form( $cid, $parentid ) ;

// NEW USER FORM
if(  $categorycount > 1 && $parentid == 0 ) $newuser_trs = $user_access->get_newuser_form( $cid, 1 ) ;
elseif( $parentid == 0 ) $newuser_trs =  $user_access->get_newuser_form( $cid ) ;
else $newuser_trs =  '' ;

// TRANSACTION PART
if( isset( $_POST['group_update'] ) ){
	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 ) ;
Ejemplo n.º 3
0
// GET CATEGORY TITLE
$title = $mycategory->return_title() ;
$formtitle = ( $title ) ? sprintf( _MD_D3DOWNLOADS_CATEGORYEDITTITLE , $title ) : _MD_D3DOWNLOADS_NEWCATEGORYEDITTITLE ; 
if( $cid == 0 ) $title_useraccess = ( $title ) ? sprintf( _MD_D3DOWNLOADS_H2USERACCESS , $title ) : _MD_D3DOWNLOADS_NEWCID_USERACCESS ;
elseif( $pid == 0 ) $title_useraccess = ( $title ) ? sprintf( _MD_D3DOWNLOADS_H2USERACCESS , $title ) : _MD_D3DOWNLOADS_NEWCID_USERACCESS ;
else $title_useraccess = ( $title ) ? sprintf( _MD_D3DOWNLOADS_H2USERACCESS_INFO , $title ) : _MD_D3DOWNLOADS_NEWCID_USERACCESS_INFO ;

// MAIN CATEGORY LIST
$maincategory = $category_edit->categories_selbox( '', 0, 0, 1, '------', 0, $cid ) ;

// GROUP FORM
$user_access = new user_access( $mydirname ) ;
$group_trs = $user_access->get_group_form( $cid, $pid ) ;

// USER FORM
$user_trs = $user_access->get_user_form( $cid, $pid ) ;

// NEW USER FORM
$newuser_trs = $user_access->get_newuser_form( $cid ) ;

$useraccess_edit_info = ( empty( $cid ) ) ? '' : d3download_useraccess_edit_info( $mydirname, $cid, $pid ) ;

// TRANSACTION PART
if( isset( $_POST['categoryform_post'] ) || isset( $_POST['category_update'] ) || isset( $_POST['group_update'] ) || isset( $_POST['user_update'] ) ) {
	if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) {
		redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors());
	}
	$requests_int = $category_edit->requests_int_categories() ;
	$edit_id = $requests_int['cid'] ;
	$pid = $requests_int['pid'] ;
	$cat_weight = $requests_int['cat_weight'] ;