PDA

View Full Version : vB did not load Language properly


Hoffi
09-28-2009, 07:42 AM
I build an own solutuion for a User sharing between vB and an own Portal-System with its own User-Database.

No we changed the File class_core.php, so that the class vB_Session looks for special Cookies and checks the Data against the vB Database. If a user is found the System sets via Datamanager the new Data oder a new User is created.

Then I set the Sessions, but everytime the first load of the Site it seems that no language is found if a user is logged in. During Logout the first time the User-Data is present.

Everytime after the second load everything is OK.

Here my Code after the Userdata loading from the API. If I did nout a User or the Datamanager cant't create e New one, the ID is -1 and a new Guest-Session must be started.


$this->vars =& $session;
$this->created = false;
if ($userid > 0)
{
$gotsession = true;
$useroptions = (defined('IN_CONTROL_PANEL') ? FETCH_USERINFO_ADMIN : 0) + (defined('AVATAR_ON_NAVBAR') ? FETCH_USERINFO_AVATAR : 0);
$userinfo = fetch_userinfo($userid, $useroptions, $languageid);
$this->vars = $this->fetch_session($userid);
$this->created = true;

$this->userinfo =& $userinfo;
}
elseif ($userid == -1)
{
$gotsession = true;
$this->vars = $this->fetch_session(0);
$this->created = true;

$this->userinfo =& $userinfo;
}
Where is my error? Has someone an idea?

--------------- Added 1254213501 at 1254213501 ---------------

Whow, I solved the Problem.

The Issue was, that the function verify_id sets a Variable in $vbphrase (I have no Idea, why!, and so fetch_userinfo() did not load the Language-Settings.

Hoffi
09-30-2009, 10:18 AM
The Problem was, that the function verify_id() sets an Field into $vbphrase which is not initialized this time. So fetch_userinfo() did not load the language Settings.

Does anybody have an idea why the function sets the array?


if (empty($vbphrase["$idname"]))
{
$vbphrase["$idname"] = $idname;
}


Whats the reason for this code?