Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Korayem's file sharing mod help required
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

madfiddler
Starting Member

United Kingdom
33 Posts

Posted - 04 November 2003 :  12:52:20  Show Profile

Regarding the file sharing mod, although I've set file sharing to members and not to guests, othere members don't seem to be able to see files only the admin users.

any ideas? My inc_UploadConfig.asp is as follows


<%
'################################################
' ADMIN SETTINGS
'################################################

'###-change this to enable/disable part/ALL the file sharing MOD (uploading ,downloading and everything)
disableUpload=false
disableDownload=false
disableAllFileSharing=false

'################################################
' FILE SHARING MODE
'################################################
'Select which mode of file sharing you want to use:
'1:Default Members Shared Files:
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
' ->each MEMBER has his own global shared files directory named with his memberID
' and is shared with other members.
'2:Forum Shared Files:
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
' ->Each FORUM has its own directory, and in each forum selected members may upload into those forum their shared files
' ->members who have access to more than one forum under any category will have different folders in different
' seperated forum directories.
' ->useful in cases you want to seperate each forum to have its own members and files.
sharedFilesMode=1

'################################################
' THUMBNAIL MODE
'################################################
'set the following variable to create thumbnails on the fly (using asp code)
'0: no thumbnails at all
'1(default): thumbnails will be viewed by simply changing width and height (no components used)
'2: to use persits ASPJpeg to create the thumbnail
' SITE:www.persits.com
' VER:1.2
' PRICE:see website
'3: to use serverobjects.com's ASPimage component to create the thumbnail
' SITE:www.serverobjects.com
' VER:2.X
' PRICE:see website
ASPThumbMode=1

'-set width and height of the thumbnail
thumbWidth=80
thumbHeight=80

'################################################
' FILE CATEGORY SETTINGS
'################################################
'DESC:
'if set to true, user can set the uploaded file's category. if kept in private then
' this file cannot be view by anyone but can be attached to a pm or topic for download
' ie downloadable but not listed.
'this is excellent since members may browse files using categories.

'set false to disable members from selecting a category for each file
fileCatMode=true
'create the category list.
'you can add as much as you like here, but just make sure you change
' the correct array size
redim fileCatList(4)
fileCatList(0)="Other"
fileCatList(1)="Documents"
fileCatList(2)="Images"
fileCatList(3)="Presentations"
fileCatList(4)="Spreadsheets"



'MODERATOR SETTINGS:
'if following variable was set to true, then moderators will be able to
' edit,move,delete and rename any files and folders
' including admin and other moderators
allowFullModeratorAccess=true
'enter list if moderator member IDs SEPERATED BY COMMAS that you want to
' grant access to any member's files
'NOTE: if you want ALL moderators to have full access set following variable
' to empty string, ie ""
allowedModeratorList="1,38"


'array of allowed file types
allowFileType = Array("jpg","gif","zip","pdf","doc","exe","txt","xls")
'maximum allowed individual file upload size in bytes
maxByteSize = 5*1024^2
'set colors used to display the file's type of share(show,hide,dont share) set by member
colorShare="#33CC00" 'files shared by all other members
colorHide="#FF0000" 'files hidden buy yet downloadable by other members(case link was enterd in a topic).
colorDontShare="#FF6600" 'files not shared at all. cant be viewed or even downloaded (except by owner ofcourse).

'set the maximum allowed file info text length to be entered per file
maxFileDescLength = 300
'maximum MINUTES to wait for upload (changes scriptTimeout value when uploading only)
maxUploadTime=25
'choose whether to use aspUpload Componenent or not
aspComponent=false
'Choose wether to display the upload status bar or not(NEEDS ASPUPLOAD 2 BE ENABLED FIRST)
aspComponentStatusBar=false
'Set where the files icons are placed using virtual path from root
fileIconsPath="/forum/fileicons/"

'set the maximum no of file uploads and total file size
' case default file shared mode:value per member
' case forum file shared mode:value per forum per member
'set it to "unlimited" for unlimited no of uploads and file size 8-D
'FILES:
maxMemberFileNo = 50
maxModeratorFileNo = 100
maxTotalFileSize=5*1024^2
'SUBFOLDERS:
maxMemberSubFolderNo = 5
maxModeratorSubFolderNo = 20

'Sharing settings:
'set whether allow or don't allow the member to be able to set each
' of their file sharing mode to be share/hide/not-shared with other
' members or guests

'Sharing modes available to members(if enabled by admin):
'1-Share: member/guest will be able to list file and download it
'2-Hide: member/guest wont be able to list file in the members folder, but he/she may download it
' if member owner gives the file link (ie through a post)
'3-Not Shared: member/guest wont be able to list file or even download it.

'NOTE:
' -admins in all cases (disabled or not) can change the sharing level
' -IMP:if you set setGuestsShare to true, then guests will be able
' to view files uploaded and your members will be able to decide
' whether to share them or not.

setMembersShare=true
setGuestsShare=false 'NOTE:setting this to 'true' will allow guests to view members files if member choose to

'################
' Paths
'################
'NOTE: YOU MUST FIRST CREATE THE ACTUAL PATHS WRITTEN IN ALL VARIABLES HERE ELSE MOD WONT WORK AT ALL
'NOTE: ALL OF THE FOLLOWING VARIABLES SHOULDNT END WITH A "\" NONE OF THEM
'physicalUploadFolder -> path to physical location of uploading
'physicalUploadTextFolder -> path to store text files containg file information

physicalUploadFolder = Server.MapPath("/forum/sharedfiles")
physicalUploadTempFolder = Server.MapPath("/forum/temp")
physicalUploadTextFolder = Server.MapPath("/forum/filestext")
logFilePath = Server.MapPath("/forum/logfiles")

'#######################################################
' DO NOT EDIT PAST THIS PART
'#######################################################

if sharedFilesMode=2 then
%><!--#INCLUDE FILE="inc_UploadFuncForum.asp" --><%
end if

'split allowedModeratorList to an array
if trim(allowedModeratorList)<>"" then
allowedModeratorList=split(trim(allowedModeratorList),",")
end if
'#####################################################
'Change Current Path case 2nd mode and forumID exist
'#####################################################
if request("forumID")<>"" and sharedFilesMode=2 then
physicalUploadFolder = physicalUploadFolder & "\" & request("forumID")
physicalUploadTextFolder = physicalUploadTextFolder & "\" & request("forumID")
end if

'#################################################################
' change global link of membersFiles.asp according to mode
' NOTE: the "?d=d" doesnt do anything at all.BUT DONT REMOVE IT!
'#################################################################
if sharedFilesMode=1 then
commonMemFilesURL = "membersFiles.asp?d=d"
elseif sharedFilesMode=2 then
if request("forumID")<>"" then
commonMemFilesURL = "membersFiles.asp?forumID=" & request("forumID")
elseif request("catID")<>"" then
commonMemFilesURL = "membersFiles.asp?d=d"
else
commonMemFilesURL = "membersFiles.asp?d=d"
end if
end if

%>
<!--#INCLUDE FILE="inc_UploadFunc.asp" -->

Gargoyle
Junior Member

USA
280 Posts

Posted - 04 November 2003 :  19:28:00  Show Profile  Visit Gargoyle's Homepage
Go into the asp file named membersfiles.asp
Then look at your files. If it says members (not shared) or (hidden) that is your problem. You must then edit each file to be viewable by members. Any questions just give me a shout!

Here is a link to my Snitz powered Drag Racing site.
Go to Top of Page

madfiddler
Starting Member

United Kingdom
33 Posts

Posted - 05 November 2003 :  11:26:19  Show Profile
quote:
Originally posted by Gargoyle

Go into the asp file named membersfiles.asp
Then look at your files. If it says members (not shared) or (hidden) that is your problem. You must then edit each file to be viewable by members. Any questions just give me a shout!




sorry matey that was too obvious

The files are already set to share for members (I've got the guest sharing switched off in the config page)

any other ideas?


Go to Top of Page

madfiddler
Starting Member

United Kingdom
33 Posts

Posted - 05 November 2003 :  12:26:20  Show Profile
OK I think I found the problem, I think this is a bug in inc_UploadFunc.asp but maybe I'm missing something so I'd appreciate someone else checking this. I've not seen anyone mention this on any forums anywhere!?!?

For some strange reason that I've never entirely understood, in the database membership levels are as follows
1 = normal user
2 = moderator
3 = admin

However the values in mlev that are set when checking the user at login are 1 higher than this.
I.e. normal user is mlev=2, moderator is mlev=3, admin user is mlev=4

OK then - in FilesLibrary.asp there is a flag called AdminAllowed this is set if you are an admin user OR a moderator in allowedModeratorList and allowFullModeratorAccess is true (set in inc_UploadConfig.asp)

when the file library is shown files are only displayed if
  • you own them

  • you are admin or you are in the allowed moderator list (AdminAllowed flag is set)

  • you are a guest and guest access is allowed (mlev 0 and guest access set on the file and option is on in config)

  • you are a normal user (mlev=2) and member access is allowed



with me so far? right then...what's missing?

Yep that's right! What if you are a moderator that isn't in the list of moderators that are allowed full access to the files as per admin? You won't see any files at all!

To fix this I worked through inc_UploadFunc.asp and everywhere that mlev (or memberLev) is checked to see if it equals 2 (i.e. a normal user) I changed it to check if its >=2

So you can see why I would like someone to check this logic - I've made the change don't want to have upset the mod and end up giving access to people that shouldn't have access to files. On the surface it seems OK though.

thanks to anyone who spares me some time to check this.

Korayem - if you are around it would be appreciated if you can check this too, because obviously you are the most familiar with the code being the author


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07