Location: PHPKode > projects > DIY Blog > diy-blog/classes/diy-blog/backend/controller/forms/LoginForm.class.php
<?php

/**
 * Abstracts login request parameters.
 * @package diy-blog.backend.controller.forms
 * @author	Martynas Jusevicius <hide@address.com>
 * @link	http://www.xml.lt
 */

class LoginForm extends Form
{
	private $userName = null;
	private $password = null;
	
	public function __construct(Request $request)
	{
		$this->userName = $request->getParameter("username");
		$this->password = $request->getParameter("password");
	}
	
	public function getUserName()
	{
		return $this->userName;
	}

	public function getPassword()
	{
		return $this->password;
	}

	public function validate()
	{
		$errors = array();

		if ($this->userName == null) $errors[] = new Error("noUserName");
		if ($this->password == null) $errors[] = new Error("noPassword");

		return $errors;
	}
}

?>
Return current item: DIY Blog