From 92722ab8471764037187a3169cee28b686367c7c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 15 Aug 2008 13:42:19 +0000 Subject: Central: Converted register.php Refs #25 --- central/trunk/register.php | 86 +++++++++++++------------------------- central/trunk/theme/activated.tpl | 21 +++++----- central/trunk/theme/register.tpl | 72 +++++++++++++++++++++++++++++++ central/trunk/theme/registered.tpl | 14 +++++++ 4 files changed, 127 insertions(+), 66 deletions(-) create mode 100644 central/trunk/theme/register.tpl create mode 100644 central/trunk/theme/registered.tpl diff --git a/central/trunk/register.php b/central/trunk/register.php index 8322861..0d4d61d 100644 --- a/central/trunk/register.php +++ b/central/trunk/register.php @@ -33,21 +33,9 @@ if (!isset($_GET['submit'])) $send = instaDisc_sendActivationEmail($_POST['username'], $_POST['password'], $_POST['email']); if ($send === TRUE) { -?> - - - <?php echo(instaDisc_getConfig('siteName')); ?> InstaDisc Central Server - - -
-

InstaDisc Registration

- -

Thank you for registering! An activation email has been sent to the address you provided. When you recieve it, copy the - code inside to the Activation page. -

- - -add('SITENAME', instaDisc_getConfig('siteName')); + $template->display(); } else { addError($numOfErrors, $errors, '', $send); showForm($_POST['username'], $_POST['password'], $_POST['email'], $errors); @@ -57,49 +45,33 @@ if (!isset($_GET['submit'])) function showForm($username, $password, $email, $errors) { -?> - - - <?php echo(instaDisc_getConfig('siteName')); ?> InstaDisc Central Server - - - -
-

InstaDisc Registration

- -

If you would like to sign up for our InstaDisc service, please fill out the form below. -

- -
-add('SITENAME', instaDisc_getConfig('siteName')); + if (isset($errors[1])) { -?>
Uh oh! Validation errors!

-

    adds('ERROR', array('ex'=>'1')); + foreach ($errors as $name => $value) { -?>
  1. adds('ERRORS', array( 'NAME' => $name, + 'MSG' => $value['msg'])); } -?>
-
User Details -
- - -
-
- - -
-
- - -
-
-
- -
add('USERNAME_ERR', ifErrors($errors, 'username')); + $template->add('PASSWORD_ERR', ifErrors($errors, 'password')); + $template->add('EMAIL_ERR', ifErrors($errors, 'email')); + + doErrors($template, $errors, 'username'); + doErrors($template, $errors, 'password'); + doErrors($template, $errors, 'email'); + + $template->add('USERNAME', $username); + $template->add('PASSWORD', $password); + $template->add('EMAIL', $email); + + $template->display(); } function ifErrors($errors, $id) @@ -108,19 +80,21 @@ function ifErrors($errors, $id) { if ($value['field'] == $id) { - echo(' error'); - return; + return ' error'; } } + + return ''; } -function doErrors($errors, $id) +function doErrors($template, $errors, $id) { foreach ($errors as $name => $value) { if ($value['field'] == $id) { -?>

*

adds(strtoupper($id) . '_ERRS', array( 'NAME' => $name, + 'VALUE' => $value['msg'])); } } } diff --git a/central/trunk/theme/activated.tpl b/central/trunk/theme/activated.tpl index 43c716f..ee265e7 100644 --- a/central/trunk/theme/activated.tpl +++ b/central/trunk/theme/activated.tpl @@ -1,14 +1,15 @@ - - <!--SITENAME--> InstaDisc Central Server - - -
-

InstaDisc Activation

+ + <!--SITENAME--> InstaDisc Central Server + -

Thank you for activating! You've now been signed up for the InstaDisc service. - You will recieve an email with the information to input into your InstaDisc client. -

- + +
+

InstaDisc Activation

+ +

Thank you for activating! You've now been signed up for the InstaDisc service. + You will recieve an email with the information to input into your InstaDisc client. +

+ diff --git a/central/trunk/theme/register.tpl b/central/trunk/theme/register.tpl new file mode 100644 index 0000000..41fa6e9 --- /dev/null +++ b/central/trunk/theme/register.tpl @@ -0,0 +1,72 @@ + + + <!--SITENAME--> InstaDisc Central Server + + + + +
+

InstaDisc Registration

+ +

If you would like to sign up for our InstaDisc service, please fill out the form below. +

+ +
+ + +
Uh oh! Validation errors!

+

    + + + +
  1. + + + +
+
+ + +
+ User Details + +
+ +

* + +

+ + + + +
+ +
+ +

* + +

+ + + + +
+ + +
+ +
+ +
+
+ + diff --git a/central/trunk/theme/registered.tpl b/central/trunk/theme/registered.tpl new file mode 100644 index 0000000..9a473e1 --- /dev/null +++ b/central/trunk/theme/registered.tpl @@ -0,0 +1,14 @@ + + + <!--SITENAME--> InstaDisc Central Server + + + +
+

InstaDisc Registration

+ +

Thank you for registering! An activation email has been sent to the address you provided. When you recieve it, copy the + code inside to the Activation page. +

+ + -- cgit 1.4.1