• Synchronet Javascript..

    From Ktulu@VERT/ROI to All on Tue Apr 15 01:46:00 2008
    How do I go about checking if a user has a certain security level and / or aãcertain age? I mean what's the syntax of it? ãThanks!!!ãã--ãKtuluã---ã þ Synchronet þ Realm of Insanity telnet://roi.synchro.netã
  • From Tracker1@VERT/TRN to Ktulu on Tue Apr 15 11:13:30 2008
    On 04/14/2008 06:46 PM, Ktulu wrote:ã> How do I go about checking if a user has a certain security level and ã> / or a certain age? I mean what's the syntax of it? Thanks!!!ããThere's actually a couple ways... the current user, is usually "user" as an ãinstance... otherwise...ããfor the JS object model used in sync, see http://www.synchro.net/docs/jsobjs.htmlãalso... http://www.synchro.net/docs/js.htmlããvar u = new User(#); //where # is the user number... forward, expecting "user"ããif (user.age >= 18) {ã //do something...ã}ããif (user.security.level > 60) {ã //do somethingã}ããalternativelyããif (user.compare_ars("AGE 18 OR LEVEL 60")) {ã //do somethingã}ããIf you need some books on Javascript in general, let me know...ããNOTE: when you are doing multiple security checks, compare_ars uses the same ãformat as other ARS strings in SCFG, and is generally an easier syntax, than ãlonger JS evaluations, though probably a little longer to parse/execute, but ãit shouldn't be a huge deal... look at the .js files in the exec/ directory ãfor tons of examples... you can find more information on ARS strings hereãhttp://www.synchro.net/docs/security.htmlãã-- ãMichael J. Ryan - tracker1(at)theroughnecks(dot)net - www.theroughnecks.netãicq: 4935386 - AIM/AOL: azTracker1 - Y!: azTracker1 - MSN/Win: (email)ãã... FRA #255: A wife is a luxury ... a smart accountant is a necessity.ãã---ã þ Synchronet þ theroughnecks.net - you know you want
    itã