// 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 ) ; 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(); }
// DOES THE LINK ALREADY EXIST? -- UPDATE SQL $sql = "SELECT COUNT(*) FROM ".$db->prefix( $mydirname."_cat" )." WHERE cid='".$edit_id."'"; 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();