DotNetNuke Hosting with ASPHostPortal.com

BLOG about DotNetNuke CMS, latest technology and Special DotNetNuke Hosting Package with ASPHostPortal.com

DotNetNuke 7.3 Hosting with ASPHostPortal.com :: How To Fixing duplicate Display Names in DotNetNuke

clock Desember 3, 2014 05:31 by author Mark

Fixing duplicate Display Names in DotNetNuke

Since DotNetNuke 6, it is possible to require unique display names. This allows social modules to display a name for a user without exposing the login UserName or the real person first and last names. If you site uses social features, it is important that those display names be unique to prevent a user to post content in the name of another user.
By activating this feature, users are no longer able to register with a Display Name already in use. However, there are 2 oversights. First, the user or an admin can change the Display Name after registration to anything else (including a Display Name already in use). Secondly, you may already have duplicates before you activate this feature, and they don't get automatically changed. In this blog post, I provide you with both solutions the these problems.
Prerequisites

BACKUP YOUR WEBSITE FILES AND DATABASE

This procedure has only been tested on DotNetNuke 7.3.3, so I recommend you first upgrade to this version. If you feel like trying it out on other versions, feel free to do it and post your results in the comments, but make sure you do that backup first.

1. Activating the feature

  • First, we will activate the feature requiring unique display names.
  • Connect to your website as an administrator
  • Navigate to Admin -> Site Settings
  • Click the User Account Settings tab
  • In the Registration Settings section, tick Require Unique Display Name
  • Click the Update button at the bottom
  • Now, it will be impossible for user to register using a Display Name already used by another user.

2. Correcting the problem

  • I created a patch or DotNetNuke 7.3.3 that will prevent users and admins to change the Display Name to something already in use. Like I said before, this is for DotNetNuke 7.3.3, feel free to test and comment on other versions, but make sure you have backup. I submitted a the bog repport DNN-5874 and patch (pull request 160 now pull request 177) to DotNetNuke and I hope it will be applied to DotNetNuke 7.3.4Upgrade DotNetNuke to version 7.3.3 (or try with another version and report in the comments)
  • Download the file PatchDNN-5874.zip
  • Extract that file to your root DotNetNuke folder overwriting the files
  • (optional, if you site has other languages):

Go to Admin -> Languages
Translate those keys:
File                                                                                                                           Key
DesktopModules/Admin/Security/App_LocalResources/EditUser.ascx.resx      DisplayNameNotUnique.Text
DesktopModules/Admin/Security/App_LocalResources/User.ascx.resx          DisplayNameNotUnique.Text
We have now resolved this issue allowing users to change their display name to another one in use.

3. Fixing existing duplicates

  • Now that the issue is resolved for the future, we need to resolve it for the past. Your site may already have duplicate display names before this patch. In order to solve that, I have created a small module that will display all duplicates and allow you to change them in batch by clicking a single button, it will append the UserID to the display name to all users except the first that registered with that display name.
  • Download the file DuplicateDisplayNamesFix_00.00.01_Install.zip
  • The source package is also available if you are a developer DuplicateDisplayNamesFix_00.00.01_Source.zip
  • Install it like any other module (Host -> Extensions -> Install Extension Wizard
  • Create a temporary page that is only visible by administrators (or use an existing admin page)
  • Place the Duplicte Display Names Fix module on that page
  • The module will display a list of all users with duplicate display names or a message if none are present
  • You can export the list to Excel or CSV if you want to keep that information for your records (to send them an email for example)
  • Now you can click the GO button to rename them. (this operation cannot be undone, make sure you have that backup.)

If you don't think to use the module again you can now uninstall it and delete the temporary page.



DotNetNuke 7.3 Hosting With ASPHostPortal.com :: DNN 7.3 Issue with Url Master

clock Desember 2, 2014 07:12 by author Mark

DNN 7.3 has been released and contains lots of changes for performance and stability, bug fixes and some new features.
I was first alerted to an issue with Url Master and DNN 7.3, who found that the API cleanup in 7.3 had removed an old DNN API that Url Master was leveraging, which meant that the site would stop working after the 7.3 Upgrade.   The error you get if you upgrade DNN without first upgrading Url Master to 2.8.2 is this:

500 Internal Server Error
The requested Url does not return any valid content.
Administrators
Change this message by configuring a specific 404 Error Page or Url for this website
.

This is the default URL Master error output (unless you have debug mode enabled) which intentionally hides the actual exception for security reasons.  If you open the event log, you’ll find something like this:

Exception: Method not found: 'DotNetNuke.Entities.Portals.PortalAliasCollection DotNetNuke.Entities.Portals.PortalAliasController.GetPortalAliases()

The solution is that you need the latest version of the Url Master module, version 2.8.2, which uses a newer method to get the portal alias data.
Get the Url Master Module 2.8.2 Download

If you haven't upgraded to DNN 7.3 already, you must upgrade to 2.8.2 before upgrading.

Just download the 2.8.2 install package, and upgrade via the Host->Extensions page.  You do not need to update your licence – this version is available to *all* existing Url Master customers.

If you have already upgraded and have found that your site is dead with this error, then you will need to manually patch the files.  Here are the steps:

  • Download the Url Master install package
  • Extract the zip file locally on your computer to a folder, so you can see the files inside the zip
  • Within the extracted zip file, you will see 4  files.
  • Copy these 4 files into the \bin directory of your site that needs to be upgraded.  Use FTP or copy/paste or any other method to get it into the \bin directory.
  • Once they are copied into the bin directory, try the site again.  It should start and run normally.
  • Once your site is running again, install the (compressed) file as normal through the Host->Extensions page.  This won't change the versions installed, but it will bring your extensions catalog up to date.

I appreciate if people spread these instructions to those who are running Url Master and are intending to upgrade to 7.3 as a preventative measure.



DotNetNuke 7.3 Hosting with ASPHostPortal.com :: Creating a DotNetNuke (DNN) module with an .ascx control

clock Desember 1, 2014 05:52 by author Dan

Today, we will discuss about Create a DotNetNuke (DNN) module with an .ascx control. Without the utilization of the visual studio templated of the Dotnetnuke starterkit.

Installed on the PC :

  • Visual Studio 2008 Express
  • IIS 5.1
  • Dotnetnuke
  • SQL Server 2008 R2

Dotnetnuke is arranged and acting as the default site as http:\\localhost. I utilize XP Pro IIS administrator to switch between sites.

Create a visual studio project

  • Create an C# ASP.NET Web application project
    The location of the project can be inside the DotNetNuke folder in the \DesktopModules folder. I have used “TestProject”.
  • The output of the project can be directed into the bin folder of the DotNetNuke folder. You can enter ‘..\..\bin’ as the output path in the build tab of the project properties
  • Add a reference to the DotNetNuke.dll (located in the \bin folder)
  • Add a new Web User Control (.ascx) file to your project (e.g. WebUserControlTest.ascx)
  • In the code behind of the new control, use the DotNetNuke namespaceusing DotNetNuke.Entities.Modules;
  • Inherit your control from DotNetNuke’s PortalModuleBase class. In the class created by visual studio you can replace ‘System.Web.UI.UserControl’ by ‘PortalModuleBase’. It will look like this:public partial class WebUserControlTest: PortalModuleBase
  • Implement some sample code inside the control.
    For example, add a literal component to the control, and set the Text in the ‘Page_Load’ function of the code behind.
    The .ascx file looks like this:
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControlTest.ascx.cs" Inherits="SecondTest.WebUserControlTest" %>
    <asp:Literal ID="PageHeaderText" runat="server" />The .ascx.cs file looks like this:using System;
    using System.Collections.Generic;
    using System.Linq;using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using DotNetNuke.Entities.Modules;

    namespace TestProject
    {
    public partial class WebUserControlTest : PortalModuleBase
    {
    protected void Page_Load(object sender, EventArgs e)
    {
    if (this.Page.IsPostBack == false)
    {
    this.PageHeaderText.Text = "Hallo DotNetNuke world!!!";
    }
    }
    }
    }
  • Build the user control project. A DLL called ‘TestProject.dll’ will be created in the \bin folder

Notes: The web control can't contain a Form. Since Dotnetnuke as of now has structure on its parent .aspx page. Asp.net can just have one structure for every page. In this way, how about we utilize Panels, Views or Multiviews in your web control.

Create a module definition in DotNetNuke

  • Login in with a SuperUser account (host)
  • On the host page, go to module definitions
  • If you are in Edit mode, you’ll find an option ‘create new module’ at the bottom of the page.
  • For ‘Create module from”, select ‘control’ (I guess….)
  • Then in the module folder, select the folder you made for your project. I looks like DNN scans for folder in the DesktopModules folder. In this example it is ‘TestProject’.
  • When the module folder is chosen, the resource if filled in by DNN: WebUserControlTest.ascx
  • Enter a module name: E.g. ‘TestModule’
  • Enable the creating of a test page if you want.
  • Click on ‘create module’ and DNN updates it’s administraion and create a page with our new module already inside it. You need to see the text “Hallo DotNetNuke world!!!” on the page.

If there should arise an occurrence of issues. Check the security settings inside IIS. Permit script to run in the home direcorty. Furthermore let the new organizer of the venture be adjusted by the Asp.net machine account and the web visitor account (in the event that you need to test if from an alternate machine in your LAN).

Debug your control

  • In the Web settings of the project, set http://localhost/ as the Start Url.
  • Enable the use of the local IIS server and configure the following:
  • project url: http://localhost/DesktopModules/TestProject
  • Override appliucation root URL: http://localhost/
  • Go to the C# code behind of the control and set a break point at the line where we set the Text of the literal.
  • Start debugging (press F5)
  • A browser will be started, and the DotNetNuke start page is loaded.
  • Navigate to the test page of the ‘TestProject’ module. Maybe you have to login for this.
  • At the moment, the test page is loaded, visual studio express will become active and display the location where it has stopped. Now you can step through the code of your control.

You' can get an error message that your framework can't begin debugging on the web server. It likewise says you have to empower incorporated Windows verification for that. I replicated the data how to do that:

To enable integrated Windows authentication

  • Click Start and then click Control Panel.
  • In Control Panel, double-click Administrative Tools.
  • Double-click Internet Information Services.
  • Click the DotNetNuke Web server node.A Web Sites folder opens underneath the server name.
  • You can configure authentication for all Web sites or for individual Web sites. To configure authentication for all Web sites, right-click the Web Sites folder and then click Properties. To configure authentication for an individual Web site, open the Web Sites folder, right-click the individual Web site, and then click Properties.The Properties dialog box is displayed.
  • Click the Directory Security tab.
  • In the Anonymous access and authentication control section, click Edit.The Authentication Methods dialog box is displayed.
  • Under Authenticated access, select Integrated Windows authentication.
  • Click OK to close the Authentication Methods dialog box.
  • Click OK to close the Properties dialog box.
  • Close the Internet Information Services window.


About ASPHostPortal.com

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions

Author Link


 photo ahp banner aspnet-01_zps87l92lcl.png

Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Tag cloud

Sign in