• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/user.php
  • Класс: CAllUser
  • Вызов: CAllUser::GeneratePasswordByPolicy
static function GeneratePasswordByPolicy(array $groups)
{
	$policy = static::getPolicy($groups);

	$passwordChars = Random::ALPHABET_NUM | Random::ALPHABET_ALPHALOWER | Random::ALPHABET_ALPHAUPPER;
	if ($policy->getPasswordPunctuation())
	{
		$passwordChars |= Random::ALPHABET_SPECIAL;
	}

	$length = (int)$policy->getPasswordLength();

	return Random::getStringByAlphabet($length, $passwordChars, true);
}