summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-07-13 23:49:20 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-07-13 23:49:20 +0200
commit6b69fa8cc2c1ca138b949d7b3b2e638f69ee1afc (patch)
tree5f5525a6b753f20d363b7625f87af9021f72efc2
parent7d745f0577ad7e660f2836729682c43ec4b39aeb (diff)
Switch to bootstrap div form code instead of tables
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/controllers/user.php4
-rw-r--r--application/views/user/hash_password.php33
-rw-r--r--application/views/user/login.php32
-rw-r--r--application/views/user/register.php53
-rw-r--r--application/views/user/reset_password_form.php33
-rw-r--r--application/views/user/reset_password_username_form.php23
6 files changed, 109 insertions, 69 deletions
diff --git a/application/controllers/user.php b/application/controllers/user.php
index abbb846a3..42f9e35ae 100644
--- a/application/controllers/user.php
+++ b/application/controllers/user.php
@@ -138,7 +138,7 @@ class User extends CI_Controller {
$referrer = $query["user"];
- if ($process) {
+ if ($process !== false) {
$username = $this->input->post("username");
$email = $this->input->post("email");
$password = $this->input->post("password");
@@ -390,7 +390,7 @@ class User extends CI_Controller {
$this->data["hash"] = false;
$this->data["password"] = $password;
- if ($process) {
+ if ($process !== false) {
if (!$password || $password != $password_confirm) {
$error[]= "No password or passwords don't match.";
} else {
diff --git a/application/views/user/hash_password.php b/application/views/user/hash_password.php
index 13e4ffcd3..d85d2810c 100644
--- a/application/views/user/hash_password.php
+++ b/application/views/user/hash_password.php
@@ -9,18 +9,25 @@ if ($hash) {
echo "<p>Result (this hash uses a random salt, so it will be different each time you submit this form):<br />$hash</p>\n";
}
?>
-<?php echo form_open('user/hash_password'); ?>
- <table>
- <tr>
- <td>Password</td>
- <td> <input type="password" name="password" /></td>
- </tr><tr>
- <td>Confirm password</td>
- <td> <input type="password" name="password_confirm" /></td>
- </tr><tr>
- <td></td>
- <td><input type="submit" value="Hash it" name="process" /></td>
- </tr>
- </table>
+<?php echo form_open('user/hash_password', array("class" => "form-horizontal")); ?>
+ <div class="control-group">
+ <label class="control-label" for="inputPassword">Password</label>
+ <div class="controls">
+ <input type="password" id="inputPassword" name="password" placeholder="Password">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="inputPassword">Confirm password</label>
+ <div class="controls">
+ <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <div class="controls">
+ <button type="submit" class="btn btn-primary" name="process">Hash it</button>
+ </div>
+ </div>
</form>
diff --git a/application/views/user/login.php b/application/views/user/login.php
index 21264a404..761965c94 100644
--- a/application/views/user/login.php
+++ b/application/views/user/login.php
@@ -3,16 +3,24 @@ if (isset($login_error)) { ?>
<div class="alert alert-error">The entered credentials are invalid.</div>
<?php } ?>
-<?php echo form_open('user/login'); ?>
- <table>
- <tr>
- <td>Username:</td>
- <td><input type="text" name="username" /></td>
- </tr>
- <tr>
- <td>Password:</td>
- <td><input type="password" name="password" /></td>
- </tr>
- </table>
- <input type="submit" class="btn btn-primary" value="Login" name="process" />
+<?php echo form_open('user/login', array("class" => "form-horizontal")); ?>
+ <div class="control-group">
+ <label class="control-label" for="inputUsername">Username</label>
+ <div class="controls">
+ <input type="text" id="inputUsername" name="username" placeholder="Username">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="inputPassword">Password</label>
+ <div class="controls">
+ <input type="password" id="inputPassword" name="password" placeholder="Password">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <div class="controls">
+ <button type="submit" class="btn btn-primary" name="process">Login</button>
+ </div>
+ </div>
</form>
diff --git a/application/views/user/register.php b/application/views/user/register.php
index 5fe368c99..c0050508b 100644
--- a/application/views/user/register.php
+++ b/application/views/user/register.php
@@ -3,24 +3,39 @@
echo implode("<br />\n", $error);
echo "</p>";
} ?>
-<?php echo form_open('user/register/'.$key); ?>
- <table>
- <tr>
- <td>Username</td>
- <td> <input type="text" name="username" value="<?php echo $values["username"]; ?>" /></td>
- </tr><tr>
- <td>Email</td>
- <td> <input type="text" name="email" value="<?php echo $values["email"]; ?>" /></td>
- </tr><tr>
- <td>Password</td>
- <td> <input type="password" name="password" /></td>
- </tr><tr>
- <td>Confirm password</td>
- <td> <input type="password" name="password_confirm" /></td>
- </tr><tr>
- <td></td>
- <td><input type="submit" value="Register" name="process" /></td>
- </tr>
- </table>
+<?php echo form_open('user/register/'.$key, array("class" => "form-horizontal")); ?>
+ <div class="control-group">
+ <label class="control-label" for="inputUsername">Username</label>
+ <div class="controls">
+ <input type="text" id="inputUsername" name="username" placeholder="Username" value="<?php echo $values["username"]; ?>">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="inputEmail">Email</label>
+ <div class="controls">
+ <input type="text" id="inputEmail" name="email" placeholder="Email" value="<?php echo $values["email"]; ?>">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="inputPassword">Password</label>
+ <div class="controls">
+ <input type="password" id="inputPassword" name="password" placeholder="Password">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="inputPassword">Confirm password</label>
+ <div class="controls">
+ <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <div class="controls">
+ <button type="submit" class="btn btn-primary" name="process">Register</button>
+ </div>
+ </div>
</form>
diff --git a/application/views/user/reset_password_form.php b/application/views/user/reset_password_form.php
index 9bcbe3697..a6da56708 100644
--- a/application/views/user/reset_password_form.php
+++ b/application/views/user/reset_password_form.php
@@ -3,18 +3,25 @@
echo implode("<br />\n", $error);
echo "</p>";
} ?>
-<?php echo form_open('user/reset_password/'.$key); ?>
- <table>
- <tr>
- <td>Password</td>
- <td> <input type="password" name="password" /></td>
- </tr><tr>
- <td>Confirm password</td>
- <td> <input type="password" name="password_confirm" /></td>
- </tr><tr>
- <td></td>
- <td><input type="submit" value="Change Password" name="process" /></td>
- </tr>
- </table>
+<?php echo form_open('user/reset_password/'.$key, array("class" => "form-horizontal")); ?>
+ <div class="control-group">
+ <label class="control-label" for="inputPassword">Password</label>
+ <div class="controls">
+ <input type="password" id="inputPassword" name="password" placeholder="Password">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="inputPassword">Confirm password</label>
+ <div class="controls">
+ <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <div class="controls">
+ <button type="submit" class="btn btn-primary" name="process">Send mail</button>
+ </div>
+ </div>
</form>
diff --git a/application/views/user/reset_password_username_form.php b/application/views/user/reset_password_username_form.php
index dde6d5aa0..674a6441d 100644
--- a/application/views/user/reset_password_username_form.php
+++ b/application/views/user/reset_password_username_form.php
@@ -1,12 +1,15 @@
-<?php echo form_open('user/reset_password'); ?>
- <table>
- <tr>
- <td>Username</td>
- <td> <input type="text" name="username" /></td>
- </tr><tr>
- <td></td>
- <td><input type="submit" value="Send mail" name="process" /></td>
- </tr>
- </table>
+<?php echo form_open('user/reset_password', array("class" => "form-horizontal")); ?>
+ <div class="control-group">
+ <label class="control-label" for="inputUsername">Username</label>
+ <div class="controls">
+ <input type="text" id="inputUsername" name="username" placeholder="Username" value="<?php echo isset($username) ? $username : ""; ?>">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <div class="controls">
+ <button type="submit" class="btn btn-primary" name="process">Send mail</button>
+ </div>
+ </div>
</form>