NEED A HOOK QUOTE

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
appgini5676
Posts: 1
Joined: 2015-01-05 23:00

NEED A HOOK QUOTE

Post by appgini5676 » 2015-01-05 23:06

Hi,
I sent this quote to support a couple times but i did not get a reply and i'm not sure if you get it.
So I need a quote
Scenario: i have a customer table and many groups accessing with different privileges

CUSTOMIZATIONS:
1. I have a "status" field on a customer table (table: customer, field name: status, a drop check box) that MUST be only insert/view/edit or delete by the Admin group. All other groups can not view/insert/edit

2. I need to have print preview only for ADMIN GROUP in the same customer table

3. I have a "notes" field on a customer table ( a text box) that only ADMIN GROUP can insert/edit or delete. All other groups can only VIEW it.

4. i have a "docs" attachment field (table: customer, field name: docs, an upload file) where all groups/members can upload a doc but after upload the file ONLY Admin group can edit/delete that file.

5. I need 1 login session per user. i have users sharing their logins and getting into system at the same time and is not allowed.

udayvatturi
AppGini Super Hero
AppGini Super Hero
Posts: 85
Joined: 2014-06-14 03:08
Location: India
Contact:

Re: NEED A HOOK QUOTE

Post by udayvatturi » 2015-01-06 06:59

Hi,
I can help you.Please check your PM.

User avatar
pilandros
Veteran Member
Posts: 93
Joined: 2014-02-13 18:19

Re: NEED A HOOK QUOTE

Post by pilandros » 2015-05-18 17:58

udayvatturi wrote:Hi,
I can help you.Please check your PM.
Did you help him/her with this issue? I need it too.
Can you help me on how to avoid several active sessions with the same username?
Thanks

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: NEED A HOOK QUOTE

Post by shasta59 » 2015-05-20 00:49

Hello

The way to avoid multiple users with the same login is to just write some simple code which checks a table showing when a user logged in and if they logged out. I do this by adding a table to the database and adding to the hook file _global code which writes to that database the id of the user. It then, when they log out, writes to the same record the time/date when they logged out. This table is then checked, at log in time, to see the user name associated with all log ins not showing as having logged out.

If there is a match a message comes up and tells them someone with that username is already logged in and they cannot log in as they are already logged in.

Make sure you have added code to check to see if the user is inactive for X number of minutes and if so they get auto logged out. I also track their ip address. If they log out and within X minutes try to log in again from a totally different IP in a different subnet they are also not allowed.

This has solved the issue of shared user/pass. I am just testing code to freeze their account if too many log ins from different ip's over a certain period of time.

I also have an email sent to the owner of record of the user/pass advising them their user/pass is being suspended and they need to contact the admin.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: NEED A HOOK QUOTE

Post by shasta59 » 2015-05-20 01:00

Okay here is an answer for #1:

Cheap and dirty solution.

You can put something like this in the header.php file, for example, and it will hide fields you do not wish seen. Just have it check to see what table you are in and based upon that run the code like shown below.

Code: Select all

$glgr = getLoggedGroupID();
		
	if($glgr <> '2' and $glgr <> '6'){
		echo "<script>\$j(document).ready(function(){ \$j('#datestopped').hide();});</script>";
		echo "<script>\$j(document).ready(function(){ \$j('#confirmed, #confirmed2, #confirmed3, #confirmed4').attr('disabled', true);});</script>";
		echo "<script>\$j(document).ready(function(){ \$j('#paid1, #paid2, #umpiring1, #umpiring2, #exam_mark, #admin_comments').attr('disabled', true);});</script>";
Basically what it does is use the group id to decide what to do. Then it will hide the fields listed such as 'datestopped' or it will disable entry into certain fields.

It uses jQuery to do its stuff.

There are better ways but this has worked with no issues for me so I have not taken the time to rewrite it. Another project for another day.

Hope this helps.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: NEED A HOOK QUOTE

Post by shasta59 » 2015-05-20 01:02

For #3 see my above answer. Fills the same need. It disables but allows to be seen certain fields. If you are not a member of a certain group you cannot edit but can look. If you are a member of, in this case, group 2 or 6 you can edit.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

Post Reply