DBObj = SiteMap::getObj('Member/Member.php');
}
function &getForm()
{
require_once 'class/Form/Form.class.php';
$form = new Form($this->Doc, 'form', 'post');
$form->addElement('text', 'email', 'What is your Email?', array('style' => 'width:200px;'));
$form->addRule('email', 'Email is in wrong format', 'email');
$form->addRule('email', 'Email is in wrong format', 'email', NULL, 'client');
$form->addRule('email', 'Email is required', 'required');
$form->addRule('email', 'Email is required', 'required', NULL, 'client');
$form->addFormRule(array($this, 'validForm'));
return $form;
}
function validForm($data)
{
$err = array();
$userData = $this->DBObj->getMemberByEmail($data['email']);
if (!isset($userData['id'])) {
$err['email'] = 'User with such email is not registered';
}
if (!Member::isActive($userData)) {
require_once('app/Settings/Settings.php');
$emails = implode('%2C%20', Settings::getAdminEmails());
$err['email'] = 'Your current account status is not active.
Please contact Site Administrator for details.';
}
return (empty($err))?true:$err;
}
function sendMail($data, $user){
$html = "\n