I am creating a web application using Form Authentication of Asp.Net with C# and back end Sql Server. Here in my application administrator login and creates new users. I am using the create user wizard under login controls. My problem is when the new user is created by Admin he is automatically logged out and logged in with new user credentials which he has just created.
I have this code , to redirect user when an error is detect on a page, and to notify the admin
vb Code: Protected Sub Page_Error(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Error REPORT IF ERROR DETECTED Dim a As New errorhandler a.reporterror(Page.Title.ToString & " " & Request.Url.Host.ToString, Server.GetLastError.ToString) End Sub
then under another button I have this try and catch , i wud like to show the user there is an error on the date input format.
But whenever an error is detect the user is redirected to another page (errorhandler).I was wondering if it's possible not to redirect the user if the error is of type InvalidCastException .
I am planning to develop around 4 product catalogue websites. The functionality of all the websites would be same. however the design, images and css would be different.
All the 4 websites will use the same admin panel, forums and database(MS Access) also.
How should I create such a system.
I dont understand what kind of folder structure should I create.
I would like to create following kind of folder structure.
I am currently developing a website for a friend of mine who is a dj. I have a login page, which works fine however i want to inplement a menu that only users with the Administrator role can view. I have done alot of research and i have found ways to stop a user from visiting a page, when they click on it it takes the to the login page. But i want to completely hide the menu from Non Admins.
Following one of the other tutorials I have figured out how to manage users [URL] but it does not mention how to delete them from the GridView. I have attached my Page's code plus my VB script. I have added a delete link into the GridView for preparation but all I would like is the VB script so that when the user clicks delete it deletes the user from the GridView and Databse. I hope I have made every really simple, anyway here it is:
I'm dealing with a scenario where a legitimate user doesn't have a clue about his password, secret question or the answer. So, I was trying to create an admin tool that would help me in situations like these where the admin should be able to type in username and reset the password without having to know/enter answer to secret question. I understand that I need to make some changes to the web.config for this to work. I thought I made all the changes but my ResetPassword() requests are still not working.
I found a great answer on SO describing how to set up custom user roles, and I've done the same in my project. So in my Login service I have:
public ActionResult Login() { // password authentication stuff omitted here var roles = GetRoles(user.Type); // returns a string e.g. "admin,user" var authTicket = new FormsAuthenticationTicket( 1, userName, DateTime.Now, DateTime.Now.AddMinutes(20), // expiry false, roles, "/"); var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(authTicket)); Response.Cookies.Add(cookie); return new XmlResult(xmlDoc); // don't worry so much about this - returns XML as ActionResult } And in Global.asax.cs, I have (copied verbatim from the other answer): protected void Application_AuthenticateRequest(Object sender, EventArgs e) { var authCookie = Context.Request.Cookies[FormsAuthentication.FormsCookieName]; if (authCookie != null) { var authTicket = FormsAuthentication.Decrypt(authCookie.Value); var roles = authTicket.UserData.Split(new Char[] { ',' }); var userPrincipal = new GenericPrincipal(new GenericIdentity(authTicket.Name), roles); Context.User = userPrincipal; } } Then, in my ServicesController class, I have: [Authorize(Roles = "admin")] //[Authorize] public ActionResult DoAdminStuff() { ... }
I login as a user with the "admin" role, and that works. Then I call /services/doadminstuff - and I get access denied, even though when I put a breakpoint in Global.asax.cs, I can see that my roles do include "admin". If I comment out the first Authorize attribute (with roles) and just use a plain vanilla Authorize, then I can access the service.
This is what I have in the RegisterUser.aspx and yet when the admin registers a new user, then on clickiing the register button, the site logs in as the user who was just created.
In our project, we have a situation where the administrator needs to 'force log off' a particular user under certain conditions. In other words, the admin user needs to have the ability to kill any other user's session.Is this possible? By using the session properties, we can kill the current session (the current user's session) but is it possible (for the admin user) to kill some other user's session?
I am currently trying to figure out how to best go about implementing an administration side for my application.I have a user site, where users can log in, customize their profile, submit information etc.I would like administration users to be able to log in and be able to choose from a list of users. From there, the administrator can submit information for the user just like the user can.
How should my pages be laid out?How should the Web.sitemap file look? Is there a nice way of creating a sitemap (maybe in memory?)Would this method have to use session variables?
have table for users have a some attribute one of them admin attribute have a bit data type when the user is admin it is true and i have ligin page and control panal page i want throw login page check for the user to redirect him to control panal if the user is admin the control panal will be displayed with moreoptions any one how can i doing this with select statement
i am currently checking to see if the logged in person is an admin, by putting a check in the page_load function. (same thing to see if the person is logged in at all)
is there a better way to do this? or should i just go ahead and put my check on every single page?
I'm using DataAnnotations to validate creation of a new Admin user. However on EDIT page I want to have password and confirm password fields blank. This way i know that password has not changed. However whenever I EDIT a user I get ModelState.IsValid = false because password and confirm password are blank even though I set these in my controller. how would i fix this so that on EDIT screen I can omit "Required" validation?
I am using SQL membership authentication and SQL Database for my ASP.NET Website and its using for my Organization (has multiple Branches in different cities).How I can get all user list which are recently online/Login in my system (WebSite) in my Admin Panel?
In my project I have one folder called Administration (contains pages created for administrating the public part of the page) and in root I have public pages. What I want to do is to prevent anyone beside administrator to enter the Administration part and to make the Administration/Login.aspx default page for entering Administration part. This part makes me confused. I tried to create the access rules, but that wasn't the option because I upload the images to the Administration/Upload folder so if I deny the users the images on the public part can't be accessed.
The second problem I don't know how to solve is public part of the page where I want to allow commenting only to logged in users (users only, not the admin). How to check if user is logged in and authetificated and how to enable the commenting part of the form to him (textbox and submit button).
I have a directory structure root->admin-> admin operations admin page inherited from a ase page with principla security.demand role = "Admins" i am usinf forms authantication mode. i have also put a web.config file in admin folder, restricting other users. it is working normaly with siteroot/admin. I want to setup a mechanism to admin like siteroot/username/admin I can redirect to page admin but it gives security error, it should redirect to login page instead of if user did not sign in.
I am looking for a way to distroy the ASP.net membership session for a specific user. The reason I am doing this is as an admin I want to delete a user. This works fine, but if the user already has an active session, he is still marked as "online" until this session dies (I verify each time by using Current.User.Identity.IsAuthenticated). How do I go about killing a session based on the user it's authorized as. This way when I do Memberships.DeleteUser(username) I can also do Sessions.KillByUser(username)[URL]
i finally got vwd to work as an admin(windows 7) but now i get the error screen below:
Where can i find these, i went to add/remove programs, windows features, and there is only one box checked for ii6, no other options, no "Windows Authentication". Can I get these items somewhere else? I didn't see them on iis web site either.
I have an Admin folder which contains 4-5 aspx pages. I want to that only user with role="admin" can view those files. What settings i need in web.config?
develop a user admin application.My schema looks like the following:See full size As you can see I've got my own version of the user table and profile tables to store my data with a one-to-one mapping with aspnet membership tables.I'm interested in using ASP.NET dynamics to speed up the proccess of creating an admin system.
I would like to create a customised listing with a search and a data grid listing with just basic details such as name and state information, date registered and then when you click to edit your presented with the domain representation of the data and not the exact undelying data.Has anyone any experiece in doing this or building a real work application with Dynamic data?
I'm looking for a way to create a login control without the use of web admin tool
Here are my system requirements
Windows 7 Visual Studio 2008 Professional Edition Microsoft SQL Server 2005 Express Edition ESET Anti-virus but SQL and Studio files excluded from being scanned. I have got a database. I've created the front end of the user login control manually not using the toolbox. Basically what I need is that once a user has registered. He then logs in. when he enters his username and password how do I code it so the database realises it's him/her and takes them to their LOGGED IN user
i need certain algorithem/formula or code where admin assign userid/password to user ,means multiple user get registered site but user id and password are assign by admin after registered . did not any thing on google yet !!