A strange thing. Once, I took the train from Tanjungkarang to Palembang, both cities in southern Sumatra, Indonesia. While waiting in line at the ticket window, an armed policeman asked each person a series of questions: name, destination and number of tickets required and so on. He then issued an izin membeli karcis kereta api, permit to buy a train ticket. Without one, presumably, the clerk at the ticket window itself would not do business with you. This was in the days Before Terror, so my conclusion was that it had something to do with preventing touts from getting hold of large numbers of tickets and reselling them.