Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Restrict module usage to 1 portalRestrict module usage to 1 portal
Previous
 
Next
New Post
11/23/2008 6:03 PM
 

I'm developing a module in 2 flavors: default and enterprise.

How can i restrict the usage of the default version to just 1 portal?

Tnx

 
New Post
11/24/2008 9:03 AM
 

    The related records is stored in "modules" table.Open that table, you will see two related fields . PortalId,ModuleDefId. I think you can determine how many portals module is used based the above information.


Over 20 + professional dnn modules for News Article, Store, Video Gallery, Photo Gallery, Ultra Flash Player,YouTube Video, Image Slide show, Skin Chameleon and much more from DnnModule.com
 
New Post
11/24/2008 1:03 PM
 

I think Developer58 is asking to only have the module available (show up in the list of modules) for a single portal.  The MODULES table by itself will only tell if a module already is added to a page on a portal (or several pages and/or several portals).  The MODULES table cannot prevent the module from showing up in the administrator's dropdown list of available modules across all portals.  In other words, admin's from any portal could continue to see and add the module to DNN pages even after it has been added the first time.  Your module can use the info in the MODULES table to prevent iself from executing if it is not the intitial instance of itself across all portals but you can't use the MODULES table to prevent the module from showing up in and being added to mutliple portals.
 

SOLUTION #1:  HOST can use PREMUIM setting via DNN UI
If you are setting your modules up on DNN instances that you control, the easiest way to retrict use to one portal is to use the "PREMIUM" checkbox under the module's MODULE DEFINITON (available only to HOST accounts).  Log in as host and go to HOST->MODULE DEFINITONS and check the edit box next to your (already installed) module.  Check the "PREMIUM" box and then you can select which portal(s) can see and use the module.


SOLUTION #2:  "PREMIUM" setting via module code

If you are going to distribute your module (i.e., you will not have control over the DNN instances where the module is installed), you can use the same "PREMIUM" trick from code:  use the MODULES table to determine the first installed instance of your module and then update the appropriate ISPREMIUM value under DESKTOPMODULES table as well as remove extraneous entries of your module from DESKTOPMODULES.  You'll want to perform the following steps each time your module is loaded:

  1. For the module you wish to restrict to run on a single portal:  Have your module check the MODULES table and get the MODULEID and PORTALID of the entry with the lowest MODULEID value of all modules with a matching MODULEDEFID value that are also not marked as 'deleted' by the ISDELETED bit.  (You may also want to verify that the current date falls within the STARTDATE and ENDDATE times, if defined.)
     
  2. Update the DESKTOPMODULES table to mark the module as ISPREMIUM.  Make a note of your module's DESKTOPMODULEID.
     
  3. Under PORTALDESKTOPMODULES, add/update an entry with your module's DESKTOPMODULEID along with the approriate PORTALID value.  Rmove any entries matching your module's DESKTOPMODULEID that do not have a PORTALID matching the ID of the portal(s) allowed to have your module.
     

SPECIAL NOTE:  Moving the module to another portal
You'll need to include special instructions for your users on how remove the module from one portal and make the module available on another portal.  The steps are:  (1) delete the module from its current portal, (2) uncheck the module's "PREMIUM" setting under HOST->MODULE SETTINGS, (3) add the module to new portal.  As soon as the module is added it will run the special "PREMIUM via code" steps outlined above and re-check the "PREMIUM" setting, locking it to the new portal.

-mamlin


esmamlin atxgeek.me
 
New Post
11/25/2008 4:53 PM
 

thanks a lot for your answer! Keeps me busy a while ;-)


Dirk

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Restrict module usage to 1 portalRestrict module usage to 1 portal


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out