Monday, January 05, 2009 Register  Login
RSS Feeds
Categories
  
Blog Archives
  
Blog

Entries for the 'DotNetNuke' Category

Sending license key emails from DotNetNuke

 124 Views ::  1 Comments RSS comment feed

The integration that I had with my ecommerce DNN module (ActivePurchase) broke when I moved the site to PowerDNN. I have been fighting with this for a couple weeks now.

Here's what happened:
The part that sends the serial number did not work anymore, because the SMTP server was not on the same network. Changing the settings did not work at first. I went googling for sending emails from DNN. I got some good hits for sending email from inside DNN modules.

The API for this is fairly simple (relatively). You first make a reference to DotNetNuke.Services.Mail. Then you make a call to the Mail.SendMail() method, with the appropriate parameters. There are 5 overloads. The call from a module would look like this:

DotNetNuke.Services.Mail.Mail.SendMail(FromAddress, SendTo, "", Subject, Body, "", "", "", "", "", "")

Well, that didn't work. So now I was scratching my head.

I am using a special type of integration called a custom step, which is just an assembly in the bin directory for the DotNetNuke install. I had to go and dig into the event log that DNN keeps. There were several exceptions there. The message was that the SMTP connection needed to be authenticated. WTF??

Custom DNN modules use the SMTP settings that the administrator has setup. However, the custom step does not get treated as a module. So I had to do this:

DotNetNuke.Services.Mail.Mail.SendMail(FromAddress, SendTo, "", Subject, Body, "", "", "", "", UserName, Password)

Once I did that, the custom step started sending emails like before. YES!

Now that this is fixed, I can get my undivided attention back to PainlessSVN and SVN Backup Widget stuff.

posted @ Monday, November 24, 2008 10:29 PM by Hector Sosa, Jr

Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

DotNetNuke user manager - Winform App

 1220 Views ::  3 Comments RSS comment feed

I had a LOT of people ask me about how to recover/reset passwords in a damaged DotNetNuke (DNN) installation. I wrote a quick Winform app to do just this. It's fairly crude, but it get things done. I cleaned up the code a bit and wrote intructions in the read me file.

Here is the opening screen:

User manager start screen

Here is the screen after you press the Get Users button

This is what it looks like when a password is ok. The password will show up in green.

This is what it looks like when the password is damaged and can't be recovered through the ASP.NET Membership APIs. The Reset Password will reset the password in the DotNetNuke database, then the UI will display the randomly generated password you can email to your user.

The zip file contains the source. It is a Visual Studio 2008 C# project.

Please read the "Read Me.txt" file, inside the zip file, for how to setup the config file. This program will not work if the config file is not setup correctly! I didn't want to spend time creating a wizard to create the configuration file.

Internet Explorer Internet Explorer users - Please right-click on the links below and select "Save Target As"

DNNUserManager_source.zip

DNNUserManager_binaries.zip

posted @ Tuesday, July 15, 2008 7:13 PM by Hector Sosa, Jr

Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us

Retrieving login data for DotNetNuke

 216 Views ::  0 Comments RSS comment feed

 


Well, I had a hair pulling session trying to recover the passwords on my hobby site. Both my admin and host paswords got hosed, so I couldn't just login and fix them.
I first went Googling to find a winform app to help with this problem. Well, all the solutions were just modules to install on your DotNetNuke installation. Since I can't even login as host, this approach is just totally useless. Thankfully, DNN uses the ASP.NET 2.0 Membership Providers.
So, I started with Membership.Provider.RetrievePassword(). Oops, "Bad Data". Crap! I tried other account passwords with the same result. Double-Crap! I modified my little winform app, to now reset passwords. This time I used Membership.Provider.ResetPassword(). Got a new password for host, and I was able to login now. YES! I'm using .NET 2.0 for this winform app.
So if you want to get this working, here is what you need to do:
Make sure that you include the following sections from your DNN's website web.config file:
connectionStrings
system.web
You only need the membership and machineKey sections inside system.web.
Import System.Configuration and System.Web into your project. All of the needed API calls will be under Membership.Provider namespace. You'll find a lot of samples on how to use on Google.


Anyways, I wanted to put it somewhere, so that I can find it later, WHEN I would need to do this again.

posted @ Monday, June 16, 2008 11:09 AM by Hector Sosa, Jr

Actions: E-mail | Permalink | Share on Facebook Google bookmarks Kick it! DZone it! del.icio.us
Terms Of Use | Privacy Statement | SystemWidgets
Copyright 2002-2008 by SystemWidgets