hello,
gallery seems to work fine standalone, but embedded in my phpnuke site the user is only 'half' logged in. he can see "Welcome, " but no name. i made some output tests, getUsername() shows the username, but getFullname() shows nothing. getEMail() works too, but canCreate...(), can...() shows nothing, so the users don't see links for managing albums.
any ideas?
bye
gun
Posts: 3
i hacked the init.php, it's now executing the "not embedded" code after the "nuke embedded" code:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
/* Load our user database (and user object) */
$gallery->userDB = new Nuke5_UserDB;
if ($GLOBALS['user']) {
$gallery->session->username = $GLOBALS['user'];
}
if (isset($GLOBALS['admin']) && is_admin($GLOBALS['admin'])) {
include($GALLERY_BASEDIR . "classes/nuke5/AdminUser.php");
$gallery->user = new Nuke5_AdminUser($GLOBALS['admin']);
$gallery->session->username = $gallery->user->getUsername();
} else if (is_user($GLOBALS['user'])) {
$user_info = getusrinfo($GLOBALS['user']);
$gallery->session->username = $user_info["uname"];
$gallery->user =
$gallery->userDB->getUserByUsername($gallery->session->username);
}
//-------------------------------------------------------------------------------
// HACK (code copied from "not embedded" code below
//-------------------------------------------------------------------------------
include($GALLERY_BASEDIR . "classes/gallery/UserDB.php");
include($GALLERY_BASEDIR . "classes/gallery/User.php");
/* Load our user database (and user object) */
$gallery->userDB = new Gallery_UserDB;
/* Load their user object with their username as the key */
if ($gallery->session->username) {
$gallery->user =
$gallery->userDB->getUserByUsername($gallery->session->username);
}
</TD></TR></TABLE><!-- BBCode End -->
now it works fine both standalone and embedded, but since this is a hack: are there any better suggestions?
bye
gun
Posts: 7985
That's because it's drawing the user from the Nuke database, and you haven't specified
a full name for the user there. This is a pretty common problem; most people don't put
full names in when they register accounts (just look at the member list for this site).
That's a creative solution! But by doing that you basically disable Gallery's code that draws users from the Nuke database, so now when users log into Nuke it won't log them into Gallery properly. I suggest that you undo this hack and fill out the full name field in your Nuke account info.
The latest rev of Gallery (1.3.2-b23) has fallback code: if the full name is blank, it shows the username in the "Welcome" message.
Posts: 3
hello,
thanks, i'll restore the original code (i don't like manipulating code because of update probs :wink
btw: great job, your gallery software!
cheers
gun