SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Admin only code?

    I am really new to javascript, and what I try to learn I can't seem to retain. Anyway, I have some text that onclick will allow anyone to edit it. I was recently told that this field should only be editable for admins. I don't know anything about the code or the website because it just became my project a couple weeks ago. Can anyone help?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by jamiegrinnell View Post
    I am really new to javascript, and what I try to learn I can't seem to retain. Anyway, I have some text that onclick will allow anyone to edit it. I was recently told that this field should only be editable for admins. I don't know anything about the code or the website because it just became my project a couple weeks ago. Can anyone help?
    You need to work out two things.

    1. How to determine that the page is being used by an admin
    2. How the edit is occurring, so that you can restrict it to only those admins.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •