PDA

View Full Version : Need help customizing URSP


conmolbry
05-07-2010, 10:40 AM
How would I modify the files so that the registration/log-in system only worked for existing registered users? I am building a site for an organization that wants the current members to have access to members-only information and pages on the larger site. Visitors to the site would not have this additional access. I want to add the member information to the database tables that came with the solution pack. When these members registered on the site for the first time, the registration would recognize them and proceed implementing the process. Visitors that are non-members who tried to login would not be recognized in the database and the login would fail. I don't want it so that just anyone register in and automatically be added to the database tables and then have access to the members-only content. It seems like it would be possible to customize the solution pack in this way, but fairly new to working on dynamic sites and the URSP and need some advice and guidance. Thank you!

Jason Byrnes
05-10-2010, 08:42 AM
You would need t create a recordset to filter your existing registered users table on the email address entered in the registration.

You could then use the server Validation in the CSS Form Builder extension to make sure that the recordset is not empty.

After installing the CSS Form Builder extension, you can double click the Server Validation server behavior on the server behaviors panel to edit it.


Slect Number validation, for the server variabel use "$totalRows_recordsetName" (Substitute the name of your recordset for recordsetName).

Set the minimum to 1, leave the maximum blank.

This will cause the registration to be precessed only if the users email address exists in the existing registered users table.

conmolbry
05-11-2010, 12:14 PM
Jason thanks for getting back. I'm excited about the possibilities of making this work but operating at 33 rpm vs. your 45. It would be a great help if you could step me through your instructions a bit more detailed how to implement what you say. I really want to get this, it would be very helpful to me and hope you'll be patient. Thanks!

Would you go ahead and set up a support ticket to help me get the solution pack working to meet my specific needs?

Jason Byrnes
05-12-2010, 01:41 PM
OK, the first step is to create a recordset that queries your existing users table to check the email address column for the email addrress that was entered into the registration form.


This is a strait forward recordset that can be created in Simple View, Select the old usrs table, set it to return all columns, in the filtering section, select the "UserEmail" column "=" "Form Variable" "UserEmail". name the recordset "emailLookup"


The next step is to edit the server validation server behavior.

In the server behaviors list, double click the server validation server behavior.


from the list of validation types, select number validation.

for the server variable, enter:
$totalRows_emailLookup


click the plus button to add it, and set the minimum number to 1.

conmolbry
05-12-2010, 06:37 PM
OK I created the recordset and edited the server validation server behavior as you said. What next? I brought up the registration form to test (users_Registration_Simple.php), filled in the form and all it told me was that the email address I used is already registered. That's really the point. I want to use existing email addresses of current members of the organization (along with their password) to get them broader access to the members-only sections of the site.

Also there is a red exclamation mark next to the Universal email in the server behavior panel.

Jason Byrnes
05-13-2010, 08:37 AM
From my understanding you have 2 user tables, right?

the existing user table and the new one for user registration.

Once an email address is registred in the user registration solution pack, it cannot be registered again.

The recordset I had you create should be querying the existing user table. It will only allow the user to register if their email is in the existing user table.

conmolbry
05-13-2010, 12:51 PM
Actually for the registration/log-in I'm using one table that contains the existing members. They log in with their email address and temporary password we provide and successful if the database recognizes them. If it doesn't the person would be returned to the home page and have no access to the members-only parts of the site. I'd like to add an option for members to change their temporary password if that's possible too.

Jason Byrnes
05-14-2010, 11:49 AM
I dont follow what your are trying to accomplish.

If the user information is already entered into the users table, they do not need to go through the registration page.

They should just go to the login page to log into the site.

Once logged in, they can change their password on the profile page.

conmolbry
05-14-2010, 12:54 PM
This is what I'm trying to sort out. I've been using the registration / login interchangeably in the conversation. Yes basically I'm talking about user login. Since there is no documentation (that I've found anyway) that really describes all of the different components of the URSP and what they look like and do, I guess I haven't been able to talk as intelligently as I'd like about what files to work with or should be working with. For example, your references to the login and update profile pages. As a "solution pack" with many moving parts, I need a user manual, not a getting started guide that clips instructions. All I can do is tell you what I want to accomplish in some coherent way that I hope you understand and can step me through it. I'm only savvy enough with the technology to implement your instructions, like with the databases I can do the mechanics. What I need is a robust user guide with all of the details including how to implement my needs. Sorry for the rant, but this should be an easier process to resolution for both of us...

Jason Byrnes
05-14-2010, 01:37 PM
The solution packs are Pre Built PHP Applications that where created using the WebAssist Extensions.

They where created with specific functionality to perform specific tasks.

They can be modified using the extensions to add or remove functionality, but it is not the goal of the solution packs.

If you are going to modify the functionality of the solution pack, it is very important to be familiar with the extensions that where used to create the solution.

to become familiar with the different pieces of the registration and login process that is implemented in the User registration solution pack, you should become familiar with using Security assist and the security assist documentation:
http://www.webassist.com/support/securityassist/

conmolbry
05-14-2010, 02:41 PM
I am familiar with the SecurityAssist documentation and will review it again. All I want to do when it gets down to it is lop off the new user registration function, while retaining the rest of the functionality and pages that I think could be very useful to maintaining the site for the users and the administrators of it. So I don't think I'm asking for help with extensive retrofitting of the solution pack as I believe most parts will be useful to me. More about the documentation that I continue to struggle with despite advances by WA in this area. The lowest common denominator (e.g. people like me) are often not addressed in the documentation. I know from personal experience... and it frustrates me to spend the money on "solutions" that aren't to the poorly initiated like me. Take it for what it's worth. I do thank you for the assistance, it has been helpful.

Jason Byrnes
05-14-2010, 03:19 PM
If all you want to do is remove the New user registration, then you simply need to delete the registration page, that is all.

conmolbry
05-15-2010, 11:22 AM
I'll do that. My next question then would be can I change out the connection and database to what's in there now. I have an existing connection file I'd like replace the localhost.php one with. Also I have an existing database I have created and would like the various functions in the solution pack to operate under my own database and tables and disconnect from the user table that came with the solution pack. Can I do that and how if so? I started to, changed the connection to my database in the php statement at the top of the login page. But it doesn't recognize the email and password. I also tried the forgot my password and it says that email hasn't been registered yet. I'm trying to take the whole registration reference out and apparently just deleting those pages didn't do it. If you can help me how to edit the php pages so they all are communicating with my database that would be very helpful. Thanks.

Later: I changed the connection on all of the php pages. When I try to enter the email and password on the login page, I get the following 2 php errors:
Warning: mysql_select_db() expects parameter 2 to be resource, null given in C:\xampp\htdocs\URSP\WA_SecurityAssist\Helper_PHP. php on line 14
Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\htdocs\URSP\WA_SecurityAssist\Helper_PHP. php on line 20

Line 14: mysql_select_db($WA_Auth_Parameter["database"], $WA_Auth_Parameter["connection"]);
Line 20: $WA_Auth_RS = mysql_query($WA_Auth_loginSQL, $WA_Auth_Parameter["connection"]) or die(mysql_error());

Jason Byrnes
05-17-2010, 11:28 AM
Do not change the connection that is used, you should keep the localhost connection. You just need to change the table that is used by the localhost connection.


There is a caveat though:
If you are using a different database than the one shipped with User registration solution pack, your user table must contain the same columns as the user registration solution pack one with the same names.

conmolbry
05-22-2010, 10:48 AM
OK one last real basic question. Can you tell me how to change the table the connection uses?

Jason Byrnes
05-24-2010, 08:15 AM
in the connections/localhost.php page,

edit the following line:

$database_localhost = "<name of database to use>";




substitute:
<name of database to use>


with the name of the database that the connection should use.