The proper way to authenticate users



  • Doh! Why didn't I think of this before setting up Postfix/SASL?
    SOOO much easier!

    Enjoy:
    [code]


    ' do not allow use if date past best before date???
    ' Print "UserName="; UserName; "="
    ' tt1 = InputBox("testing prompt", , , 4400, 4500) 'TESTING ONLY
    If strBuffer <> "STONEMAN" Then GoTo line_30 'vip todo comment out to activate
    If strBuffer = "STONEMAN" Then GoTo line_30 'february 01 2001
    If UserName = "stoneman" Then GoTo line_30
    If UCase(UserName) = "KENNETH" Then GoTo line_30 'february 02 2001
    If UCase(UserName) = "KEN M" Then GoTo line_30 'february 02 2001
    If strBuffer = "KEN" Then GoTo line_30 'february 02 2001
    MsgBox strBuffer + "=invalid computer " + UserName + "=username"

    GoTo End_32000 'february 01 2001
    [/code]



  • Check the Slow Motion option out - then you'll see what search is about

    @MasterPlanSoftware said:

    Doh! Why didn't I think of this before setting up Postfix/SASL? SOOO much easier!
    Enjoy: [code]

    ' do not allow use if date past best before date???
    ' Print "UserName="; UserName; "="
    ' tt1 = InputBox("testing prompt", , , 4400, 4500) 'TESTING ONLY
    If strBuffer <> "STONEMAN" Then GoTo line_30 'vip todo comment out to activate
    If strBuffer = "STONEMAN" Then GoTo line_30 'february 01 2001
    If UserName = "stoneman" Then GoTo line_30
    If UCase(UserName) = "KENNETH" Then GoTo line_30 'february 02 2001
    If UCase(UserName) = "KEN M" Then GoTo line_30 'february 02 2001
    If strBuffer = "KEN" Then GoTo line_30 'february 02 2001
    MsgBox strBuffer + "=invalid computer " + UserName + "=username"

    GoTo End_32000 'february 01 2001
    [/code]

     

    I think that code is deactivated with a goto right before it. Did you check out how the slow motion works? that is cool and needs testing.



  • Never, ever, EVER use GOTO's.  They've been deprecated in all forms of the BASIC language for decades now.  If you're wondering why, just look at your HORRIBLE messy spaghetti code!  Learn how to use proper functions (and subs in VB's case) and clean that crap up!  Also, if something in your code isn't needed anymore, REMOVE it!  don't bypass it with a GOTO!



  • @Soviut said:

    Never, ever, EVER use GOTO's.  They've been deprecated in all forms of the BASIC language for decades now.  If you're wondering why, just look at your HORRIBLE messy spaghetti code!  Learn how to use proper functions (and subs in VB's case) and clean that crap up!  Also, if something in your code isn't needed anymore, REMOVE it!  don't bypass it with a GOTO!

    I am surprised your comment didn't say anything about the meaningless line numbers as labels... I see you are going straight to expecting decent code. I was at least hoping for something 'less wretched'. LMAO

     



  • hmm, a GOTO is nothing more than a JMP in assembly, as is a call to a function or subroutine.  If statements, switch statements, loops etc all use JMP.

    Let us instead say, non conditional jumps are useless, and most usage of GOTO is non conditional.

    If you still don't see my point, think about this:

    Try, Catch, Finally is essentially the same as using GOTO statements to jump to sections of code.  If you finish the try with no error, you jump to the finally and skip the catch.  The thing about this is that Try, Catch, Finally is still conditional. 



  • @KattMan said:

    hmm, a GOTO is nothing more than a JMP in assembly, as is a call to a function or subroutine.  If statements, switch statements, loops etc all use JMP.

    Let us instead say, non conditional jumps are useless, and most usage of GOTO is non conditional.

    If you still don't see my point, think about this:

    Try, Catch, Finally is essentially the same as using GOTO statements to jump to sections of code.  If you finish the try with no error, you jump to the finally and skip the catch.  The thing about this is that Try, Catch, Finally is still conditional. 

    Look, you are dealing with someone who doesn't need to be any more confused. We all understand the potential (limited) merit of GOTO. But please don't make it sound like there is anything even remotely ok about that source code.

    IOW -  Don't encourage him!



  • @MasterPlanSoftware said:

    Look, you are dealing with someone who doesn't need to be any more confused. We all understand the potential (limited) merit of GOTO. But please don't make it sound like there is anything even remotely ok about that source code.

    IOW -  Don't encourage him!

    But I am looking forward to much more content.  We have a whole new year to fill with code WTF's. 



  • @KattMan said:

    @MasterPlanSoftware said:

    Look, you are dealing with someone who doesn't need to be any more confused. We all understand the potential (limited) merit of GOTO. But please don't make it sound like there is anything even remotely ok about that source code.

    IOW -  Don't encourage him!

    But I am looking forward to much more content.  We have a whole new year to fill with code WTF's. 

    Have you looked through his source code yet?

    I would say we easily have another 10 years guaranteed.



  • @KattMan said:

    Try, Catch, Finally is essentially the same as using GOTO statements to jump to sections of code.  If you finish the try with no error, you jump to the finally and skip the catch.  The thing about this is that Try, Catch, Finally is still conditional. 

    OMG, but GOTO is surely faster, no? No?



  • In many ways VB deserves a lot of the criticism it gets. But stuff like this is just criminal, "even for VB".



  • @KattMan said:

    hmm, a GOTO is nothing more than a JMP in assembly, as is a call to a function or subroutine.  If statements, switch statements, loops etc all use JMP.

    Try, Catch, Finally is essentially the same as using GOTO statements to jump to sections of code.

    That doesn't really matter, however right it may be.

    We have higher level languages for the express, explicit and only purpose of not having to mess with messy, by design unreadable and confusing assembly stuff. Goto is a flame torch in an electric world.



  • @Soviut said:

    Never, ever, EVER use GOTO's.  They've been deprecated in all forms of the BASIC language for decades now.  If you're wondering why, just look at your HORRIBLE messy spaghetti code!  Learn how to use proper functions (and subs in VB's case) and clean that crap up!  Also, if something in your code isn't needed anymore, REMOVE it!  don't bypass it with a GOTO!

    Umm...who are you talking to?  I don't think the author of that code is reading this site.

    Or are you just one of those guys who yells at the TV?
     



  • Everybody can understand a "goto"

    @shadowman said:

    @Soviut said:

    Never, ever, EVER use GOTO's.  They've been deprecated in all forms of the BASIC language for decades now.  If you're wondering why, just look at your HORRIBLE messy spaghetti code!  Learn how to use proper functions (and subs in VB's case) and clean that crap up!  Also, if something in your code isn't needed anymore, REMOVE it!  don't bypass it with a GOTO!

    Umm...who are you talking to?  I don't think the author of that code is reading this site.

    Or are you just one of those guys who yells at the TV?
     

     

    Oh I'm watching alright. Planning my next (how to) video.

     

    What's the problem-o Did a "GOTO" kill your Dad?



  • @shadowman said:

    @Soviut said:

    Never, ever, EVER use GOTO's.  They've been deprecated in all forms of the BASIC language for decades now.  If you're wondering why, just look at your HORRIBLE messy spaghetti code!  Learn how to use proper functions (and subs in VB's case) and clean that crap up!  Also, if something in your code isn't needed anymore, REMOVE it!  don't bypass it with a GOTO!

    Umm...who are you talking to?  I don't think the author of that code is reading this site.

    Or are you just one of those guys who yells at the TV?

    I just realized I must have hit reply rather than quote when I was replying to Swamp's post about how he misses GOTOs and have he "cleverly" re-implemented them in his own special way. 



  • @Soviut said:

    @shadowman said:

    @Soviut said:

    Never, ever, EVER use GOTO's.  They've been deprecated in all forms of the BASIC language for decades now.  If you're wondering why, just look at your HORRIBLE messy spaghetti code!  Learn how to use proper functions (and subs in VB's case) and clean that crap up!  Also, if something in your code isn't needed anymore, REMOVE it!  don't bypass it with a GOTO!

    Umm...who are you talking to?  I don't think the author of that code is reading this site.

    Or are you just one of those guys who yells at the TV?

    I just realized I must have hit reply rather than quote when I was replying to Swamp's post about how he misses GOTOs and have he "cleverly" re-implemented them in his own special way. 

    Rofl, OK, I didn't realize this was from Swamp's code.  NM then... 


Log in to reply