Mercurial > hg > fapweb
comparison msite.inc.php @ 1089:00632d30bafe
Implement new settings for making user/votekeys case-insensitive and
setting the array of characters used for generating keys in the config.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 26 Jan 2017 01:27:32 +0200 |
parents | 7da8bde9b7be |
children | 95b74632cfe2 |
comparison
equal
deleted
inserted
replaced
1088:4f132374df75 | 1089:00632d30bafe |
---|---|
555 | 555 |
556 | 556 |
557 function stGenerateUserKey() | 557 function stGenerateUserKey() |
558 { | 558 { |
559 global $db; | 559 global $db; |
560 | |
561 // Default keychars | |
560 $keyChars = "abdefghjkmnpqrstwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; | 562 $keyChars = "abdefghjkmnpqrstwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; |
563 | |
564 if (($tmp = stGetSetting("userKeyChars", NULL)) !== NULL) | |
565 $keyChars = $tmp; | |
566 | |
567 if (($tmp = stGetSetting("userKeyCase", NULL)) !== NULL) | |
568 $keyChars = strtoupper($keyChars); | |
561 | 569 |
562 while (TRUE) | 570 while (TRUE) |
563 { | 571 { |
564 // Generate one randomized keycode | 572 // Generate one randomized keycode |
565 $key = ""; | 573 $key = ""; |