| Author |
Message |
iain
User


Joined: Dec 26, 2007 Posts: 30
|
|
| Back to top |
|
|
AdBot
|
| Post subject: gallery works but main page blank when logged in |
|
|
|
|
|
| Back to top |
|
 |
jettyrat
Moderator


Joined: Nov 28, 2005 Posts: 1144
|
Posted: Wed Apr 16, 2008 9:54 am Post subject: Re: gallery works but main page blank when logged in |
|
|
Doesn't appear you've done anything wrong, but somehow you've lost the externalidmap data for yourself (presumably the phpbb admin with id 2). Are other users able to login and visit gallery without issue?
You are using version 1.0.1a, right? Here's a couple fixes from the next integration version that should help get you fixed up again if there are not other issues. Both of these edits to g2helper.php in the init function. The first will prevent bots being able to get accounts and the second should fix your collision error.
Code: › Find:
// not anonymous user
if ($user->data['username'] != 'Anonymous') {
Replace with:
// not anonymous user or bot
if ($user->data['user_type'] != USER_IGNORE)
{
Find:
// create new user account if current user does not have Gallery account
elseif (isset($ret) && $ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
$this->_createUser($user->data['user_id'], array(
'username' => $user->data['username'],
'hashedpassword' => $user->data['user_password'],
'email' => $user->data['user_email'],
'fullname' => $user->data['username'],
'language' => $user->data['user_lang'],
'creationtimestamp' => time(),
'hashmethod' => 'md5')
);
Replace with:
// check if current user exists in Gallery and add external id map if so
elseif (isset($ret) && $ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
list ($ret, $userId) = GalleryCoreApi::fetchUserByUserName($user->data['username']);
if (empty($ret))
{
$ret = GalleryEmbed::addExternalIdMapEntry($user->data['user_id'], $userId->getId(), 'GalleryUser');
if (isset($ret))
{
trigger_error(sprintf($user->lang['G2_ADDEXTERNALMAPENTRY_FAILED'], $user->data['username']) . $user->lang['G2_ERROR'] . $ret->getAsHtml(), E_USER_ERROR);
}
}
// create new user account if current user does not have a Gallery account and no external id mapping
elseif (isset($ret) && $ret->getErrorCode() & ERROR_MISSING_OBJECT)
{
$this->_createUser($user->data['user_id'], array(
'username' => $user->data['username'],
'hashedpassword' => $user->data['user_password'],
'email' => $user->data['user_email'],
'fullname' => $user->data['username'],
'language' => $user->data['user_lang'],
'creationtimestamp' => time(),
'hashmethod' => 'md5')
);
} |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Wed Apr 16, 2008 10:36 am Post subject: Re: gallery works but main page blank when logged in |
|
|
jettyrat-
he doesn't have 1.0.1a, he's got the one prior, with g2helper.inc (i didn't do the integration for him, just the custom code to get the random photos in place and working properly). |
|
| Back to top |
|
|
jettyrat
Moderator


Joined: Nov 28, 2005 Posts: 1144
|
Posted: Wed Apr 16, 2008 11:01 am Post subject: Re: gallery works but main page blank when logged in |
|
|
| Ah, ok, well I think the changes should be about the same anyway. Should be easy enough to find the right lines. iain, just make sure not to break the if...elseif...else flow in the init function. If you have trouble, post your init function here and I'll make the changes to it. |
|
| Back to top |
|
|
iain
User


Joined: Dec 26, 2007 Posts: 30
|
Posted: Wed Apr 16, 2008 4:00 pm Post subject: Re: gallery works but main page blank when logged in |
|
|
seems others cant get on either...................
i cant find the code i need to change or show you
got g2helper.inc but its not in there
can I have more clues please
thanks |
|
| Back to top |
|
|
jettyrat
Moderator


Joined: Nov 28, 2005 Posts: 1144
|
Posted: Wed Apr 16, 2008 4:28 pm Post subject: Re: gallery works but main page blank when logged in |
|
|
The ones that can't get on have the same error msg?
Which integration version are you using? (should say in the page footer in any of the acp gallery2 settings pages)
The changes go in the init function of g2helper.inc. |
|
| Back to top |
|
|
iain
User


Joined: Dec 26, 2007 Posts: 30
|
Posted: Wed Apr 16, 2008 11:17 pm Post subject: Re: gallery works but main page blank when logged in |
|
|
Code: › Gallery Integration Error
File: /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc
Line: 70
initAdmin failed. Here is the error message from G2:
Error (ERROR_MISSING_OBJECT) : 2 GalleryUser
in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 124 (GalleryCoreApi::error)
in modules/core/classes/GalleryCoreApi.class at line 2298 (GalleryEntityHelper_simple::loadEntityByExternalId)
in modules/core/classes/GalleryEmbed.class at line 215 (GalleryCoreApi::loadEntityByExternalId)
in modules/core/classes/GalleryEmbed.class at line 120 (GalleryEmbed::checkActiveUser)
in /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc at line 68 (GalleryEmbed::init)
in /home/uklows/public_html/lowriderforums.com/forum/g2helper.inc at line 81 (g2helper::_initAdmin)
in /home/uklows/public_html/lowriderforums.com/forum/includes/functions.php at line 3144 (g2helper::init)
in /home/uklows/public_html/lowriderforums.com/forum/index.php at line 125
dont know if they all get the same but one mailed me this.
i cant see any pages anymore.
Dari said it was the version before the 1.0.1a. [with g2helper.inc] |
|
| Back to top |
|
|
jettyrat
Moderator


Joined: Nov 28, 2005 Posts: 1144
|
Posted: Wed Apr 16, 2008 11:56 pm Post subject: Re: gallery works but main page blank when logged in |
|
|
You can't see the phpbb administration control panel pages any more? I'm going to assume you actually can (or else you have bigger problems than the integration).
You need to go to phpbb->acp->gallery2 settings->config settings and set the activeAdminId to 0 (zero) and then resync the users again. |
|
| Back to top |
|
|
iain
User


Joined: Dec 26, 2007 Posts: 30
|
Posted: Thu Apr 17, 2008 1:56 pm Post subject: Re: gallery works but main page blank when logged in |
|
|
,.............. ia have bigger problems then.
no mwtter what i try to access I get that message. [or very similar] |
|
| Back to top |
|
|
jettyrat
Moderator


Joined: Nov 28, 2005 Posts: 1144
|
Posted: Thu Apr 17, 2008 3:20 pm Post subject: Re: gallery works but main page blank when logged in |
|
|
Hmm, ok I just clicked on your site link posted above and I see what you mean now.
Even guest access does not work on your site. I'm guessing somehow your g2_externalidmap database table is either gone or corrupt and the changes Dari made are calling g2helper.inc from the forum index page that prevents you from getting in to the forum at all.
I would suggest you comment out the changes Dari made for the time being at least so you can access the forum again and then we can start fixing some of the things we've been talking about. |
|
| Back to top |
|
|
jettyrat
Moderator


Joined: Nov 28, 2005 Posts: 1144
|
Posted: Thu Apr 17, 2008 3:35 pm Post subject: Re: gallery works but main page blank when logged in |
|
|
| Dari, maybe my suggestion in this post http://www.nukedgallery.net/postt3950.html [nukedgallery.net] about using g2helper to init gallery was not very well thought out. The problem with that (which I think is what iain is having) is that if the integration config gets screwed up, there is no way to get in to the forum because of calling integration code from the index page or page_header function which is called on all pages. At least some careful checking needs to be done before calling the integration code from this early point in the forum access for users (including admins). |
|
| Back to top |
|
|
jettyrat
Moderator


Joined: Nov 28, 2005 Posts: 1144
|
Posted: Thu Apr 17, 2008 4:03 pm Post subject: Re: gallery works but main page blank when logged in |
|
|
On second thought, the real problem is that the g2_externalidmap table is hosed up.
Iain, if you can use phpmyadmin or something similar, go to your phpbb3 database and do this-
1. from the phpbb_users table find the user_id for your username (probably 2 if you are the first admin)
Then do this in your gallery database-
1. make sure your gallery database has a table in it called g2_externalidmap
2. delete everything in it
3. add this entry to it:
g_externalId = guest
g_entityType = GalleryUser
g_entityId = 5
4. Go to the g2_user table and find the g_id for your username. (probably 6 if you are the first admin)
5. add this entry to the g2_externalidmap table:
g_externalId = 2 (if that is your phpbb user id)
g_entityType = GalleryUser
g_entityId = 6 (if that is you gallery user id)
That should at least get things back to where you can get in again and run the configuration and export users again. |
|
| Back to top |
|
|
iain
User


Joined: Dec 26, 2007 Posts: 30
|
Posted: Thu Apr 17, 2008 4:33 pm Post subject: Re: gallery works but main page blank when logged in |
|
|
thanks
i'll have a go at that.
really dont want to loose Dari's excellent mods |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Thu Apr 17, 2008 6:38 pm Post subject: Re: gallery works but main page blank when logged in |
|
|
jettyrat wrote: › Hmm, ok I just clicked on your site link posted above and I see what you mean now.
Even guest access does not work on your site. I'm guessing somehow your g2_externalidmap database table is either gone or corrupt and the changes Dari made are calling g2helper.inc from the forum index page that prevents you from getting in to the forum at all.
I would suggest you comment out the changes Dari made for the time being at least so you can access the forum again and then we can start fixing some of the things we've been talking about.
yes it does, so it can init g2 and pull images from the imageblock module, format the urls, etc... |
|
| Back to top |
|
|
jettyrat
Moderator


Joined: Nov 28, 2005 Posts: 1144
|
|
| Back to top |
|
|
|
|
|
|
|