public function testAuthenticate() { $user = new Person(); $user->setUsername($this->testUsername); $user->setPassword($this->testPassword); $this->assertTrue($user->authenticate($this->testPassword)); }
public function testAuthenticationMethodDefaultsToLocal() { $person = new Person(); $person->setFirstname('First'); $person->setLastname('Last'); $person->setEmail('test@localhost'); $person->setUsername('test'); $person->validate(); $this->assertEquals('local', $person->getAuthenticationMethod()); }
<?php /** * @copyright 2012-2013 City of Bloomington, Indiana * @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt * @author Cliff Ingham <*****@*****.**> */ use Application\Models\Person; include '../configuration.inc'; $person = new Person(); $person->setFirstname('Administrator'); $person->setLastname('Person'); $person->setEmail('*****@*****.**'); $person->setUsername('admin'); //$person->setPassword(); $person->setAuthenticationMethod('Employee'); $person->setRole('Administrator'); $person->save();
* * This script should only be used by people with root access * on the web server. * If you are planning on using local authentication, you must * provide a password here. The password will be encrypted when * the new person's account is saved * * If you are doing Employee or CAS authentication you do * not need to save a password into the database. * * @copyright 2011-2014 City of Bloomington, Indiana * @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt * @author Cliff Ingham <*****@*****.**> */ use Application\Models\Person; include '../configuration.inc'; $person = new Person(); // Fill these out as needed $person->setFirstname('Admin'); $person->setLastname('Person'); $person->setUsername('administrator'); $person->setAuthenticationMethod('local'); #$person->setPassword(''); // You most likely want Administrator $person->setRole('Administrator'); $person->save(); // Don't forget to create an email address $email = new Email(); $email->setPerson($person); $email->setEmail('admin@localhost'); $email->save();