public function testRegualar() { $formatter = new Atrox_Core_Data_Formatter_Password(); $this->assertEquals("ac974dda4af5b3094c2d25362042c40359514e1c", $formatter->format("glitter8moon")); $this->assertEquals("271036c5361a00b9453af9d071e59af6bd4dc506", $formatter->format("clock001")); $this->assertEquals("5aeed8bfd8e211bc3c22549691aa3ad3435d12a0", $formatter->format("CLOCK001")); $this->assertEquals("07e4d6961babbaf8c20aa367336031546dbf1591", $formatter->format("1234567890-=qwertyuiop[]asdfghjkl;'#\\zxcvbnm,./!\"£\$%^&*()_+QWERTYUIOP{}ASDFGHJKL:@~|ZXCVBNM<>?")); }
/** * * @param string $uniqueIdentifier * @param string $password * @return Atrox_Application_Security_IIdentity */ public function authenticate($uniqueIdentifier, $password) { //TODO: This won't work until PHP 5.3 //$dataSource = static::getDataSource(); $dataSource = $this->getDataSource(); $filter = $dataSource->makeFilter(); $passwordFormatter = new Atrox_Core_Data_Formatter_Password(); $filter->addConditional($dataSource->getTableName(), $this->uniqueIdentifierPropertyName, $uniqueIdentifier); $filter->addConditional($dataSource->getTableName(), $this->passwordPropertyName, $passwordFormatter->format($password)); $dataset = $dataSource->retrieve($filter); if ($entity = $dataset->getNext()) { return $entity; } return false; }