aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-01 13:55:17 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-01 13:55:17 +0000
commitc6c78290c26a2784c641571d20cdba58a6863d9b (patch)
tree0bedeb9f3885022634d52a47c5c37ceef0a64ca1 /engine
parentd84f0ab941b3efa71184f91ccbff064035830ac3 (diff)
downloadelgg-c6c78290c26a2784c641571d20cdba58a6863d9b.tar.gz
elgg-c6c78290c26a2784c641571d20cdba58a6863d9b.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Moved import to ElggEntity git-svn-id: https://code.elgg.org/elgg/trunk@301 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/users.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index d717cd576..1c5b35757 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -455,5 +455,27 @@
return new ElggUser($row);
return false;
- }
+ }
+
+ /**
+ * Import a user.
+ * This function checks the passed XML doc (as array) to see if it is a user, if so it constructs a new
+ * elgg user and returns "true" to inform the importer that it's been handled.
+ */
+ function import_user_plugin_hook($hook, $entity_type, $returnvalue, $params)
+ {
+ $name = $params['name'];
+ $element = $params['element'];
+
+ if ($name == 'ElggUser')
+ {
+ $tmp = new ElggUser();
+ $tmp->import($element);
+
+ return $tmp;
+ }
+ }
+
+ /** Register the import hook */
+ register_plugin_hook("import", "all", "import_user_plugin_hook", 0);
?> \ No newline at end of file