[dev] [patch] Signup fixes
Jason M. Felice
jfelice at cronosys.com
Wed Nov 26 06:54:47 PST 2003
Fixes an undefined variable warning, logs PEAR error if addextra hook
fails, and fixes sample addextra hook to fill in owner_id in turba
addressbook.
--
Jason M. Felice
Cronosys, LLC <http://www.cronosys.com/>
216.221.4600 x302
-------------- next part --------------
Index: lib/Signup.php
===================================================================
RCS file: /repository/horde/lib/Signup.php,v
retrieving revision 1.23
diff -u -r1.23 Signup.php
--- lib/Signup.php 13 Nov 2003 22:27:23 -0000 1.23
+++ lib/Signup.php 26 Nov 2003 14:54:00 -0000
@@ -76,7 +76,7 @@
*/
function addSignup(&$info)
{
- global $auth;
+ global $auth, $conf;
// Perform any preprocessing if requested
if ($conf['signup']['preprocess']) {
@@ -98,6 +98,7 @@
$added = Horde::callHook('_horde_hook_signup_addextra',
array($info['user_name'], $info['extra']));
if (!$added || is_a($added, 'PEAR_Error')) {
+ Horde::logMessage($added, __FILE__, __LINE__, PEAR_LOG_EMERG);
Horde::fatal(new PEAR_Error(_("Unable to add extra user information when signing up.")), __FILE__, __LINE__);
}
}
Index: config/hooks.php.dist
===================================================================
RCS file: /repository/horde/config/hooks.php.dist,v
retrieving revision 1.54
diff -u -r1.54 hooks.php.dist
--- config/hooks.php.dist 13 Nov 2003 22:27:24 -0000 1.54
+++ config/hooks.php.dist 26 Nov 2003 14:54:00 -0000
@@ -473,8 +473,8 @@
$fields[] = 'object_id';
$values[] = $_db->quote($userID);
- $query = 'INSERT INTO turba_objects (' . implode(', ', $fields) . ')';
- $query .= ' VALUES (' . implode(', ', $values) . ')';
+ $query = 'INSERT INTO turba_objects ( owner_id, ' . implode(', ', $fields) . ')';
+ $query .= ' VALUES ( \'admin\', ' . implode(', ', $values) . ')';
$result = $_db->query($query);
return DB::isError($result) ? $result : true;
More information about the dev
mailing list