Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Tnx in Forward :D
I've implement a login form using user api , but it doesn't work and return False !!!
code :Response.Write(User.validateCredentials("MyUsername","MyPasswod"));
Or:var logedInUser = new umbraco.providers.UsersMembershipProvider();Response.Write(logedInUser.ValidateUser("username","passwod"));
in both cases it returns False although my username and password is true !!!
Hi jpazooki,
Which version of Umbraco are you running? :)
If you're running 4.7.0 or 4.7.1, you could use the following Razor snippet for a custom login (using the default ASP.NET MemberShip provider)
@using System.Web.Security@if (!IsPost){ <form id="login-form" method="post"> <p> <label for="txt-username">Username</label> </p> <input name="username" id="txt-username" type="text" /> <p> <label for="txt-password">Password</label> </p> <input name="password" id="txt-password" type="password" /> <p><a href="#">Forgot your password?</a></p> <input type="submit" value="LOGIN" name="submit" class="login-button" /> </form>}else{ var username = Request["username"]; var password = Request["password"]; if(Membership.ValidateUser(username, password)) { FormsAuthentication.SetAuthCookie(username, true); Response.Redirect("/"); }}
Don't know if that helps any ;)
Tnx, but this will work for members of my site and not for backend users :(
I'm using 4.7.0 ....
hope find some thing new to finish this site www.parmisran.com
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Can't Login with custom login from ?
Tnx in Forward :D
I've implement a login form using user api , but it doesn't work and return False !!!
code :
Response.Write(User.validateCredentials("MyUsername","MyPasswod"));
Or:
var logedInUser = new umbraco.providers.UsersMembershipProvider();
Response.Write(logedInUser.ValidateUser("username","passwod"));
in both cases it returns False although my username and password is true !!!
Hi jpazooki,
Which version of Umbraco are you running? :)
If you're running 4.7.0 or 4.7.1, you could use the following Razor snippet for a custom login (using the default ASP.NET MemberShip provider)
@using System.Web.Security
@if (!IsPost)
{
<form id="login-form" method="post">
<p>
<label for="txt-username">Username</label>
</p>
<input name="username" id="txt-username" type="text" />
<p>
<label for="txt-password">Password</label>
</p>
<input name="password" id="txt-password" type="password" />
<p><a href="#">Forgot your password?</a></p>
<input type="submit" value="LOGIN" name="submit" class="login-button" />
</form>
}
else
{
var username = Request["username"];
var password = Request["password"];
if(Membership.ValidateUser(username, password))
{
FormsAuthentication.SetAuthCookie(username, true);
Response.Redirect("/");
}
}
Don't know if that helps any ;)
Tnx, but this will work for members of my site and not for backend users :(
I'm using 4.7.0 ....
hope find some thing new to finish this site www.parmisran.com
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.