The state of of the user registration functionality

This commit is contained in:
Tim Almdal
2008-11-14 18:16:13 +00:00
parent d7745f2ad8
commit bd1ec2df1f
4 changed files with 77 additions and 29 deletions

View File

@@ -24,14 +24,21 @@ class User_Controller extends REST_Controller {
* @see Rest_Controller::_get($resource)
*/
public function _get($user) {
$template = new View("user_registration.html");
// @todo: this needs to be data-driven
$theme = new Theme("default", $template);
$template->set_global('user', Session::instance()->get('user', null));
print $template->render();
$userView = new View("user.html");
if (empty($user)) {
// @todo remove this when rest_controller is changed to handle a post with no id
$user = ORM::factory("user");
$user->save();
// @todo remove this when rest_controller is changed to handle a post with no id ^
$userView->user_id = $user->id;
$userView->action = _("User Registration");
$userView->button_text = _("Register");
} else {
$userView->user_id = $user->id;
$userView->action = _("User Modify");
$userView->button_text = _("Modify");
}
print $userView;
}
/**