lisp help - loginname

Discussion in 'AutoCAD' started by molokaiboy, Oct 1, 2004.

  1. molokaiboy

    molokaiboy Guest

    I have this little routine that checks for a users login name. If the user isn't "john" then it restricts them from running a custom command.

    I want to add additional users to the "approve list". Below is what I added but doesn't seem to work. Any ideas on how I would fix this?

    (defun logincheck ()
    (if (/= (strcase (getvar "loginname") t) "john" "jack" "bob")
    (progn
    (alert "Access Denied! Contact Your CAD Administrator")
    (exit)
    ))

    TIA

    Collin
     
    molokaiboy, Oct 1, 2004
    #1
  2. molokaiboy

    Douglas Barr Guest

    (defun logincheck ()
    (setq login-name (strcase (getvar "loginname")))
    (setq login-list
    (list "TOM" "DICK" "HARRY" "COLLIN")) ; <<<ADD TO THIS LIST
    (if (not (member login-name login-list))
    (alert "Access Denied! Contact Your CAD Administrator")
    )
    (princ)
    )

    Have a great weekend!
    -doug

    isn't "john" then it restricts them from running a custom command.
    added but doesn't seem to work. Any ideas on how I would fix this?
     
    Douglas Barr, Oct 1, 2004
    #2
  3. molokaiboy

    Josh Guest

    (if (not (member (strcase (getvar "loginname") t) (list "john" "jack"
    "bob")))
    (progn
    ....


    isn't "john" then it restricts them from running a custom command.
    added but doesn't seem to work. Any ideas on how I would fix this?
     
    Josh, Oct 1, 2004
    #3
  4. molokaiboy

    molokaiboy Guest

    Thanks everyone. I got it to work.
     
    molokaiboy, Oct 2, 2004
    #4
  5. molokaiboy

    Douglas Barr Guest

    And your final code was...
     
    Douglas Barr, Oct 4, 2004
    #5
  6. molokaiboy

    molokaiboy Guest

    I just modified my original code to add the new users.
     
    molokaiboy, Oct 4, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.