summaryrefslogtreecommitdiff
path: root/classes/User.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-16 22:14:41 -0500
committerEvan Prodromou <evan@status.net>2009-12-16 22:14:41 -0500
commit530673b3cd79d2d3f1b51b013d2b764d751bc7a2 (patch)
tree26d0e31dc2db625784b82dd670f57c49f338a426 /classes/User.php
parent2a1468ec8b2918553b490ddaef6bdede3e2d5b1b (diff)
parent7ee875b10ffbf9fae0934426d6abda2be48d01c7 (diff)
Merge branch '0.9.x' into testing0.9.0rc2
Diffstat (limited to 'classes/User.php')
-rw-r--r--classes/User.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/classes/User.php b/classes/User.php
index d04f7d679..ae709b46b 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -180,6 +180,27 @@ class User extends Memcached_DataObject
return $result;
}
+ /**
+ * Register a new user account and profile and set up default subscriptions.
+ * If a new-user welcome message is configured, this will be sent.
+ *
+ * @param array $fields associative array of optional properties
+ * string 'bio'
+ * string 'email'
+ * bool 'email_confirmed' pass true to mark email as pre-confirmed
+ * string 'fullname'
+ * string 'homepage'
+ * string 'location' informal string description of geolocation
+ * float 'lat' decimal latitude for geolocation
+ * float 'lon' decimal longitude for geolocation
+ * int 'location_id' geoname identifier
+ * int 'location_ns' geoname namespace to interpret location_id
+ * string 'nickname' REQUIRED
+ * string 'password' (may be missing for eg OpenID registrations)
+ * string 'code' invite code
+ * ?string 'uri' permalink to notice; defaults to local notice URL
+ * @return mixed User object or false on failure
+ */
static function register($fields) {
// MAGICALLY put fields into current scope
@@ -329,7 +350,7 @@ class User extends Memcached_DataObject
$profile->query('COMMIT');
- if ($email && !$user->email) {
+ if (!empty($email) && !$user->email) {
mail_confirm_address($user, $confirm->code, $profile->nickname, $email);
}