# Copyright 2003-2013 Jon Jensen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. See the LICENSE file for details. Usertag make-password Routine < 7; if ($last_numbers) { $l = 1; } elsif ($_ > 2) { undef $l if ! $did_numbers; $l = 1 if ! $did_letters; } if ($l) { $pass .= $c[rand @c] . $v[rand @v]; $pass .= $c2[rand @c2] if rand(10) > 5; ++$did_letters; undef $last_numbers; } else { $pass .= $d[rand @d]; $pass .= $d[rand @d] if rand(10) > 3; ++$did_numbers; $last_numbers = 1; } redo if $_ > 2 and length($pass) < 8; } return $pass; } EOR