bulkmail_decode_key_code key_codeWhat it does:
Given a key code, returns a list of the user_id and bulkmail_id. Returns an empty list of there was an error.Defined in: /web/philip/tcl/bulkmail-utils.tcl
Source code:
set code_pieces [split $key_code "C"] if { [llength $code_pieces] == 0 } { return [list] } # First piece is the bulkmail_idAuser_idBns_time set user_content [lindex $code_pieces 0] # Second piece is the simple checksum set checksum [lindex $code_pieces 1] # Compare the checksum to the checksum of the user_content. Be careful # to lower the string case. if { [bulkmail_simple_checksum [string tolower $user_content]] != $checksum } { return [list] } if { ![regexp -nocase {([0-9]+)A([0-9]+)B([0-9]+)} $user_content match bulkmail_id user_id time] } { return [list] } return "$bulkmail_id $user_id $time"