Gossamer Forum
Home : Products : DBMan : Customization :

please some suggestions about date,password and access

Quote Reply
please some suggestions about date,password and access
Hi,

I'm new at perl programming and I have 3 questions about dates, the password file
and direct access:

- Date problem
I finally was able to have the log file update with actual dates and not the 31-Dec-1999. To be homogeneous I modified JDP date translator so dates would be converted to
numbers under the d/m/y format. I added abbreviations to the original list so one could input for months 12, dec, december, décember but french months such as décember or août aren't recognized.
I think it is because of the accents.
How do I make DBman accept those accents and where should I add the code?

- Password
I noticed that when I create a new user the password file lists the user permissions
as 1 if on and empty if off ei username:encrypted pswrd:1:::: and not 1:0:0:0:0
How can I resolve this problem?
I also noticed that I couldn't simply modify a user, it creates a conflict with the password, I have to delete the older one and recreate a new one, is this the normal procedure?

-Direct access
I tried to create a bouton on a static page calling the short list all function of the short-long form.
If I use the uid=default it opens the list but I don't see the access in the log file, if I use a general user such as the one created in the above point, I'm told that the password timed out.
Is it possible to get someone with only the view permission to directly access the short list without going through the log on screen and being recorded in the log file?

Regards,
Eric
Quote Reply
Re: please some suggestions about date,password and access In reply to
1) Use escape character before the accented characters. Just put \ before the accented character.

2) Double check your authentication permissions. Set the $authentication variable to 1 NOT 0 to allow authentication to take place.

3) To provide direct access to Main Menu Page or Search Results, you will need to use the uid=default and also db=default in the link, like the following:

Code:
<a href="http://www.mydomain.com/cgi-bin/dbman/db.cgi?db=default&uid=default">Access Database</a>

Regards.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: please some suggestions about date,password and access In reply to
Hi Eliot
Thanks but I still have problems
1) I added the \ in front of accented characters:
my (%months) = ("jan" => 1, "feb" => 2, "mar" => 3, "apr" => 4, "may" => 5, "jun" => 6,
"jul" => 7, "aug" => 8, "sep" => 9, "oct" => 10, "nov" => 11,"dec" => 12,
"january" => 1, "february" => 2, "march" => 3, "april" => 4, "june" => 6,
"july" => 7, "august" => 8, "september" => 9, "october" => 10, "november" => 11,
"december" => 12, "fev" => 2, "mars" => 3, "avr" => 4, "mai" => 5, "juin" => 6,
"juillet" => 7, "ao\ût" => 8, "sept" => 9, "oct" => 10, "nov" => 11, "janvier" => 1,
"février" => 2, "avril" => 4, "septembre" => 9, "octobre" => 10, "novembre" => 11,
"d\écembre" => 12, "sept" => 9);

but when I test making a search for <01-décember-1999 in the date field (with <01-december-1999 it works) I get the following:
Search Failed
There were problems with the search. Reason: Invalid date format: '01-décember-1999'
Please fix any errors and submit the record again.

2)I modified $authentication variable to 1 NOT 0 but now one cannot logoff to login as an owner and add/modify/delete his record.
Still the default access wasn't recorded in the log file, the password file is still recording 0 as empty :1:::: and not :1:0:0:0:0
Here are my auth fields from the cfg file:
$auth_no_authentication = 0;
$auth_time = 21600; # 6 hours (in seconds)
$auth_logging = 1;
$auth_allow_default = 1;
@auth_default_permissions = (1,0,0,0,0);
$auth_signup = 1;
@auth_signup_permissions = (1,1,1,1,0);
$auth_modify_own = 1;
$auth_view_own = 0;
$auth_user_field = 39;
$auth_logoff = "http://www.sunnymead.org/cgi-bin/dbman/db.cgi?db=choirs";

Meanwhile I had to go back to $auth_no_authentication = 0;

and I placed the following link in the static page from which the access is called:
<a href="http://www.sunnymead.org/cgi-bin/dbman/db.cgi?db=choirs&uid=default&view_records=1&ID=*">View the list</a>
<a href="http://www.sunnymead.org/cgi-bin/dbman/db.cgi?db=choirs">Access the database</a>

To summarize:
I would like to be able to accept any date format, being in Quebec people might enter dates in french, english, with an international format d/m/y or american format m/d/y, just numbers or alphanum. At this point all works even the log date are correct but only the décember and août aren't recognized.
I would like to be able to record the number of "anonymous" visitor to the service, so yes one has to use the uid=default but this access isn't posted in my log file. I think it is only the log file that can let me know how much the service is used.
I think I should find a way with a if statement to make sure that default users are returned to the initial static page when they logoff sort of replacing
print qq!| <a href="$db_script_link_url&logoff=1">Log off</a> !; with
if ($per_view) {
print qq!| <a href="http://www.sunnymead.org/promomuse/repertory.html">Log off</a> !;
} else {
print qq!| <a href="$db_script_link_url&logoff=1">Log off</a> !;
}

Eliot, thanks for your time and suggestions,
Regards,
Eric