<?php

/**
 * class auth_reminder_form
 *
 * Description for class auth_reminder_form
 *
 * @author:
*/
namespace form;

use core\form;

class auth_reminder_form extends form {
	public $email = "";

	public function init() {
		$this->addElement("email", array("required"));
	}

	public function valid() {
		if(!$this->send) {
			return false;
		}

		$valid = true;

		$this->email = $this->getElement("email")->getValue();
		if(empty($this->email)) {
			$this->elements["email"]->setError("Pole wymagane");
			$valid = false;
		} elseif(!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {
			$this->elements["email"]->setError("Podaj poprawny adres e-mail");
			$valid = false;
		}
		
		return $valid;
	}
}
?>