From e80bc5698f6c062341ec0561c2d155b4c427c607 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 24 Aug 2008 09:53:43 -0400 Subject: [PATCH] Updating reigster.php to work, sans emails --- register.php | 22 ++++++++++++++-------- templates/register.tpl | 4 ++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/register.php b/register.php index 550101e..ffb4790 100755 --- a/register.php +++ b/register.php @@ -30,8 +30,6 @@ $focus['user'] = 'focus'; require_once('./global.php'); require_once('./includes/api_user.php'); -APIError(array(new API_Error_Handler($message), 'user_cumulative')); - // ################################################################### if ($_POST['do'] == 'insert') @@ -147,14 +145,22 @@ if (empty($_REQUEST['do'])) $message->error(T('Sorry, we don\'t allow new registrations.')); } - foreach (bugdar::$datastore['language'] AS $value => $temp) + foreach (bugdar::$datastore['language'] as $value => $temp) { - $label = $temp['title']; - $selected = ($value == $input->in['languageid']); - eval('$opts .= "' . $template->fetch('selectoption') . '";'); + $tpl = new BSTemplate('selectoption'); + $tpl->vars = array( + 'value' => $value, + 'label' => $temp['title'], + 'selected' => ($value == $input->in['languageid']) + ); + $opts .= $tpl->evaluate()->getTemplate(); } - eval('$template->flush("' . $template->fetch('register') . '");'); + $tpl = new BSTemplate('register'); + $tpl->vars = array( + 'opts' => $opts + ); + $tpl->evaluate()->flush(); } // ################################################################### @@ -162,7 +168,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'activate') { $input->inputClean('userid', TYPE_UINT); - if ($useractivation = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $input->in['userid'] . " AND activator = '" . $bugsys->input_escape('activator') . "'")) + if ($useractivation = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $input->in['userid'] . " AND activator = '" . $input->inputEscape('activator') . "'")) { $user = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = " . $input->in['userid']); $db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = $useractivation[usergroupid] WHERE userid = " . $input->in['userid']); diff --git a/templates/register.tpl b/templates/register.tpl index 99e9d6c..63a37cd 100644 --- a/templates/register.tpl +++ b/templates/register.tpl @@ -8,7 +8,7 @@ -$header +<%- $header %> <% if ($show['errors']): %>
@@ -30,7 +30,7 @@ $header
<%-T("Display Name")%>:
<%-T("Password")%>:
<%-T("Confirm Password")%>:
-
<%-T("Show My Email Publicly")%>: checked="checked"<% endif %> /> <%-T("Yes")%>
+
<%-T("Show My Email Publicly")%>: in['showemail']): %> checked="checked"<% endif %> /> <%-T("Yes")%>
<%-T("Language")%>:
-- 2.43.5