Gossamer Forum
Home : Products : DBMan : Installation :

writing 0's instead of blank fields

Quote Reply
writing 0's instead of blank fields
Hi;

My database is running great now, thanks to JPDeni. I just needed to know if there was a way to make the engine show 0's instead of blank fields whenever an admin edits or adds a user in the default.pass

This is what's happening as the database stands:

Everytime a user signs up, all permissions are set as 0's or 1's (default). But whenever an admin signs up a user, all fields with 0's are blanked out and only 1's show up in the default.pass file and I end up getting something like this:

1:1::::

I would like to make this so instead of above we get:

1:1:0:0:0:0

Is there a way to do this?
Quote Reply
Re: writing 0's instead of blank fields In reply to
You might be able to, although I don't know for sure this would work.

You would need to go into db.cgi, sub admin_display. Look for the section that starts with

Code:
$in{'new_username'} and do {

Down a little from that, there's

Code:
my $encrypted = crypt($in{'password'}, $salt);

below that line, add

Code:
unless ($in{'per_view'}) { $in{'per_view'} = "0"; }
unless ($in{'per_add'}) { $in{'per_add'} = "0"; }
unless ($in{'per_mod'}) { $in{'per_mod'} = "0"; }
unless ($in{'per_del'}) { $in{'per_del'} = "0"; }
unless ($in{'per_admin'}) { $in{'per_admin'} = "0"; }

You'd probably also want to do this when you're updating a user.

Look for

Code:
($in{'username'} && !$in{'inquire'}) and do {

A little further down is

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

add the same lines after this line.

Like I say, I can't guarantee it will work, but this is what I would try.




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







[This message has been edited by JPDeni (edited August 20, 1999).]