Gossamer Forum
Home : Products : DBMan : Customization :

Need Help with This......

(Page 2 of 3)
> > > >
Quote Reply
Re: Need Help with This...... In reply to
Well, I figured out why the email address had problems. In sub admin display, change

Code:
$email = $data[7];

to

Code:
$email = $data[8];

That might have messed up the other things, too. Try adding the test1 user's info back into the .pass file and then change his member permission. Then, before you do anything else, check the .pass file and see if everything's all right.


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
ok - that fixed the email problem. I tried changing the permissions of test1 after the email change and here is the result:
Code:
# UserID : Password : View : Add : Del : Mod : Member : Admin : Email
donm77:Q.EulTRri8ul6:1:1:1:1:1:1:donm@erinet.com
admin:Q.EulTRri8ul6:1:1:1:1:1:1:donm@erinet.com
author:Q.EulTRri8ul6:1:1:1:1:1:0:donm@erinet.com
guest:Q.EulTRri8ul6:0:1:0:1:0:0:donm@erinet.com
:::1::1:1::donm@erinet.com

Do you suppose there are other $data[num] out of sync?
---------------
donm
Quote Reply
Re: Need Help with This...... In reply to
I don't think so, since the only the email address and admin permission would have changed with the addition of the member permission, and I remembered to change the admin permission.

Put the previous line back into the .pass file so that all the info is there again. Temporarily let's comment out some lines in sub admin_display.

The lines we're going to be concerned with are after

Code:
# If we have a username, and the admin didn't press inquire, then
# we are updating a user.

Scroll down a bit and comment out

Code:
unless ($password eq $in{'password'}) {
my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
my $salt = join '', @salt_chars[rand 64, rand 64];
$password = crypt($in{'password'}, $salt);
}

This will make it so, temporarily, you won't be able to change a password through the admin display. I just want to see if the old password is written correctly to the file.


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
ok the lines are commented out... now what next?
-----------
donm
Quote Reply
Re: Need Help with This...... In reply to
Put back the line for test1 and change his permission again. Then let me know what happened.


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
ok - no change - still get this when trying to change permissions:
Code:
# UserID : Password : View : Add : Del : Mod : Member : Admin : Email
donm77:Q.EulTRri8ul6:1:1:1:1:1:1:donm@erinet.com
admin:Q.EulTRri8ul6:1:1:1:1:1:1:donm@erinet.com
author:Q.EulTRri8ul6:1:1:1:1:1:0:donm@erinet.com
guest:Q.EulTRri8ul6:0:1:0:1:0:0:donm@erinet.com
:::1::1:1::donm@erinet.com
---------
donm
Quote Reply
Re: Need Help with This...... In reply to
Hmmmmm. This is very strange. I wonder why it's not picking up the password.

Try changing one of the other ones.


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
OK I tried changing guest - same result:
Code:
# UserID : Password : View : Add : Del : Mod : Member : Admin : Email
donm77:Q.EulTRri8ul6:1:1:1:1:1:1:donm@erinet.com
admin:Q.EulTRri8ul6:1:1:1:1:1:1:donm@erinet.com
author:Q.EulTRri8ul6:1:1:1:1:1:0:donm@erinet.com
:::1::1:1::donm@erinet.com
test1:Q.EulTRri8ul6:0:1:0:1:0:0:donm@erinet.com

------------------
donm
Quote Reply
Re: Need Help with This...... In reply to
That tells me something, but I'm not sure what. Smile

Try adding a new user through the admin display. That might tell me something else.


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
Adding one through the admin display works fine as you can see I added test2:
Code:
# UserID : Password : View : Add : Del : Mod : Member : Admin : Email
donm77:Q.EulTRri8ul6:1:1:1:1:1:1:donm@erinet.com
admin:Q.EulTRri8ul6:1:1:1:1:1:1:donm@erinet.com
author:Q.EulTRri8ul6:1:1:1:1:1:0:donm@erinet.com
:::1::1:1::donm@erinet.com
:::1::1:1::donm@erinet.com


test2:W34YXFaPaPtLE:1:::1:1::blaznfyre@hotmail.com
---------------
donm
Quote Reply
Re: Need Help with This...... In reply to
Well, that's something. At least that section is okay.

My fault. (Sometimes I'm such a nimnil!)

In the section where you commented out the lines, change

Code:
print PASS "$in{'new_username'}:$encrypted:$in{'per_view'}:$in{'per_add'}:$in{'per_del'}:$in{'per_mod'}:$in{'per_mem'}:$in{'per_admin'}:$in{'email'}\n" ;

to

Code:
print PASS "$in{'username'}:$password:$in{'per_view'}:$in{'per_add'}:$in{'per_del'}:$in{'per_mod'}:$in{'per_mem'}:$in{'per_admin'}:$in{'email'}\n" ;

And you can "uncomment" those lines. Sorry.


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
Well I think do pretty well ! However, I just changed that code and we are back to this when changing the permissions for test2:
Code:
# UserID : Password : View : Add : Del : Mod : Member : Admin : Email
donm77:Q.EulTRri8ul6:1:1:1:1:1:1:donm@erinet.com
admin:Q.EulTRri8ul6:1:1:1:1:1:1:donm@erinet.com
author:Q.EulTRri8ul6:1:1:1:1:1:0:donm@erinet.com
guest:Q.EulTRri8ul6:0:1:0:1:0:0:donm@erinet.com
::1:::1:::blaznfyre@hotmail.com

BTW - I am still able to create a new account through the admin panel with no problems.
-----------------
donm

[This message has been edited by donm (edited April 09, 2000).]
Quote Reply
Re: Need Help with This...... In reply to
JPD - Tell ya what. Why don't we take a break for now. I would like to get this working but I don't want to get you into one of those "marathon" sessions. It's 2am here and I have to be at work by 6am.

We can pick this up at another time - I could also give you access to my FTP server if that would help at all - so that you could have access to the files?

You let me know ...... I really appreciate your time and will definitely compensate you for it.
-------------------
donm
Quote Reply
Re: Need Help with This...... In reply to
This just doesn't make any sense at all. Focusing for a moment on just the username, if there was nothing in the variable

$in{'username'}

the script would not rewrite the line because the test for whether it's the right line or not is

if ($line =~ /^$in{'username'}:/) {

Therefore, there must be something in $in{'username'} and it must match the beginning of the line in the .pass file.

The last bit of code that I gave you also uses $in{'username'}, but by the time it gets to that line, it's empty.

Can you copy the code you have from that section of sub admin display, starting with

Code:
open (PASS, ">$auth_pw_file") or &cgierr ("unable to open: $auth_pw_file.\nReason: $!");

and ending with

Code:
close PASS;

I must be missing something.


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
Here ya go:
Code:
open (PASS, ">$auth_pw_file") or &cgierr ("unable to open: $auth_pw_file.\nReason: $!");
if ($db_use_flock) {
flock(PASS, 2) or &cgierr("unable to get exclusive lock on $auth_pw_file.\nReason: $!");
}
my $found = 0;
foreach $line (@lines) {
if ($line =~ /^$in{'username'}:/) {
my $password = (split (/:/, $line))[1];
unless ($password eq $in{'password'}) {
my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
my $salt = join '', @salt_chars[rand 64, rand 64];
$password = crypt($in{'password'}, $salt);
}

#### Following line changed for secure_password_lookup mod
print PASS "$in{'username'}:$password:$in{'per_view'}:$in{'per_add'}:$in{'per_del'}:$in{'per_mod'}:$in{'per_mem'}:$in{'per_admin'}:$in{'email'}\n";

$found = 1;
}
else {
print PASS $line;
}
}
close PASS;
-----------------
donm
Quote Reply
Re: Need Help with This...... In reply to
There was a part of me that was hoping you had entered something incorrectly and I would be able to say "ah-ha! there it is." You didn't and I can't. Smile

I'm stumped right now. I think I should go to bed. Sometimes it helps if I sleep on a problem like this and let my brain work on its own for a while.

See why I told you to work only on a backup copy? Smile


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
It says - "User: text1 updated."

-----------------
donm
Quote Reply
Re: Need Help with This...... In reply to
This is really strange. The variable $in{'username'} works when it's used as a comparison to the .pass file and it works when it's displayed in the message, but it doesn't work when it's being written to the .pass file.

Are you sure you uploaded the last change to the db.cgi file?


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
Here's what I am going to do.... I am going to start over again with all of the changes just to make sure that I didn't miss something.

I am not real sure at this point what the last change was :-)

So please be patient with me... it will be later tonight before I will be able to get this completed :-) ok?
----------------------
donm
Quote Reply
Re: Need Help with This...... In reply to
No problem. I'll be around this evening and we'll get this worked out.

BTW, if anyone else is reading along, don't try this at home! Not yet. Smile


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
ok - before we pick this up again I am going to go back and start all over again just to make sure that I haven't missed something or entered something in wrong that we didn't catch.
Quote:
See why I told you to work only on a backup copy?
I learned my lesson with this a long time ago. That's why I am working on a backup - it doesn't matter if things get messed up - I can start all over if need be. Again - thanks so much for your help - I think we can get this to work it seems to me like we are almost there !
-------------------
donm
Quote Reply
Re: Need Help with This...... In reply to
Well, sleeping on it didn't help. It still doesn't make any sense.

However, I did think of something that might give a clue. After you update a user, what is the message you get? Does it say, for example, "User: text1 updated." or does it say "User: updated."?


------------------
JPD






Quote Reply
Re: Need Help with This...... In reply to
Ok... after redoing everything - it is writing to the password file. However, now the password is being ommitted. Everything else is there. Username, permissions, email address. But the password is now gone.

I have to go out for awhile - I'll be back at this later tonight. :-)

---------------------------
Quote Reply
Re: Need Help with This...... In reply to
Now... after redoing everything - we are really close !! I am able to add new users through the admin panel without any problems at all.

However, when changing an existing users permissions - the permissions are changed however, the password field is erased -everything else is correct.

Any ideas on this one? I think we are almost there! :-)
---------------------------
donm
Quote Reply
Re: Need Help with This...... In reply to
Sorry I wasn't around earlier. Family emergency. (Probably nothing real major, but it had to be taken care of.)

Okay. So the username is being written when you update a user, but not the password.

First of all, make sure that the line that starts with

print PASS "$in{'username'}:$password:$in{'per_view'}:

actually has $password in the line. If it does, then we're going to have to do some more figuring of things. I'm thinking that, instead of "$password," it says "$encrypted." But I'll have to have you check to make sure.


------------------
JPD






> > > >