From ae7839ffaada72c522ffcd9b3f4f1cc04027a720 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 15 Nov 2008 06:23:09 +0000 Subject: Revise the user login code. * Remove user registration link and popup from the theme; this shouldn't be done in a popup. Use ajaxform to simplify the way that we load the login popup. * Create form.html.php, this is a template for Forge based forms. * Move user validation rules into User_Model and let forms populate the rules into their forms as useful. * Undo r18688's changes regarding the REST code. We should never accept a null resource, this breaks the REST abstraction. * Change login and user controllers to use Forge which lets us delete login.html.php and user.html.php since those now are generated by the theme-owned form template --- modules/user/models/user.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/user/models') diff --git a/modules/user/models/user.php b/modules/user/models/user.php index b09af033..1c56b34e 100644 --- a/modules/user/models/user.php +++ b/modules/user/models/user.php @@ -20,6 +20,11 @@ class User_Model extends ORM { protected $has_and_belongs_to_many = array("groups"); + var $validation_rules = array( + "name" => "required|length[4,32]", + "email" => "valid_email", + "password" => "required|length[5,40]"); + public function __set($column, $value) { switch ($column) { case "password": -- cgit v1.2.3