--- nfo/php/libs/org.netfrag.flib/Tracker/User.php 2002/12/18 22:46:06 1.6
+++ nfo/php/libs/org.netfrag.flib/Tracker/User.php 2002/12/23 11:32:28 1.7
@@ -1,8 +1,12 @@
// -----------------------------------------------------------------------------
-// $Id: User.php,v 1.6 2002/12/18 22:46:06 jonen Exp $
+// $Id: User.php,v 1.7 2002/12/23 11:32:28 jonen Exp $
// -----------------------------------------------------------------------------
// $Log: User.php,v $
+// Revision 1.7 2002/12/23 11:32:28 jonen
+// + added inserting of uservars on '_create' to frontend db(needed to login user after create!)
+// + added hard link to page 'pub/register', TODO: move this out here
+//
// Revision 1.6 2002/12/18 22:46:06 jonen
// + added function 'getUserGuid()'
// (returns user's 'guid' read from database at function 'login()' (now))
@@ -143,6 +147,19 @@
//print "saving to backend: " . dumpVar($result) . "
";
$response = $this->pObject->backend->send('createUser', array('data' => $result) );
$objectId = $response[oid];
+ if($objectId) {
+ connectdb();
+ $guid = $response[guid];
+ $username = $this->get('userData.username');
+ $password = $this->get('userData.password');
+ $sql = "INSERT into td_users VALUES ( '$objectId', '$guid', '', '$username', '$password','' )";
+ $res = send_sql($sql);
+ }
+ else {
+ // TODO: handle this with a generic rpc-debug/pending function
+ $site->session->set('register_error', 'rpc_error');
+ $site->redirect( getlink('/pub/register/') );
+ }
//$this->_init($objectId);
}
@@ -222,8 +239,10 @@
$mapping_uservars2data = array_flip($def_mapping[data2uservars]);
foreach ($uservars as $key => $val) {
$key_target = $mapping_uservars2data[$key];
- //print "$key => $key_target: $val
";
- $target[$key_target] = $val;
+ if($key_target != '') {
+ //print "$key => $key_target: $val
";
+ $target[$key_target] = $val;
+ }
}
return $target;
}