--- vendor-contrib/modules/gallery/gallery_base.inc 2006-06-18 13:12:55.000000000 -0700
+++ trunk/modules/gallery/gallery_base.inc 2006-06-29 10:42:49.484472141 -0700
@@ -42,20 +42,17 @@
$params = array('embedUri' => $embedUri,
'g2Uri' => $g2Uri,
'loginRedirect' => url('user/login', null, null, true),
- 'activeUserId' => $active_id,
- 'activeLanguage' => gallery_get_language($user),
- 'fullInit' => $full);
+ 'activeLanguage' => gallery_get_language($user));
$ret = GalleryEmbed::init($params);
- if (!$ret) {
- // No error returned, but it is still possible that the ExternalID mapping has not been done
- $ret2 = GalleryEmbed::isExternalIdMapped($user->uid, 'GalleryUser');
- if ($ret2 && ($ret2->getErrorCode() & ERROR_MISSING_OBJECT)) {
- // Need to make a new user, but don't try to map anonymous user.
- $new_user_needed = ($user->uid>0);
- }
- }
- if (($new_user_needed) || ($ret && ($ret->getErrorCode() & ERROR_MISSING_OBJECT))) {
+ if ($ret) {
+ return array(false, $ret);
+ }
+ $ret = GalleryEmbed::checkActiveUser($active_id);
+ if ($ret) {
+ if (!($ret->getErrorCode() & ERROR_MISSING_OBJECT)) {
+ return array(false, $ret);
+ }
// Our user mapping is missing. Make a mapping, or create a new user.
$g2_user = null;
// Get the G2 user that matches the Drupal username
@@ -94,7 +91,16 @@
// No matching G2 user found -- create one.
$path = drupal_get_path('module', 'gallery');
require_once($path . '/gallery_user.inc');
- return gallery_modify_user($user, 'create');
+ $result = gallery_modify_user($user, 'create');
+ if (!$result[0]) {
+ return $result;
+ }
+ }
+ }
+ if ($full) {
+ $ret = GalleryEmbed::init(array('fullInit' => true));
+ if ($ret) {
+ return array(false, $ret);
}
}
return array(true, null);
@@ -200,4 +206,4 @@
}
-?>
\ No newline at end of file
+?>
--- vendor-contrib/modules/gallery/gallery.module 2006-06-18 13:12:55.000000000 -0700
+++ trunk/modules/gallery/gallery.module 2006-06-29 11:05:34.218888779 -0700
@@ -195,8 +195,7 @@
list ($success, $ret) = _gallery_init(true);
if (!$success) {
gallery_error(t('Unable to initialize embedded Gallery'), $ret);
- $err_msg = t('Unable to initialize embedded Gallery. You need to
- configure your embedded Gallery.',
+ $err_msg = $ret ? t('Unable to initialize embedded Gallery.') : t('Unable to initialize embedded Gallery. You need to configure your embedded Gallery.',
array('%link' => url('admin/settings/gallery')));
return $err_msg;
}