⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

I have a question



mega
  • profile picture
  • Member

Posted 05 January 2013 - 15:17 PM

i want to add variable to edit same



/index.php/admin/user/edit/1/token/06c5ab9815341668bcdd8e08f460a0a4

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 05 January 2013 - 17:40 PM

You can simply add it to the URL like this: /index.php/admin/user/token/06c5ab9815341668bcdd8e08f460a0a4/edit/1

and grocery CRUD will do the rest for you.

Regards
Johnny

mega
  • profile picture
  • Member

Posted 05 January 2013 - 21:03 PM

plz give me Example

victor
  • profile picture
  • Member

Posted 05 January 2013 - 21:18 PM

What is "token" in your case? This variable is different for each row?

victor
  • profile picture
  • Member

Posted 05 January 2013 - 21:21 PM

Why do you need that variable?

mega
  • profile picture
  • Member

Posted 05 January 2013 - 21:22 PM

i want to add token when click edit button

same

/index.php/admin/user/edit/1/token/06c5ab9815341668bcdd8e08f460a0a4

victor
  • profile picture
  • Member

Posted 05 January 2013 - 21:26 PM

Is this
variable different for each row?

mega
  • profile picture
  • Member

Posted 05 January 2013 - 21:33 PM

i have this row in table but i want to add when click button edit to have more security

becuse when customer chenge id cant see any thing

i think i can change in library grocery_CRUD

to add that

plz help me

victor
  • profile picture
  • Member

Posted 05 January 2013 - 21:39 PM

Do you want to forbid to clients to change another's records?

victor
  • profile picture
  • Member

Posted 05 January 2013 - 21:44 PM

Maybe it help you : /topic/1043-security-concern-about-multiuser-data-in-a-table/#entry4159

mega
  • profile picture
  • Member

Posted 05 January 2013 - 21:44 PM

sorry no understand

mega
  • profile picture
  • Member

Posted 05 January 2013 - 21:48 PM

i want to add when click edit action or add to action edit button

victor
  • profile picture
  • Member

Posted 05 January 2013 - 21:50 PM

I think it's for you /topic/1223-i-have-a-question/#entry4993

mega
  • profile picture
  • Member

Posted 05 January 2013 - 21:58 PM

i want to add more in uri

my data in public cant check just id
iwant to add token to have more check

victor
  • profile picture
  • Member

Posted 05 January 2013 - 22:07 PM

I don't understand why do you need insert variable in the url if you can use the "before_insert" and "before_update" methods and check access rights in these functions.

mega
  • profile picture
  • Member

Posted 05 January 2013 - 22:15 PM

i can do that but

when change id user will see view i want to cant see that i want check when page load when click edit action

if i can set get_primary_key = token i dont have a problem

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 05 January 2013 - 22:29 PM

I think in your case you just need the field_type method and change the field type to [b]readonly[/b] ( http://www.grocerycrud.com/documentation/options_functions/field_type ).
So in your case you will have something like this:


if (!$user_has_access) {
$crud->field_type('user_id','readonly');
}


If this is not the case for you, please post some code first to understand what you want.

mega
  • profile picture
  • Member

Posted 05 January 2013 - 22:33 PM

i dont no but i will try that thanks
[b] victor[/b]

AND Regards Johnny