Usually when a user attempts to log in with incorrect information, an error in red is given.
I recently created some code to allow admins to manage users, when I change a users password, they can no longer login, they are redirected back to the login page, and no error is given. Even if I go into the IDEs security dialog to edit that user the old way, the user can still not login, and still no error. All other users remain unchanged and can log in.
It seems I am corrupting the user record in someway that I do not understand.
Below is the code. It is based on a Grid control which interfaces with another table that contains additional meta-data for the user, like first name. I am sure the design could be much improved, but this is what I've been given.
The idea is that when an admin edits this table, the appropriate changes to the Websecurity tables are made using A5's built in security functions.
----------------------------------------------------------------------------------------
I recently created some code to allow admins to manage users, when I change a users password, they can no longer login, they are redirected back to the login page, and no error is given. Even if I go into the IDEs security dialog to edit that user the old way, the user can still not login, and still no error. All other users remain unchanged and can log in.
It seems I am corrupting the user record in someway that I do not understand.
Below is the code. It is based on a Grid control which interfaces with another table that contains additional meta-data for the user, like first name. I am sure the design could be much improved, but this is what I've been given.
The idea is that when an admin edits this table, the appropriate changes to the Websecurity tables are made using A5's built in security functions.
----------------------------------------------------------------------------------------
Code:
aa = e.rtc.A_AjaxResponses 'get current web security record to get GUID dim output as p dim output.controls as p dim output.controls.email.value as c dim output.controls.password.value as c dim output.controls.userid.value as c dim output.controls.groups.value as c dim output.controls.guid.value as c dim UserValue as p dim UserValue.guid as c dim UserValue.ulink as c dim UserValue.email as c UserValue.userid = e.DataSubmitted.Email2 a5ws_get_webuser_values(output, UserValue) guid = output.controls.guid.value UserValue.guid = output.controls.guid.value newpassword = e.DataSubmitted.Pass 'groups administrators = e.DataSubmitted.Administrators advisors = e.DataSubmitted.Advisors students = e.DataSubmitted.Students super = e.DataSubmitted.Super 'crlf delimited group list group_list = "" 'alter Web Security Password if administrators = .t. then group_list = "Administrators" + crlf() else if advisors = .t. then group_list = group_list + "Advisor" + crlf() else if students = .t. then group_list = group_list + "Students" + crlf() else if super = .t. then group_list = group_list + "Super" + crlf() end if UserValue.groups = trim(group_list) 'password if newpassword <> "****" then UserValue.password = newpassword end if 'save UserValue.userid = trim(UserValue.userid) UserValue.email = UserValue.userid result = a5ws_Save_WebUser_Values(output, UserValue) if result.errors = .T. then error_message = result.error_text aa[].text = "alert('" + UserValue.email + ":" + UserValue.guid + " : " + quote(error_message) + "')" end if