[Feed-collector-svn] SF.net SVN: feed-collector: [90] trunk
Status: Beta
Brought to you by:
c167
|
From: <c1...@us...> - 2007-01-04 18:18:43
|
Revision: 90
http://feed-collector.svn.sourceforge.net/feed-collector/?rev=90&view=rev
Author: c167
Date: 2007-01-04 10:18:34 -0800 (Thu, 04 Jan 2007)
Log Message:
-----------
working now, XHTML-valid
Modified Paths:
--------------
trunk/page_register.php
trunk/styles/default/page_register-screen.css
Modified: trunk/page_register.php
===================================================================
--- trunk/page_register.php 2007-01-04 14:52:53 UTC (rev 89)
+++ trunk/page_register.php 2007-01-04 18:18:34 UTC (rev 90)
@@ -69,6 +69,17 @@
}
+##############
+# HTTP-Class #
+##############
+require_once "HTTP.php";
+
+################
+# User-Manager #
+################
+require_once "class/User_manager.php";
+$user = new User_manager($db);
+
#####################
# BUILD THE CONTENT #
#####################
@@ -112,7 +123,7 @@
$main = "";
//if (empty ($_POST['username']) or empty ($_POST['mail']) or empty ($_POST['passwd1']) or empty ($_POST['passwd2'])) {
-if (isset ($_POST) and is_array($_POST)) {
+/*if (isset ($_POST) and is_array($_POST)) {
if (isset ($_POST['username']) and isset ($_POST['mail']) and isset ($_POST['passwd1']) and isset ($_POST['passwd2']) and isset ($_POST['language'])) {
if (md5($_POST['passwd1']) === md5($_POST['passwd2'])) {
$passwd_checked = checkPassword($_POST['passwd1']);
@@ -132,6 +143,17 @@
}
} else {
+}*/
+if (isset ($_POST['username']) and isset ($_POST['mail']) and isset ($_POST['passwd1']) and isset ($_POST['passwd2']) and isset ($_POST['language'])) {
+ if(true === $user->reg_checkPasswordEquality($_POST['passwd1'], $_POST['passwd2'])) {
+ if(true === $user->reg_registrateUser($_POST['username'], $_POST['mail'], md5($_POST['passwd1']), $_POST['language'])) {
+ HTTP :: redirect("./page_main.php");
+ } else {
+ buildForm($main, _("An error occured"));
+ }
+ }
+} else {
+ buildForm($main);
}
$design = str_replace("<!-- main -->", $main, $design);
@@ -143,36 +165,49 @@
echo $design;
function buildForm(& $form, $message = null) {
- $form = sprintf(" <h1>%s</h1>\n <p>%s</p>", _("Registration"), _("<b>Why register?</b><br />\n If you register, you'll have a personal page with lots of free space to place your favourite newsfeeds (only limited by your screen)"));
+ $form = sprintf(" <h1>%s</h1>\n <p>%s</p>\n", _("Registration"), _("<b>Why register?</b><br />\n If you register, you'll have a personal page with lots of free space to place your favourite newsfeeds (only limited by your screen)"));
if (!is_null($message)) {
$form .= sprintf(" <h2>%s</h2>\n", $message);
}
$form .= sprintf(" <div id=\"registration_form\">\n" .
" <form action=\"%s\" method=\"post\" accept-charset=\"UTF-8\">\n" .
- " <div id=\"formtitle\">%s</div>\n" .
- " <div id=\"left\">\n" .
- " <div class=\"formElem\">%s</div>\n" .
- " <div class=\"formElem\">%s</div>\n" .
- " <div class=\"formElem\">%s</div>\n" .
- " <div class=\"formElem\">%s</div>\n" .
- " <div class=\"formElem\">%s</div>\n" .
- " <div class=\"formElem\">%s</div>\n" .
- " </div>\n" .
- " <div id=\"right\">\n" .
- " <div class=\"formField\"><input type=\"text\" name=\"username\" size=\"30\" maxlength=\"30\" /></div>\n" .
- " <div class=\"formField\"><input type=\"text\" name=\"mail\" size=\"30\" maxlength=\"30\" /></div>\n" .
- " <div class=\"formField\"><input type=\"text\" name=\"passwd1\" size=\"30\" maxlength=\"30\" /></div>\n" .
- " <div class=\"formField\"><input type=\"text\" name=\"passwd2\" size=\"30\" maxlength=\"30\" /></div>\n" .
- " <div class=\"formField\"><input type=\"text\" name=\"option_list1\" size=\"30\" maxlength=\"30\" /></div>\n" .
- " <div class=\"formField\"><input type=\"text\" name=\"option_list2\" size=\"30\" maxlength=\"30\" /></div>\n" .
- " </div>\n" .
- " <div id=\"formButtons\">\n" .
- " <input type=\"submit\" value=\"%s\" name=\"submit\" />\n" .
- " <input type=\"reset\" value=\"%s\" />\n" .
- " </div>\n" .
+ " <table summary=\"\">\n" .
+ " <tr>\n" .
+ " <th colspan=\"2\" id=\"formtitle\">%s</th>\n" .
+ " </tr>\n" .
+ " <tr>\n" .
+ " <td class=\"formElem\">%s</td>\n" .
+ " <td class=\"formField\"><input type=\"text\" name=\"username\" size=\"30\" maxlength=\"30\" /></td>\n" .
+ " </tr>\n" .
+ " <tr>\n" .
+ " <td class=\"formElem\">%s</td>\n" .
+ " <td class=\"formField\"><input type=\"text\" name=\"mail\" size=\"30\" maxlength=\"30\" /></td>\n" .
+ " </tr>\n" .
+ " <tr>\n" .
+ " <td class=\"formElem\">%s</td>\n" .
+ " <td class=\"formField\"><input type=\"password\" name=\"passwd1\" size=\"30\" maxlength=\"30\" /></td>\n" .
+ " </tr>\n" .
+ " <tr>\n" .
+ " <td class=\"formElem\">%s</td>\n" .
+ " <td class=\"formField\"><input type=\"password\" name=\"passwd2\" size=\"30\" maxlength=\"30\" /></td>\n" .
+ " </tr>\n" .
+ " <tr>\n" .
+ " <td class=\"formElem\">%s</td>\n" .
+ " <td class=\"formField\">\n" .
+ " <select name=\"language\">\n" .
+ " <option value=\"en_EN\">%s</option>\n" .
+ //" <option value=\"de_DE\" selected=\"selected\">German</option>\n" .
+ " <option value=\"de_DE\">%s</option>\n" .
+ " </select>\n" .
+ " </td>\n" .
+ " </tr>\n" .
+ " <tr id=\"formButtons\">\n" .
+ " <td colspan=\"2\"><input type=\"submit\" value=\"%s\" name=\"submit\" /><input type=\"reset\" value=\"%s\" /></td>\n" .
+ " </tr>\n" .
+ " </table>\n" .
" </form>\n" .
" <p id=\"required\">All fields are required</p>\n" .
- " </div>\n", $_SERVER['PHP_SELF'], _("Registration information"), _("Username"), _("E-MAIL-address"), _("Password"), _("Repeat password"), _("opt1"), _("opt2"), _("Submit!"), _("Reset!"));
+ " </div>\n", $_SERVER['PHP_SELF'], _("Registration information"), _("Username"), _("E-MAIL-address"), _("Password"), _("Repeat password"), _("Language"), _("English"), _("German"), _("Submit!"), _("Reset!"));
}
function checkPassword($pass) {
Modified: trunk/styles/default/page_register-screen.css
===================================================================
--- trunk/styles/default/page_register-screen.css 2007-01-04 14:52:53 UTC (rev 89)
+++ trunk/styles/default/page_register-screen.css 2007-01-04 18:18:34 UTC (rev 90)
@@ -234,40 +234,30 @@
border-bottom: 1px solid rgb(204, 204, 204);
}
-#left,#right {
- margin: 1em 0;
- margin-top: 0em;
- /* padding: 0 2%;*/
- float: left;
+table {
+ width: 100%;
}
-#left {
- width: 45%;
- border-right: 1px solid rgb(204, 204, 204);
-}
-
-#right {
- width: 45%;
-}
-
.formElem,.formField {
- /*margin: 1em 0;*/
- padding-top: 1em;
+ padding-top: 0em;
padding-left: 1em;
+
}
.formElem {
border-bottom: 1px solid rgb(204, 204, 204);
- padding-top: 7%;
+ padding-top: 2%;
+ padding-left: 5%;
}
.formField {
border-bottom: 1px solid rgb(204, 204, 204);
- padding-top: 7%;
-
+ padding-top: 2%;
+ padding-left: 5%;
+ border-left: 1px solid rgb(204, 204, 204);
}
-#registration_form #formButtons {
+#formButtons {
text-align: center;
background-color: rgb(117, 144, 174);
margin-top: 16em;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|