[geeklog-cvs] geeklog: Handle $bulkimport flag in the CUSTOM_userCreate() samp...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Dec 19 13:27:27 EST 2010
changeset 8029:6598962b25b8
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/6598962b25b8
user: Dirk Haun <dirk at haun-online.de>
date: Sun Dec 19 19:27:18 2010 +0100
description:
Handle $bulkimport flag in the CUSTOM_userCreate() sample code in lib-custom.php (bug #0001208)
diffstat:
public_html/docs/history | 6 +++++-
system/lib-custom.php.dist | 21 +++++++++++++++++----
2 files changed, 22 insertions(+), 5 deletions(-)
diffs (51 lines):
diff -r 8ec453e3f4fa -r 6598962b25b8 public_html/docs/history
--- a/public_html/docs/history Sun Dec 05 14:35:29 2010 -0500
+++ b/public_html/docs/history Sun Dec 19 19:27:18 2010 +0100
@@ -1,8 +1,12 @@
Geeklog History/Changes:
-Nov ??, 2010 (1.8.0)
+Dec ??, 2010 (1.8.0)
------------
+- Handle $bulkimport flag in the CUSTOM_userCreate() sample code in
+ lib-custom.php (bug #0001208) [Dirk]
+ If you are using your own CUSTOM_userCreate(), please check that you handle
+ this flag (set to true when doing a Batch User Import) correctly!
- Set minimum required PHP version to PHP 5.2.0 and removed all code that
ensured compatibility with PHP 4 (feature request #0001217) [Dirk]
- Added a proper copyright header and license text (LGPLv2) to the template
diff -r 8ec453e3f4fa -r 6598962b25b8 system/lib-custom.php.dist
--- a/system/lib-custom.php.dist Sun Dec 05 14:35:29 2010 -0500
+++ b/system/lib-custom.php.dist Sun Dec 19 19:27:18 2010 +0100
@@ -177,13 +177,26 @@
- See notes below in the custom function about the template changes
*/
-/* Create any new records in additional tables you may have added */
-/* Update any fields in the core GL tables for this user as needed */
-/* Called when user is first created */
-function CUSTOM_userCreate ($uid,$bulkimport=false)
+/**
+* Called when user is first created
+* Create any new records in additional tables you may have added
+* Update any fields in the core GL tables for this user as needed
+*
+* @param int $uid user id - record already exists at this point
+* @param boolean $bulkimport true during Batch User Import (admin/user.php)
+* @return boolean true on success, otherwise false
+*
+*/
+function CUSTOM_userCreate($uid, $bulkimport = false)
{
global $_CONF, $_TABLES;
+ if ($bulkimport) {
+ // the sample code in this function is written for the normal signup
+ // process; the $_POST variables are not set during bulk import
+ return true;
+ }
+
// Ensure all data is prepared correctly before inserts, quotes may need to
// be escaped with addslashes()
$email = '';
More information about the geeklog-cvs
mailing list