Thursday, April 8, 2010

Only allow approved members to Login + Umbraco

This is how I go about not allowing Umbraco members to login whn they haven't been approved.

In my MemberType I have a True/False datatype called Active.

On my MemberLogin user control page my asp.net member login control looks like



<asp:Login ID="lgMember" OnLoggingIn="Login1_LoggedIn" CssClass="login" VisibleWhenLoggedIn="false" DestinationPageUrl="/Members.aspx"
LabelStyle-VerticalAlign="middle" LabelStyle-CssClass="LoginLabel" TextBoxStyle-Width="100px" UserNameLabelText="Login"
PasswordLabelText="Password" TitleText="" DisplayRememberMe="false" runat="server" />

In the codebehind my Login1_LoggedIn event looks like.

protected void Login1_LoggedIn(object sender, EventArgs e)
{
//get member
Member m = Member.GetMemberByName(((Login)sender).UserName.ToString(), false).First();

if (m.getProperty("Active").Value.ToString() != "1")
{
FormsAuthentication.SignOut();
HttpContext.Current.Response.Redirect(umbraco.library.NiceUrl(1091));
}

}


This will redirect the user to a page explaining their membership hasn't been enabled yet.

Friday, April 2, 2010

nopCommerce and Umbraco

I have two major passions when it comes to .net open source projects and they are Umbraco and nopCommerce.  What I am planning on doing is building a nopCommerce package for Umbraco.  There are plenty of good commerce packages already for Umbraco and I have nothing against these packages I just love nopCommerce and would like to be able to use it within the Umbraco framework.  I don’t think is going to be a quick task and will probably need to be spanned over many months.  I’m going to try and blog what I do so other .Net applications might be able to use some of the challenges I encounter and how they might go about resolving them.   Please check back here regularly to check on my progress.  Will also try and get a package up into codeplex.  Wish me luck!

Friday, March 12, 2010

Free nopcommerce installation

Are you looking for someone to install nopCommerce for you? If you need nopcommerce hosting and join Softsys Hosting then please flick me an email and I'll install if free for you. Softsyshosting is a fantasic hosting company and is a perfect fit for nopCommerce.

Monday, March 8, 2010

Tuesday, November 10, 2009

Umbraco Hosting

Almost every other day I get asked where should I host my Umbraco Site? Or I've just joined XXX hosting company and Umbraco doesn't work.

There are loads of guides and tutorials on the net about how to get Umbraco working on your host, normally these guides have common traits such as make sure you have the correct permissions set and check the hosting runs their websites in Full Trust.

If you want to skip all that hassle then I highly recommend softsyshosting I currently host over 10 Umbraco sites with them and their support system has always been awesome (along with their prices).

In New Zealand (where I am from) I highly recommend Net24 (for speed and reliability), I also run a few Umbraco sites here and again there service and systems are pretty good (as long as you don't need weekend support). Net24 runs Plesk so you'll need to search Google for "Plesk and Umbraco installation" and you shouldn't have any issues.

Friday, October 23, 2009

skiltz.nzPost

Attached is example of what is to come when the nzpost api is realeased for calculating freight costs.

This is a c# .NET solution so you will need to have visual studio 2008 to run it.

Download from http://agentx.info/skiltz.nzpost.zip

Any questions let me know.

c# Example using the nzpost api



skiltz.nzpost.Package Package = new skiltz.nzpost.Package();
Package.height = 3;
Package.length = 3;
Package.thickness = 3;
Package.weight = 3;
Package.Qty = 1;

//Crete new request to NZPOST RateFinder url
skiltz.nzpost.Request Request = new skiltz.nzpost.Request("Wellington", "Auckland");

//Add our shipment package to the request.
//Can add as many as you like.
Request.PackageCollection.Add(Package);

//Get the response from NZPost
skiltz.nzpost.Response Response = new skiltz.nzpost.Response();
Response = Request.GetRate();

//TO:DO Error Handling.

//we could loop through each package and spit out whatever we want
foreach (skiltz.nzpost.Product p in Response.PackageCollection)
{
decimal cost = default(decimal);
cost = p.Cost;
}

gv1.DataSource = Response.PackageCollection;
gv1.DataBind();



Result:





vb.net Example



'Create new package for shipment
Dim Package As New skiltz.nzpost.Package()
Package.height = txtHeight.Text
Package.length = txtLength.Text
Package.thickness = txtThickness.Text
Package.weight = txtWeight.Text
Package.Qty = 1



'Crete new request to NZPOST RateFinder url
Dim Request As New skiltz.nzpost.Request(txtSrc.Text, txtDestination.Text)



'Add our shipment package to the request.
'Can add as many as you like.
Request.PackageCollection.Add(Package)



'Get the response from NZPost
Dim Response As New skiltz.nzpost.Response()
Response = Request.GetRate()



'TO:DO Error Handling.



'we could loop through each package and spit out whatever we want
For Each p As skiltz.nzpost.Product In Response.PackageCollection
Dim cost As Decimal
cost = p.Cost
Next


If you're looking to implement the nzpost api into your application today and need a developer to make it work please send me an email.

skiltz.DateTimePicker

This projects wraps Martin Milesich's (http://milesich.com/timepicker/) date time picker an extention to jquery ui components into an Umbraco Datatype.

Both of these controls are licensed under the MIT and GPL licenses.

Installing this package will Install the following items:

- Files insalled/umbraco_client/skiltz.DateTimePicker directory
- .dll file installed to your bin directory called skiltz.DateTimePicker.
- Two datatypes called skiltz.DatePicker and skiltz.DateTimePicker

The datatype has 6 properties which can be set.

showTime | true/false
constrainInput | true/false allow user to input text into textbox
stepMinutes | int 1 to 60
stepHours | int 1 to 24
time24h | true/false
dateFormat | dd/mm/yy (javascript format)

Furthur information about these properties should be looked up at Martin's blog as mentioed above.

-Known bugs:
Having two of these datatypes on one page with showTime property set to true caused the time dialog box not to show. This is because the script tags are being rendered to the Master page multiple times.

Any questions feel free to ask.

Download from: http://our.umbraco.org/projects/skiltzdatetimepicker