1
mmesa
Re: Problem with Registration Date and Negative Posts
  • 2006/8/29 12:13

  • mmesa

  • Just popping in

  • Posts: 13

  • Since: 2005/7/28


I have the same problem since five months. I put this code in /modules/profiles/register.php:

$profile_handler =& xoops_gethandler('profile');
// Get fields
$mensaje="uname: ".$newuser->getVar('uname')."\n";
$mensaje.="loginname: ".$newuser->getVar('loginname')."\n";
$mensaje.="email: ".$newuser->getVar('email')."\n";
$mensaje.="pass: ".$newuser->getVar('pass')."\n";
$mensaje.="actkey: ".$newuser->getVar('actkey')."\n";
$mensaje.="user_regdate: ".$newuser->getVar('user_regdate')."\n";

$fields = $profile_handler->loadFields();
if (count($fields) > 0) {
foreach (array_keys($fields) as $i) {
$fieldname = $fields[$i]->getVar('field_name');
if ($fields[$i]->getVar('field_register') && isset($_POST[$fieldname])) {
$newuser->setVar($fieldname, $_POST[$fieldname]);
$mensaje.=$fieldname.": ".$newuser->getVar($fieldname).";\n";
}
}
}
$para = 'admin@dealmonte.com';
$asunto = 'Intento de registro';

mail($para, $asunto, $mensaje);


if (!$member_handler->insertUser($newuser)) {
$para = 'admin@dealmonte.com';
$asunto = 'Registro fallido en usuario';

$mensaje.="mysql_error: ".mysql_error().";\n";
mail($para, $asunto, $mensaje);

echo _PROFILE_MA_REGISTERNG;
echo implode('<br />', $newuser->getErrors());
break;
}
$newid = $newuser->getVar('uid');
if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) {
$para = 'admin@dealmonte.com';
$asunto = 'Registro fallido en grupo';

$mensaje.="mysql_error: ".mysql_error().";\n";
mail($para, $asunto, $mensaje);
echo _PROFILE_MA_REGISTERNG;
break;
}


But not always the e-mails are dispatched. I received this message for last registering:
uname: españa
loginname: pruebaxx
email: espaol2@dealmonte.com
pass: c893bad68927b457dbed39460e6afd62
actkey: 07c959f7
user_regdate: 1156849533
notify_method: 0;
attachsig: 1;
user_mailok: 1;
user_from: Almonte;
user_sig: ;
bio: ;
user_occ: ;
mysql_error: Duplicate entry '405' for key 1;

The row in xoops_users was ok, but in xoops_user_profile was wrong. The register date was 0, and other fields were with default value. And, there wasn't new records in xoops_group_users_links.
After, I deleted the new records for uid=405, I updated the autoincrement value to 405, and then I can register the new user with the same values.

As sometimes I don't receive the e-mails with the regisering data, I think is a problem of PHP. When this occurs, a new row is inserted in xoops_user_profile, with default values, but in tables xoops_users and xoops_group_users_links there aren't new rows.

Versions: XOOPS 2.2.4, PHP 4.4.2, MySQL 4.1.21-standard, Apache 1.3.37 (Unix)



2
mmesa
Re: new users can't register, but new records are created in xoops_user_profile
  • 2006/6/20 16:19

  • mmesa

  • Just popping in

  • Posts: 13

  • Since: 2005/7/28


OK, my site is on 2.2.4 not modified XOOPS again. I put the original kernel/user.php file. And Now?

Please I need help!!!!! :(

I think the problem is in MySql 4.1.18-standard, but what can produce an error inserting a new record? Sometimes the register action works, it always works in my computer, but why new users can't register????????

Thanks in advance.



3
mmesa
Re: new users can't register, but new records are created in xoops_user_profile
  • 2006/6/19 18:07

  • mmesa

  • Just popping in

  • Posts: 13

  • Since: 2005/7/28


I modified the function insert() in kernel/user.php:
ORIGINAL
--------
function insert(&$user, $force = false)
{
if (!parent::insert($user, $force)) {
return false;
}
$profile = $user->getProfile();
$profile->setVar('profileid', $user->getVar('uid'));

// save profile
if (!$this->_pHandler->insert($profile, $force)) {
foreach ($profile->getErrors() as $error) {
$user->setErrors($error);
}
return false;
}
return true;
}

NEW
---------
function insert(&$user, $force = false)
{
foreach ($user->cleanVars as $k => $v) {
if ($user->vars[$k]['data_type'] == XOBJ_DTYPE_INT) {
$cleanvars[$k] = intval($v);
} elseif ( is_array( $v ) ) {
$cleanvars[ $k ] = $this->db->quoteString( implode( ',', $v ) );
} else {
$cleanvars[$k] = $this->db->quoteString($v);
}
}
if ($user->isNew()) {
$sql= sprintf("INSERT INTO %s (uname, loginname, name, email, user_avatar, pass, rank, level) VALUES (%s, %s, %s, %s, %s, %s, %u, %u); ", $this->db->prefix('users'), $this->db->quoteString($user->getVar('uname')), $this->db->quoteString($user->getVar('loginname')),$this->db->quoteString($user->getVar('name')), $this->db->quoteString($user->getVar('email')), $this->db->quoteString($user->getVar('user_avatar')), $this->db->quoteString($user->getVar('pass')), $user->getVar('rank'), $user->getVar('level'));
if (false != $force) {
$result = $this->db->queryF($sql);
} else {
$result = $this->db->query($sql);
}
$user->setVar('uid',$this->db->getInsertId());
$sql= sprintf("INSERT INTO %s (umode, uorder, notify_method, attachsig, user_mailok, user_from, user_sig, bio, user_occ, user_regdate, actkey) VALUES (%s, %s, %s, %u, %u, %s, %s, %s, %s, %u, %s)", $this->db->prefix('user_profile'), $this->db->quoteString('nest'),$this->db->quoteString('1') ,$this->db->quoteString($user->getVar('notify_method')), $this->db->quoteString($user->getVar('attachsig')),$this->db->quoteString($user->getVar('user_mailok')), $this->db->quoteString($user->getVar('user_from')), $this->db->quoteString($user->getVar('user_sig')), $this->db->quoteString($user->getVar('bio')), $this->db->quoteString($user->getVar('user_occ')), time(), $this->db->quoteString($user->getVar('actkey')));

if (false != $force) {
$result = $this->db->queryF($sql);
} else {
$result = $this->db->query($sql);
}
return $result;

} else {
if (!parent::insert($user, $force)) {
return false;
}
$profile = $user->getProfile();
$profile->setVar('profileid', $user->getVar('uid'));
if (!$this->_pHandler->insert($profile, $force)) {
foreach ($profile->getErrors() as $error) {
$user->setErrors($error);
}
return false;
}
}

return true;
}

END
---------

New users can't register yet. But now xoops_user_profile has the correct values in fields,and now xoops_users is the table whith blank values.

Though, I can to register new user from my computers!!!!
Please, I need help!



4
mmesa
Re: new users can't register, but new records are created in xoops_user_profile
  • 2006/6/9 18:25

  • mmesa

  • Just popping in

  • Posts: 13

  • Since: 2005/7/28


I use XOOPS 2.2.4, there is not admin/system/preferences/user info settings. Exists admin/preferences/extended profiles/user settings. Perhaps I don't understantd you.

The settings for users are right, because are the same that before problem begins.



5
mmesa
Re: new users can't register, but new records are created in xoops_user_profile
  • 2006/6/8 23:14

  • mmesa

  • Just popping in

  • Posts: 13

  • Since: 2005/7/28


OK, I will pay 45 € to fix this problem. Please, I need help... :(



6
mmesa
Re: new users can't register, but new records are created in xoops_user_profile
  • 2006/6/7 17:38

  • mmesa

  • Just popping in

  • Posts: 13

  • Since: 2005/7/28


Babel fish russian traduction:

You izvenite, with the English in me rather weak... therefore I write on Russian, who can or it will be able to transfer this in the English for the clearness! On the whole I also use XOOPS 2.2.4, PHP 4.4.2, MySql ya.y.y8-.standard. I observe the same problem. Users cannot be registered at times! Is corrected this error by removal from the base of data of the incorrectly registered user. But this by order strains... Nemogli you (creators xoops) to be deepened into this question, and to try to find and to correct this error!!! Enormous to you thanks for the creation by such powerful CMS as XOOPS



7
mmesa
Re: new users can't register, but new records are created in xoops_user_profile
  • 2006/6/6 18:18

  • mmesa

  • Just popping in

  • Posts: 13

  • Since: 2005/7/28


anyone can help me?
I will pay 30 € to person that fix this problem.

Thanks



8
mmesa
Re: new users can't register, but new records are created in xoops_user_profile
  • 2006/5/27 11:06

  • mmesa

  • Just popping in

  • Posts: 13

  • Since: 2005/7/28


I think the problem is in the database, because sometimes the users can register and other times they can't do it.

Anyone with mySql 4.1.18??



9
mmesa
new users can't register, but new records are created in xoops_user_profile
  • 2006/5/26 16:33

  • mmesa

  • Just popping in

  • Posts: 13

  • Since: 2005/7/28


Hello, I've found this problem many times in this forum, but the solutions don't help me. I'm desperate.

When a user try to register, the result page is "_PROFILE_MA_REGISTERNG" -> 'Could not register new user.'

When this happens, the table xoops_user_profiles has a new record but the fields user_regdate = 0, posts = 1 and actkey = null. Sometimes, the table xoops_user has a new record also, but the fields user_regdate = 0, posts = -1 and actkey = null.

I've investigate and the string "_PROFILE_MA_REGISTERNG" is showed in /modules/profile/register.php:
if (!$member_handler->insertUser($newuser)) {
echo _PROFILE_MA_REGISTERNG;
echo implode('<br />', $newuser->getErrors());
break;
}
And
if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) {
echo _PROFILE_MA_REGISTERNG;
break;
}

When this happens, I delete the bad records in xoops_user_profile and xoops_user, and after put the same autoincrement value in both tables. So, the problem is fixed for a time and some users can register, but then the problem returns.

I've prove exporting the database and create it again, updating system and profile modules, deactivating protector module... Nothing serve.

My XOOPS version is 2.2.4. PHP 4.4.2, MySql 4.1.18-standard.
The installed modules are:
news 1.44
spotlight 2.1
xoops protector 2.54
xoopspolls 1
pical 0.84
contact us 1
catads 1.4
xdirectory 1.5
mylinks 1.1
avatar-maker 1.01
cbb 3.04
fungames 1
content 0.5
smartfaq 1.04
waitingblock 0.94
phpsitemapng 0.1
rm services 1
rm gallery 1.1
rm downloads 1.7

Please, if anyone can help me I will reward with a gift. Excuse me my poor english.

Thanks.



10
mmesa
disappeared actions in templateset administration
  • 2005/8/17 12:04

  • mmesa

  • Just popping in

  • Posts: 13

  • Since: 2005/7/28


Hello,
In administration -> System -> Templateset, the template and action cells are empty. Why?

The XOOPS version is 2.0.13.1, hitherto I didn't into in this page, so the only template is default.

This XOOPS installation is a migrated installation from other site, perhaps that makes this problem.

Thanks,




TopTop
(1) 2 »



Login

Who's Online

54 user(s) are online (26 user(s) are browsing Support Forums)


Members: 0


Guests: 54


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits