if (isset($_POST['register-captcha'])) { $inputValue[4] = ""; /* we need to always clear the captcha field, because it will regenerate after a reresh*/ if ($Error->captcha($_POST['register-captcha'])) { $errorClass[4] = 'success'; } else { $errorClass[4] = 'error'; } } else { if (isset($_POST['action'])) { $Error->add('error', 'Captcha cannot be left empty'); $errorClass[4] = 'error'; } } // Instantiontiate the erroring before we need to refresh the page $msg = $Error->alert(); // Check if the form was submitted without any errors. if (isset($_POST['register-username']) && isset($_POST['register-password']) && isset($_POST['register-confirm']) && isset($_POST['register-email']) && isset($_POST['register-captcha']) && !$Error->ok()) { $complete = true; // Create the actual user Auth::createNewUser($_POST['register-username'], $_POST['register-password'], $_POST['register-email']); $userId = Auth::userId($_POST['register-username']); $link = full_url_to_script('activate.php') . "?action=activate&code=" . Activation::get($userId) . "&id=" . $userId; //echo $link; Emailtemplate::setBaseDir('./assets/email_templates'); $html = Emailtemplate::loadTemplate('activation', array('title' => 'Activation Email', 'prettyName' => Options::get('prettyName'), 'name' => $_POST['register-username'], 'siteName' => Options::get('emailName'), 'activationLink' => $link, 'footerLink' => Options::get('siteName'), 'footerEmail' => Options::get('emailInfo'))); send_html_mail(array($_POST['register-username'] => $_POST['register-email']), 'Activation Email', $html, array(Options::get('siteName') => Options::get('emailAdmin'))); } Template::setBaseDir('./assets/tmpl'); $html = Template::loadTemplate('layout', array('header' => Template::loadTemplate('header', array('title' => $title, 'user' => $user, 'admin' => $isadmin, 'msg' => $msg, 'meta' => $meta, 'selected' => 'register')), 'content' => Template::loadTemplate('register', array('errorClass' => $errorClass, 'inputValue' => $inputValue, 'complete' => $complete, 'callback' => $callback)), 'footer' => Template::loadTemplate('footer', array('time_start' => $time_start)))); echo $html;
function login() { Template::setBaseDir('views/tutorial'); Template::display('loginl.html'); }
/*** include the path for the library utill ***/ //todo:modle the autoload properly /*** auto load model classes ***/ function __autoload($class_name) { $filename = strtolower($class_name) . '.Model.php'; $file = __SITE_PATH . '/model/' . $filename; if (file_exists($file) == false) { return false; } include $file; } /**A function used to load Dodeye library * @param String $path of the Class to inport e.g <"Dodeye.util.basic"> * @return requirement to the path */ function pitch($path) { $path = str_replace('.', "\\", $path); $path = $path . ".php"; return require_once "{$path}"; } /*** a new registry object ***/ $registry = new Registry(); $registry->dodeye = new Dodeye($registry); /**creating the database reg object ***/ $registry->db = DB::getDB(LorbConfig::getConfig()->getDefaultDB()); $registry->cfg = LorbConfig::getConfig(); $registry->maps = Maps::getInstance(); Template::setBaseDir(); $registry->front = new FrontController($registry);
public function comps() { Template::setBaseDir('views/login'); Template::display('show.php', array()); }