Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed registration bug, updated readme

  • Loading branch information...
commit e46f51af1276b2129613272de0af8e64fb7d7939 1 parent bc876af
@mdolon mdolon authored
View
22 README
@@ -1,14 +1,10 @@
-
Simple jQuery Mobile MVC Framework in PHP
-=========================================
-For more information, check out the article at:
-http://devgrow.com/jquery-mobile-php-mvc-framework/
-
-This is meant to serve as a simple basis for
-more complex jQuery Mobile applications that
-can benefit from an MVC architecture.
-
-All files are released under GPL - feel free to
-use it however you'd like. Attribution or a link
-back to the article is appreciated but absolutely
-NOT required.
+============
+
+For more information, check out the article at: http://devgrow.com/jquery-mobile-php-mvc-framework/
+
+This is meant to serve as a simple basis for more complex jQuery Mobile applications that can benefit from an MVC architecture.
+
+All files are released under GPL - feel free to use it however you'd like. Attribution or a link back to the article is appreciated but absolutely NOT required.
+
+The current version uses PHP PDO to connect to an SQLite database.
View
9 lib/controllers/user.php
@@ -22,8 +22,8 @@ function index(){
global $template, $user;
login_required();
- $template->assign('user_name',$user->name);
- $template->assign('user_email',$user->email);
+ $template->assign('user_name', $user->name);
+ $template->assign('user_email', $user->email);
$template->set_title('My Profile');
$template->render("user","profile",true);
}
@@ -63,8 +63,7 @@ function logout(){
$user->logout();
$template->set_msg($user->msg, $user->ok);
}
- $template->set_title('Login');
- $template->render("user","login",true);
+ return_to('user/login');
}
/**
@@ -94,7 +93,7 @@ function register(){
if($_POST['return_to'])
return_to($_POST['return_to']);
else
- return_to("home");
+ return_to("site/home");
}
$template->set_msg($user->msg, $user->ok);
$template->assign('email',$_POST['email']);
View
2  lib/models/user.php
@@ -258,7 +258,7 @@ function check($email, $secret) {
{
if(md5($results[0]['id'] . $results[0]['email']) == $secret) {
$this->user_id = $results[0]['id'];
- $this->email = $results[0]['email'];
+ $this->email = $email;
$this->name = $results[0]['name'];
$this->ok = true;
$this->is_logged = true;
View
2  lib/views/user/edit.php
@@ -1,7 +1,7 @@
<h2>Update Contact Info</h2>
<p><strong>Note:</strong> Only enter your password if you wish to change it, otherwise leave it blank.</p>
- <form action='edit' method='post' class='register-form'>
+ <form action='/user/edit' method='post' class='register-form'>
<p>
<label for='name'>Name:</label>
<input type='text' name='name' class='text' id='name' value='<?php __('user_name'); ?>' />
View
2  lib/views/user/login.php
@@ -3,7 +3,7 @@
<p>Please login to view your order status or support requests.</p>
- <form method="post" action="login">
+ <form method="post" action="/user/login">
<div data-role="fieldcontain">
<label for="email" class="ui-input-text">E-mail Address:</label>
<input type="text" name="email" class="text" id="email" value="" />
View
2  lib/views/user/register.php
@@ -1,6 +1,6 @@
<h2>Register</h2>
- <form action='' method='post' class='register-form'>
+ <form action='/user/register' method='post' class='register-form'>
<p>
<label for='name'>Name:</label>
<input type='text' name='name' class='text' id='name' value='' />
Please sign in to comment.
Something went wrong with that request. Please try again.