• (nodebb)

    $name is a truly awful name for a variable containing a dictionary (idgaf what the proper name is for this structure in PHP) containing a mapping from names to email addresses.

  • (nodebb)

    I did a contract for a public university a couple of decades ago that had implemented single sign-on by passing the username and password in the clear in the url parameters to the next app. Anything is possible with people don't understand how code works.

    A nicer idea here might have been to change the file to be plain text (with robust import checking) so they could edit it themselves.

  • (nodebb) in reply to mynameishidden

    That would have been the "correct" way. A database would be overkill, but a text file that's read in with one line per person some kind of Name:email value? That's easy enough that even a librarian could do it.

  • (nodebb)

    In all fairness, they would have needed a "programmer" as well to change DB entries. He would have needed to make or append an administrative site to actually be use friendly - until they needed again a "programmer" to reset their admin passwords because all of them locked themselves out :-)

  • burner (unregistered)

    Maybe the staff didn't want any emails.

  • (nodebb) in reply to DocMonster

    a text file that's read in with one line per person

    Came here to say something similar. I don't feel that the WTF here is really that much of a WTF. Apart from the fact that the list is written in PHP, this is a nice lightweight solution to the problem. If it were a table in a database, either people would need to acquaint themselves with SQL and an appropriate SQL client, or a maintenance page needs to be written and that assumes that the server has a database back end already.

    This solution offers some nice advantages: no pesky database server, easy to edit with a text editor (not MS Word!), easy to add to source control (although I suspect these people didn't have that).

  • Steve (unregistered) in reply to burner

    +1 Man, I could have used that code...

  • Scragar (unregistered) in reply to jeremypnet

    Just give them something like PHPMyAdmin with a user that has access to only the staff table. They can insert and delete users from there really easily then.

    Just implement a trigger on the table so changes get mirrored to a log you can revert, just in case some screws up and deletes everything.

  • Richard Brantley (unregistered)

    I would suggest, even if this was stored in a text file, that it be maintained through a maintenance page. Asking non-technical users to edit a text file has some challenges of its own, because when people can enter free-form data with no guard rails you will get all sorts of garbage added to your file. We all thinks it's easy to manually edit a text file, but that does not hold true for everyone, and you need a way to back out when they mangle something.

  • Duke of New York (unregistered)

    I bet the person who extracted the table into an included file (leaving the empty constructor) was very proud of that improvement.

  • Kleyguerth (github)

    TRWTF is the ad being hidden in the source code thanks to the easy reader version not properly closing the comment tag

  • richarson (unregistered) in reply to Kleyguerth
    Comment held for moderation.

Leave a comment on “Library Checkout”

Log In or post as a guest

Replying to comment #:

« Return to Article