Extending User Profile - Private Files Feature

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/16/2010 7:15:56 AM
Gravatar
Total Posts 72

Extending User Profile - Private Files Feature

Hi Joe,

I want to allow each user to have their own private files. I know one way of doing this would be to use the ShareFiles feature and set permissions user by user. However, this is not really manageable for us.

So instead I would like to extend user profiles to have this functionality.

My question is your recommendation on the best way of doing this without altering the core profile feature. I know I can add custom profile properties but really we are talking about a one to many association so I don't think a custom profile property is going to help.

Then I have a couple more general questions.

Where are the custom profile properties saved (not the data). I can see that when I add a custom profile property and recycle my app, the property is then available on the profile page. If I add a value and save the profile it is saved into mp_UserProperties. When is the PropertyID generated and are you storing a list of properties anywhere?

Similar style question for settings. There a couple of settings tables. When I add a new setting into user.config, is this then stored in the database?

Thanks

Ben

6/16/2010 7:34:24 AM
Gravatar
Total Posts 18439

Re: Extending User Profile - Private Files Feature

Hi Ben,

What you could do is implement the custom per user files in a custom physical .aspx page that you copy somewhere using a post build event.

Then you could use a custom profile setting that points to a .ascx which implements ISettingControl. Then you could create a link to the user files inside the .ascx and just use some hard coded string for the ISetting methods (essentilly they are not needed for your link but you must implement the interface to be able to load the control on the profile. You would need to configure the setting it so the link doe snot show on the profileview.aspx but only on the /Secure/UserProfile.aspx page.

In your custom page you would have to implement something similar to file manager or shared files depending on the real security needs of the files.

I would not recommend such a feature unless all your users are trusted, I would not let strangers upload files nor trust files uploaded by them.

You can enable users to use the main file manager and store files in a user specific location from site settings security tab. I'm not sure if this meets your need for "private files". Keep in mind that any file stored on disk that is not using a file extension protected by ASP.NET can be retrieved by an http request directly for the file. There may be some security by obscurity because people don;'t know what files exist but if they could guess a file name and location for say a .pdf file they could retrieve the file easily, nothing protects it. The Shared Files module really does protect files because they are stored on disk with .config extension which is protected and restored to the original file name on the way out if the user has permission to download.

Settings in user.config are not stored in the db. There may be cases where we have similar settings in the db as in user.config, if you have a question about a specific setting I can tell you.

Only profile data is stored in the db, the properties themselves are stored only in the mojoProfile.config (or custom named .config), the config data is loaded and cached, so recycling the app clears the cache and reloads them.

 

Best,

Joe

6/16/2010 7:40:00 AM
Gravatar
Total Posts 72

Re: Extending User Profile - Private Files Feature

That's a great help Joe.

We are not allowing users to upload files so can add the management pages to Admin only.

The goal is to then actually expose the user files via a web service for consumption via a mobile device. The client application will send their mojo user id and password and get back a list of available files.

Thanks again,

Ben

6/18/2010 10:28:04 AM
Gravatar
Total Posts 72

Re: Extending User Profile - Private Files Feature

Joe,

Is there any way of accessing any properties of mojoProfilePropertyDefinitions from ISettingControl.

I'm just think of a way that I can use the same ISettingControl for both user and admin views. Or am I better just checking to see if the user is in the administrators role to determine whether to display upload/edit buttons?

Thanks,

Ben

6/18/2010 10:38:37 AM
Gravatar
Total Posts 72

Re: Extending User Profile - Private Files Feature

Further on from the above, do you think im okay to inherit from SiteModuleControl for this profile control? Seems like it will save me a fair bit of work for checking user permissions etc.

6/18/2010 10:40:07 AM
Gravatar
Total Posts 18439

Re: Extending User Profile - Private Files Feature

No, SiteModule is for CMS plugins and expects only to be used in CMS pages and to have a module id, it is not a generic base class for other kinds of controls.

You must sign in to post in the forums. This thread is closed to new posts.