Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 13 Mar 2002 06:14:09 -0000 1.28 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 16 Mar 2002 17:38:08 -0000 1.29 @@ -24,14 +24,15 @@ ad_proc -public generate_key { {-name:required} } { - Generate a key from a name. Uses a concatination of the - name and nexval of the acs_oid sequence. To generate a - globally unique key that can be used in urls. - - FIXME : this is abuse of the sequence, add sequence for this in dotlrn + Generate a key from a name. Compresses all adjacent non-alphanum + chars to a dash. Yes, this is not unique, grows rapidly, will + need collision detection and resolution, yada yada. } { - regsub -all {\W+} $name "" name - return "$name-[db_nextval acs_object_id_seq]" + + regsub -all {\W+} $name "-" name + regsub -all -- {-+} $name "-" name + + return "[string trim $name {-}]" } ad_proc -private do_abort {} {