Gossamer Forum
Home : Products : Links 2.0 : Customization :

Portal Links 2 Question

Quote Reply
Portal Links 2 Question
In regards to portal links 2, what if a user forgets their username or password? Is there any modification out there that would allow a user to have an e-mail sent to them with their registration info if they forget it?
----
Tobias

Quote Reply
Re: Portal Links 2 Question In reply to
Search "Resources". I think there is some just like that.http://www.gossamer-threads.com/scripts/resources/


Quote Reply
Re: Portal Links 2 Question In reply to
Yeah, here it is:
http://www.gossamer-threads.com/perl/resources/jump.cgi?ID=1162

Hope it is what you need :)


Quote Reply
Re: Portal Links 2 Question In reply to
The resource that you gave is for Links SQL, I have Links 2. Anyways would something like that be compatible with the mod, Portal Links 2? I think the mod generates its own password list.
Thanks,
Tobias

Quote Reply
Re: Portal Links 2 Question In reply to
Here's a quick hack... no guarantees it will work as I haven't tested it.

near the top of the script:
find
Code:
elsif (param('action') eq 'post') { &post(); }
and add the following under it
Code:
elsif (param('action') eq 'pass') { &pass(); }
Now add the following to the bottom of the script
Code:
sub pass {
my (@data, $found);
open (USER, "$db_lib_path/data/portal/users.db") or die ("Could not open file 'users.db'. $!");
while (<USER>) {
/^\s*$/ and last;
chomp;
@data = split /\|/, $_;
if ($in_user eq $data[1]) { $found = 1; last; }
}
close (USER);
$found or &error("User not found. You must have your user name in order to retrieve your password");
for (my $i = 0; $i <= $#user + 1; $i++) {
$user{$user[$i]} = $login[$i];
}
require "$db_lib_path/Mailer.pm";
my $msg = &load_template('lostpassmail.txt' { %globals, %user });
$mailer = new Mailer ({
'smtp' => $db_smtp_server,
'sendmail' => $db_mail_path,
'from' => $db_admin_email,
'subject' => 'Your login information,
'to' => $user{'Email'},
'msg' => $msg,
'log' => ''
}) or return;
$mailer->send or return;
print header();
print &load_template('lostpassdisp.html', { %globals, %user });
}
Create two templates. lostpassmail.txt, which is used to as the mail template. You may use any global variable, and any fields from the user hash. lostmaildisp.html, which is used as a confirmation that the email has been sent to the user (you may use any global or user variable here, also).

from your login or registration form, you'll need to add a form.
Code:
<form action="<%db_cgi_url%>/portal.cgi" method="POST">
<input type='hidden' name='action' value='pass'>
<input type='text' name='user'>
<input type='submit' name='submit' value='submit'>
</form>
Users must supply their user name in order to recieve there password by email.

That should be about it. Smile

Code:
s;[\d\$&(\^)];;g+s;\.; ;g+s;(.)(..);$2$1;g+print,if$_='&61k4I.)l678il.edn7(K2e^ny$';
Quote Reply
Re: Portal Links 2 Question In reply to
Thanks Junko!
However, now everytime I run portal.cgi I get this error:
Bad name after to' at /public_html/cgi-bin/links/portal.cgi line 383. Any ideas?
The script looks fine but it could be one of the tags. Is it the $user{'Email'}, thats wrong?
Thanks again,
Tobbe1

Quote Reply
Re: Portal Links 2 Question In reply to
There's a typo in the codes I provided...
change
Code:
'subject' => 'Your login information,
to
Code:
'subject' => 'Your login information',
--Drew
Links 2.0 stuff
http://www.camelsoup.com
Quote Reply
Re: Portal Links 2 Question In reply to
Thanks Junko!
Ok, I made the changes but now I get this error. Execution of /public_html/cgi-bin/links/portal.cgi aborted due to compilation errors. Can't use subscript on constant item at /public_html/cgi-bin/links/portal.cgi line 377, near "%user }"
Thanks again,
Tobbe1

Quote Reply
Re: Portal Links 2 Question In reply to
Does anyone know what the problem could be? It seems to be situated around my $msg = &load_template('lostpassmail.txt' { %globals, %user });. It says that it can't use a subscript on something in this script line near "%user }". The whole script was posted to this discussion if you need it for reference.
---
Tobbe1

Quote Reply
Re: Portal Links 2 Question In reply to
There was a missing ',' in that line.

change
Code:
my $msg = &load_template('lostpassmail.txt' { %globals, %user });
to:
Code:
my $msg = &load_template('lostpassmail.txt', { %globals, %user });
I had a hard time finding that one!

--Drew
Links 2.0 stuff
http://www.camelsoup.com
Quote Reply
Re: Portal Links 2 Question In reply to
Thanks Junko, you are a true genius!
The program works great and I the password lookup feature works great too. You should add this to Portal Links 2, its a great feature. I have the program up and running at http://www.chatinternational.com/links/.
Thanks a mill,
Tobbe1

Quote Reply
Re: [sponge] Portal Links 2 Question In reply to
I've just installed this mod. Problem is that email is being send only to last username in the users.db file no matter what username I put in the form (if username exist in the users.db file).

UnReal Network
Quote Reply
Re: [deadroot] Portal Links 2 Question In reply to
Can somebody send me the zip archive for Portal Links 2? Email me at Shanx6336@aol.com or just attach it to a reply. I can't seem to find the script files anywhere.

Thanks a lot!
Quote Reply
Re: [deadroot] Portal Links 2 Question In reply to
Could you tell me where you found the files so I can have a look?

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy thoughts] Portal Links 2 Question In reply to
I've installed this mod long long time ago so really don't know where you can get it. I just wanted to install password lookup but I guess it doesn't work for me.

UnReal Network
Quote Reply
Re: [tobbe1] Portal Links 2 Question In reply to
Is this portal.cgi available for download somewhere??
Bosnian Links
Quote Reply
Re: [deadroot] Portal Links 2 Question In reply to
nope. not any more. however if you pay the author enough (me), I'd be glad to spend some time and try to write this mod again (since I lost the only distribution copy in a disk crash last year)..

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy thoughts] Portal Links 2 Question In reply to
Ok, I guess your replay was for "bihlink" question. Btw, I found error in password lookup addon and now everything work just fine.

UnReal Network