This topic is locked

How to create a table that new records that users add won't be sho

11/1/2009 10:30:07 AM
PHPRunner General questions
N
Nelson author

Hi , I created this thread with the question below...but the thread got locked --> http://www.asprunner.com/forums/topic/12430-how-to-create-a-table-that-new-records-wont-be-shown/pagefromsearch1..
so I can't continue with my questions on my way to solve the problem...So I ask the same question again!
How to create a table that new records that users add won't be shown unless the admin of the site approve the new records first...and then they will appear??
I listened to the advice you gave me Jane..and created a table named "testing1"...the table withholds the fields called:

uniqnr

Name

Phone

Status

As in "advanced security settings"...I chose "user can see others data; can edith their own data only....(Usertable & maintable ID= uniqnr)


in username & password from database I chose: "username field"= Name ..... "Password field"= phone


in permission groups I chose: (Default can): add, ,delete, edith, view...(Guest can): add, view....(admin can do all)


And at last in the events I added this code you mentioned to the "before record added"..(custom code)-> $values["Status"] = "not approved";
The problem is still guests and users can see the records even thou they're not approved...where I want the admin only to be able to see them new records and approve them..then they'll be shown...what more should I do...to fix this please!
Thanks very much

Nelson

J
Jane 11/2/2009

Nelson,
I suppose you need to create custom view for non-admin users on the Datasource tables tab, edit SQL query on the Edit SQL query tab for this view.

Here is just a sample:

select uniqnr,

Name,

Phone,

Status

from testing1

where Status="approved"



Then assign correct permissions for this view on the Security tab.

N
Nelson author 11/4/2009



Nelson,
I suppose you need to create custom view for non-admin users on the Datasource tables tab, edit SQL query on the Edit SQL query tab for this view.

Here is just a sample:

select uniqnr,

Name,

Phone,

Status

from testing1

where Status="approved"



Then assign correct permissions for this view on the Security tab.


Jane,

I did what you recommended...the problem is..now after I add a record...as admin or other users...I see no records in the list page!?

After I added the codes above this thing happened
I kept the values below;

As in "advanced security settings"...I chose "user can see others data; can edith their own data only....(Usertable & maintable ID= uniqnr)


in username & password from database I chose: "username field"= Name ..... "Password field"= phone


in permission groups I chose: (Default can): add, ,delete, edith, view...(Guest can): add, view....(admin can do all)



is that wrong?
Thanks

Nelson

J
Jane 11/5/2009

Hi,
do you fill status field on the add/edit pages?

You can publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.