summaryrefslogtreecommitdiff
path: root/classes/User.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-20 14:57:56 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-20 14:57:56 -0400
commit5d1a6f0fef3b99167babfa304ceda9b67720f399 (patch)
tree451830a55e2cacac2d224ac85a6e2d74a57a36ac /classes/User.php
parenta9c57467e77f5420cca866d5e4c28b10da2f75fc (diff)
add validation methods to classes
darcs-hash:20080520185756-84dde-290bc12cddfc1738a96385e95821d466eff11196.gz
Diffstat (limited to 'classes/User.php')
-rw-r--r--classes/User.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/classes/User.php b/classes/User.php
index 8986053c5..8effd856a 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -22,6 +22,7 @@ if (!defined('LACONICA')) { exit(1); }
* Table Definition for user
*/
require_once 'DB/DataObject.php';
+require_once 'Validate.php';
class User extends DB_DataObject
{
@@ -59,4 +60,13 @@ class User extends DB_DataObject
$sub->subscribed = $other->id;
return $sub->find();
}
+
+ function validateEmail() {
+ return Validate::email($this->email, true);
+ }
+
+ function validateNickname() {
+ return Validate::string($this->nickname, array('min_length' => 1, 'max_length' => 64,
+ 'format' => VALIDATE_ALPHA_LOWER . VALIDATE_NUM));
+ }
}