\param cartcookie variable contains the name of the cookie that contains the cart ID.<p>
\param lang variable is an object of type LanguageManager - it represents translations done for the language the user has chosen.<p>
+\param sessionid contains the ID of the current session as it is stored in a cookie and the session table.
+
+\param user.* contains basic data about the web user.
+<table frame="1" border="1">
+<tr><td><tt>user.name</tt></td><td>the (family) name of the user</td></tr>
+<tr><td><tt>user.firstname</tt></td><td>the first name of the user</td></tr>
+<tr><td><tt>user.title</tt></td><td>the title of the user</td></tr>
+<tr><td><tt>user.email</tt></td><td>the e-mail and login name of the user</td></tr>
+</table>
\section tpl_error error.html
$BaseUrl.=$path;
}
+public static function initCartAndUserData()
+{
+ global $websession,$basevars;
+ $basevars['inputnames']['cartid']=WebCart::cartIdName;
+ $basevars['cartcookie']=WebCart::cartIdName;
+ $basevars['sessionid']=$websession->getsessionid();
+ $cust=$websession->getcustomer();
+ if($cust!==false){
+ $basevars['user']=array(
+ 'name'=>$cust->getname(),
+ 'firstname'=>$cust->getfirstname(),
+ 'title'=>$cust->gettitle(),
+ 'email'=>$cust->getemail()
+ );
+ }else{
+ $basevars['user']=array(
+ 'name'=>"",
+ 'firstname'=>"",
+ 'title'=>"",
+ 'email'=>""
+ );
+ }
+}
+
//end of class
}
//eof
return;
-?>
\ No newline at end of file
+?>
//initialize basevars
BaseVars::init();
-$basevars['inputnames']['cartid']=WebCart::cartIdName;
-$basevars['cartcookie']=WebCart::cartIdName;
-$basevars['sessionid']=$websession->getsessionid();
+BaseVars::initCartAndUserData();
// other info
$basevars['lang']=LanguageManager::singleton();
// code below here (some bots add harmful code to index.php)
exit(0);
-?>
\ No newline at end of file
+?>