Saturday, February 22, 2014

Edit Web Security User

Edit Web Security User..

Okay, last week we saw how I created a dialog to add web security users, they are all added to a group called "New User". The new user group has very limited functionality and is restricted. However you can login and edit those credentials using a edit dialog.

In order to do that you will need two components.  One grid to show the currently enlisted users with a button select to edit the data and a dialog to edit the data to save.

As you remember we created a separate table to hold personal data with a common link to the web security table using the email as a link, since that is the sign in user name.

The grid will display the users and when you click the edit button the dialog will pop up with the data and you will edit all the information.  The secret is that alpha has helper functions that load and save the data back and forth from the security tables.  You don't have to write a separate code to do that.  You will be primarily concentrating on the table that you created for the user and rest alpha will take care of.  The ID from the grid is passed onto the dialog via a session variable so the dialog knows which record it should fetch to populate.  Once edited the record is saved to the private and as well as the security tables.

Since this involves security, it is better to have all these components require a login.

Here are the videos:
WebSecurity User Edit Video 1
http://screencast.com/t/fmhL1gFQI

WebSecurity User Edit Video 2
http://screencast.com/t/45J0wVl3bI

WebSecurity User Edit Video 3
http://screencast.com/t/amK07SCwC

Thursday, February 13, 2014

So you want to setup web security in AlphaFive...

So you want to setup web security in AlphaFive...

I was very busy during the holiday season, the business I am in demands that.  I skipped many weeks of posting.  Sorry about that.
So I thought now is the best time to talk about web security.
By default the web security is not enabled.  You have to enable it then create the necessary components to go with it.

To start with, go to web menu on the top and select the application server and then turn on the web security by clicking the checkbox enable security framework.  You may have to restart the server for this to take effect.

Then go to web control panel and click on the websecurity.  Then on the dialog that pops up click on the web configuration, the first choice. There turn on the web security and fill in all the necessary information.  You may want to create dummy login files and logout files if you need to.  Also select a random encryption key, I let alpha do it for me.

Once you have done that, it is time to setup security users and their permissions.
The following screencast shows how to setup the security. Take a look:
http://screencast.com/t/GuG5Qt97

Once you have set the security up, the first thing we need to do is add a new user or many users.
This can be easily done via the interface Alpha provides. But that has very limited use. If you want to add additional data regarding the user then it is better with a dialog that will add additional data to the security information.  Fortunately Alpha provides a template, that you can use and take advantage of it.
So when you want to build a dialog to add user with additional information select that template and first thing you do is remove all data binding.  You have an option of asking Alpha to create a table in your backend or you can create then bind to the fields.  When Alpha creates the table all the bindings are set to start with.
Since the dialog is template driven and was bound to other controls in the template, ou need to go back to each server side functions and edit them.  You may not need to correct any but you need to go through the steps so the xbasic commands are refreshed to reflect the changes.
Here is a video showing the dialog being built, take a look:
http://screencast.com/t/jW5W8WOqv

After configuring the dialog to add user, you need to go to each of the server side functions and edit them so that the xbasic will be re-written and the new values will take effect.
Here is that video, take a look:
http://screencast.com/t/8epwwLRH

Here is the final video where I am entering a new user to the security system.
http://screencast.com/t/OSfXwP8WEY