Friendly Temp-Password in ISC

The following mod makes the temporary passwords a bit friendlier, easier to remember, and easier to type.

In /lib/Interspire/String.php

Search for:

public static function generateReadablePassword($charLength=GENERATED_PASSWORD_LENGTH)

Change to:

public static function OLD_generateReadablePassword($charLength=GENERATED_PASSWORD_LENGTH)

Just above that, add this:

public static function generateReadablePassword($charLength=GENERATED_PASSWORD_LENGTH){
	$adjectives = "black,red,white,blue,green,orange,yellow,pink,purple,violet";
	$nouns = "pony,kitten,puppy,house,mouse,horse,cat,dog,duck,fish,pizza,monkey,zebra";

	$nouns = explode(',', $nouns);
	$adjectives = explode(',', $adjectives);
	$brands = explode(',', $brands);

	$a = mt_rand(0, count($adjectives)-1);
	$n = mt_rand(0, count($nouns)-1);
	$b = mt_rand(0, count($brands)-1);
	$password =  $adjectives[$a] . $brands[$n]. $nouns[$n];
	return $password;

Leave a Reply

Your email address will not be published. Required fields are marked *