Subject: Registration Hack for GL 1.3.7.

Posted on: 03/02/03 05:49am
By: Robin

Here\'s what I did to ease the registration process as my host doesn\'t support email.I modifed the users.php a bit. You can see it in action at amerykanistyka.host.sk. Hope it will make your life easier. Here\'s the code with highlighted changes. You will need to change your language files so they don\'t say about password emailingfunction createuser($username,$email)
{
global $_TABLES, $LANG04, $_CONF;

$ucount = DB_count($_TABLES[\'users\'],\'username\',$username);
$ecount = DB_count($_TABLES[\'users\'],\'email\',$email);
$email = md5($email);

if ($ucount == 0 AND $ecount == 0) {
# if (COM_isEmail($email)) {
$regdate = strftime(\'%Y-%m-%d %H:%M:$S\',time());
DB_save($_TABLES[\'users\'],\'username,passwd,regdate\',\"\'$username\',\'$email\',\'$regdate\'\");
$uid = DB_getItem($_TABLES[\'users\'],\'uid\',\"username = \'$username\'\");

// Add user to Logged-in group (i.e. members) and the All Users group (which includes
// anonymous users
$normal_grp = DB_getItem($_TABLES[\'groups\'],\'grp_id\',\"grp_name=\'Logged-in Users\'\");
$all_grp = DB_getItem($_TABLES[\'groups\'],\'grp_id\',\"grp_name=\'All Users\'\");
DB_query(\"INSERT INTO {$_TABLES[\"group_assignments\"]} (ug_main_grp_id,ug_uid) values ($normal_grp, $uid)\");
DB_query(\"INSERT INTO {$_TABLES[\"group_assignments\"]} (ug_main_grp_id,ug_uid) values ($all_grp, $uid)\");
DB_query(\"INSERT INTO {$_TABLES[\"userprefs\"]} (uid) VALUES ($uid)\");
if ($_CONF[\'emailstoriesperdefault\'] == 1) {
DB_query(\"INSERT INTO {$_TABLES[\"userindex\"]} (uid) VALUES ($uid)\");
} else {
DB_query(\"INSERT INTO {$_TABLES[\"userindex\"]} (uid,etids) VALUES ($uid, \'-\')\");
}
DB_query(\"INSERT INTO {$_TABLES[\"usercomment\"]} (uid) VALUES ($uid)\");
DB_query(\"INSERT INTO {$_TABLES[\"userinfo\"]} (uid) VALUES ($uid)\");
if ($_CONF[\'usersubmission\'] == 1) {
$queueUser = true;
if (!empty ($_CONF[\'allow_domains\'])) {
$allowed = explode (\',\', $_CONF[\'allow_domains\']);
// Note: We already made sure $email is a valid address
$domain = substr ($email, strpos ($email, \'@\') + 1);
if (in_array ($domain, $allowed)) {
$queueUser = false;
}
}
if ($queueUser) {
$passwd = md5(\'\');
DB_change($_TABLES[\'users\'],\'passwd\',\"$passwd\",\'username\',$username);
$msg = 48;
} else {
# emailpassword($username, 1);
$msg = 1;
}
if (isset ($_CONF[\'notification\']) && in_array (\'user\', $_CONF[\'notification\'])) {
sendNotification ($username, $email, $uid, $queueUser);
}
} else {
# emailpassword($username, 1);
$msg = 1;
if (isset ($_CONF[\'notification\']) && in_array (\'user\', $_CONF[\'notification\'])) {
sendNotification ($username, $email, $uid, false);
}
}
DB_change($_TABLES[\'usercomment\'],\'commentmode\',$_CONF[\'comment_mode\'],\'uid\',$uid);
DB_change($_TABLES[\'usercomment\'],\'commentlimit\',$_CONF[\'comment_limit\'],\'uid\',$uid);

return COM_refresh($_CONF[\'site_url\'] . \'/index.php?msg=\' . $msg);
} else {
# $retval .= COM_siteHeader(\'Menu\') . newuserform($LANG04[18]) . COM_siteFooter();
}
# } else
{
$retval .= COM_siteHeader(\'Menu\') . newuserform($LANG04[19]) . COM_siteFooter();
}
return $retval;
}


Ragistration Hack for GL 1.3.7.

Posted on: 03/02/03 03:59pm
By: Anonymous

Thanks I'm sure that will help a few others in the same situation as you.

Ragistration Hack for GL 1.3.7.

Posted on: 03/02/03 08:45pm
By: Anonymous

I tried to check out the registration page but was given this error. Template Error: set_root: /mnt/host-users/amerykanistyka/layout/cleanusers is not a directory. Halted. Just wanted to let you know.

Ragistration Hack for GL 1.3.7.

Posted on: 04/02/03 04:16am
By: Robin

Thanks a lot! I fixed it (a typo in config:-). Go ahead and try it now.

Re:Registration Hack for GL 1.3.7.

Posted on: 23/08/03 05:25am
By: Anonymous

I NEED this to work for 1.3.8!!!! Anyone??? PLEASE!!!

Re:Registration Hack for GL 1.3.7.

Posted on: 02/09/03 06:58am
By: Robin

(un)Fortunately www.host.sk switched email on and I switched off this hack.

Re:Registration Hack for GL 1.3.7.

Posted on: 03/09/03 07:09pm
By: D1

I\'ll like to try your registration codes Robin, is this the code above or you have and updated version?

Re:Registration Hack for GL 1.3.7.

Posted on: 03/09/03 08:26pm
By: D1

Hi Robin Just tried your script and below is the result of what I get... 1136: Column count doesn\'t match value count at row 1 So what next?

Re:Registration Hack for GL 1.3.7.

Posted on: 04/09/03 12:42am
By: WannaFish39

What do you have to edit in the language files adn eh users.thtml files? It doesn\'t spedify. Thanks so much in advance, MacFanatic39

Re:Registration Hack for GL 1.3.7.

Posted on: 04/09/03 03:16am
By: Robin

OK sorry for a little bit confusing instruction. 1. Copy the above function createuser to users.php over the existing function (or manually add the changes in bold). 2. Language changes: after clicking Sign up as a New User you get two fields User Name and Email -> change the latest to Password and remove the message \"Your password will be sent to the email address you enter.\". After clicking \"Register Now\" you get this message about emailing (which actually doesn\'t mail right) so change this message to whatever e.g. Congrats you can now login and stuff. All the above lang changes sit in english.php (I guess) Cheers

Re:Registration Hack for GL 1.3.7.

Posted on: 04/09/03 08:43pm
By: WannaFish39

THANK YOU SOOOO MUCH ROBIN! You have been the biggest help. One more thing though...Anyone know of a way to get the email address field to coexist with the username and password ones? It would be nice to get all three of those done at registration in case I need to email them for whatever reason. Thanks to all you you, especially Robin, WannaFish39

Re:Registration Hack for GL 1.3.7.

Posted on: 21/09/03 07:30pm
By: m311b

I have successfully used the hack so that users can enter in their password and username w/o having a confirmation letter sent to them, allowing them to log in right away. Now it would be nice for them to also have a field where they can enter in their email address still and have it save it to the database. The first step looks like modifying the registrationform.thtml to add another form, which I have. The form is titled \"email2\" (for now as I am not nearly ready to start modifying the php code and existing form names as I am very new to this all). So going off of the added form \"email2\" for submitting the email address to the database, any suggestions for the code to accomplish this? Thanks in advance for your help!

Re:Registration Hack for GL 1.3.7.

Posted on: 21/09/03 09:41pm
By: m311b

Nevermind - after a few hours of trial and error its been accomplished!

Re:Registration Hack for GL 1.3.7.

Posted on: 27/09/03 10:53pm
By: m311b

OK - it was working, I was able to have the new user type in their desired username, password and email address, and it was saving it in the database. but after logging in, if you were to click on anyone's name to view their user profile this error was returned: Parse error: parse error, unexpected $end in d:\208.187.163.136\users.php on line 901 What exactly is a parse error?

Registration Hack for GL 1.3.7.

Posted on: 12/03/04 12:30am
By: Anonymous

Not working for me

I get parse error when I try to create a new account.

Probably the code of the new version is different ??

Registration Hack for GL 1.3.7.

Posted on: 12/03/04 02:16am
By: Robin

Very much probably.
Sorry for not updating the hack but as I mentioned earlier my host switched phpmail on.
However very recently they disabled this again (moody bastards ;-) so I will take a look at the latest code to see how this hack could be achieved.

Registration Hack for GL 1.3.7.

Posted on: 12/03/04 09:16am
By: Blaine

You may fine the new COM_mail() which uses the PEAR mail class offers you what you need.

If not, the COM_mail() now checks for a CUSTOM_mail() and if it exists - it will be used instead.

Registration Hack for GL 1.3.7.

Posted on: 22/07/04 08:12pm
By: Anonymous

I had the problem of my users not getting their passwords sent to them because they typed in the wrong email address. So I implimented this great hack and managed to get it to work with little effort.

But now.... My users can't put in an email address at all and I keep getting bounced emails everytime one of these newer users get a pm.

How can I have new users sign up immediately by choosing their own password and still enter their email adress in as well????

Registration Hack for GL 1.3.7.

Posted on: 03/11/04 08:38pm
By: rjrufo

I'm trying this on GL 1.3.9 with no luck. It seems that the system still generates a random password, even though I'm entering in my own. I've uncommented the debug line, and it shows that it's attempting to create the user with the password I select, but when I try logging in with the info I entered, it won't go. Anyone have any ideas?

Edit: I have the email password part successfully canceled, so I - or anyone else - will not be able to get the generated password. It's on my "development" site, one that is not accessible from the internet, so I'm not concerned about new people registering and not being able to log in, but I'd like to implement this on the "live" site as soon as possible.

Thanks

Registration Hack for GL 1.3.7.tool

Posted on: 08/11/04 04:19pm
By: Anonymous

Any progreess?

The thing is I can't figure out the structure of the code used to output the newuser form, and the code to get the data to the database. It's no big deal INSERTing data from a form into mysql, but geeklog's code structure is a little more complicated than ifs and thens.....

Anyone gone any further with deactivating the email passwd? I think the devel team should give us a hand here...

Registration Hack for GL 1.3.7.

Posted on: 08/11/04 05:17pm
By: rjrufo

InDio,

I used this as a template for mine. I believe it's for 1.3.8, so the code is a little different in 1.3.9, the version I'm using. I haven't had much time the last few days to work on mine, so it remains as is. As my above post says, it's on my development computer, so I'm not under any pressure to get it done. If - actually - WHEN I get it all sorted out, I'll post what I did here.

Registration Hack for GL 1.3.7.

Posted on: 08/11/04 06:28pm
By: Anonymous

Nah...v1.3.9 has many changes in the code of users.php. Unfortunately I can't make any sense yet as to which parts I must change.

Maybe a developer could point out which functions are called during user registration?

Registration Hack for GL 1.3.7.

Posted on: 07/07/05 07:13pm
By: Anonymous

Hi,
I am using gl_1.3.11 and the users.php v93 is completly different from the one that you have displayed. Could you help me to make the necessary changes in v93 to have the same functionality. Please help. I will be very thankful to you

Thanks

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=21492