register_block('t', 'duane_translate'); $smarty->template_dir = "/home/duane/translingo.org/templates"; $smarty->compile_dir = "/home/duane/translingo.org/templates_c"; $smarty->assign("baseurl", $baseurl); $smarty->assign("titledefault", _("Welcome to")." TransLingo.org"); if($_SESSION['_config']['errmsg'] != "") { $smarty->assign('errmsg', $_SESSION['_config']['errmsg']); unset($_SESSION['_config']['errmsg']); } $smarty->display("header.tpl"); $smarty->display("login.tpl"); $smarty->display("index.tpl"); $smarty->display("footer.tpl"); exit; } class CustomAuthContainer extends Auth_Container { var $users; function CustomAuthContainer($params) { $this->users =& new DataObject_Users(); } function fetchData($email, $password) { $this->users->whereAdd("`email` = '$email'"); $this->users->whereAdd("`password` = '".md5($password)."'"); if($this->users->find(true)) { $this->users->whereAdd("`hash` = ''"); if(!$this->users->find(true)) { $_SESSION['_config']['errmsg'] = _("You haven't verified your account yet. You won't be able to log into the website until you do."); return false; } $this->users->modified = gmdate("Y-m-d H:i:s"); $this->users->whereAdd("`email`='".mysqli_real_escape_string($_SESSION['_config']['mysqli'], $email)."'"); $this->users->update(DB_DATAOBJECT_WHEREADD_ONLY); return true; } else { $_SESSION['_config']['errmsg'] = _("The email and/or password you entered were incorrect."); return false; } } function getUser($email) { $this->users->email = $email; if($this->users->find(true)) return $this->users; else return false; } } ?>