Gossamer Forum
Home : Products : DBMan : Customization :

Stuck...

Quote Reply
Stuck...
Ok this is what i want to do ... in simple terms

PART ONE
I want to have a multiple selection option so the user can choose the things he likes ... ie he can have a choice of apples, oranges and pears .. where he can select 1 or them all.
I would also like each of the options on a new line if possible .. if not .. 1 line will do ..

for example

Favourites...Apples
.................Oranges
.................Pears

if this is not posilble then this is ok (please dont takes notice of the ... it wouldnt post tabs)

Favourites Apples Oranges Pears

What multiple selections are available?? ie Radio button, drop down box, check box(the tick box one)....
I would like to have radio buttons to do this, if not a check box .. then last of all a drop down box ..


PART TWO
I would like to have an ADMIN only drop down box that has 2 selections available that can be selected for each user of the database.
What ever the admin has selected for each user is shown to them and anyone who looks at the info on the database
But this CANNOT be modifyed by any user except admin.

for example

(the admin can select this when modifying any user info on database)
Online...YES
............NO

(please dont takes notice of the ... it wouldnt post tabs)

(any user would only see this on the database, and cant modify it)

Online YES

or

Online NO


PART THREE
I would like to have the admin to be the only one to add new users with there login, password and email.
The new user can only have 1 datase file that they can add, modify or even delete ... but if they delete it they can then again only have 1 database file
Also i would like to be able to have a user to change his login and password at any time...
And if a user has forgotten his login and password it can be emailed to him

* Im not sure on the last one (email pass and login) .. cause if it posses a security risk then i wont do it, but if users can only access there own file to modfy then it should be ok?? And with this i would want to make sure if anyone put in the admin email address it would never get sent, as this would be the secuity risk i can only think of right now


For the databse i am using now it is a standard install, with new fields setup from JPDeni configurator, but if i need to redo this it is ok ...
Here are my setting in the cfg file:

$db_key_track = 1;
$db_delim = '|';
$db_auto_generate = 0;
$auth_no_authentication = 0;
$auth_logging = 1;
$auth_allow_default = 0;
@auth_default_permissions = (0,0,0,0,0);
$auth_signup = 0;
$auth_modify_own = 1;
$auth_view_own = 0;
$auth_user_field = 15;


Hoping someone can point me in the right direction as I have tried a few mods but cant seem to grasp it too easily



Quote Reply
Re: Stuck... In reply to
In Reply To:
I want to have a multiple selection option so the user can choose the things he likes
Do you want checkboxes or a select list?

In Reply To:
I would like to have an ADMIN only drop down box that has 2 selections available that can be selected for each user of the database. What ever the admin has selected for each user is shown to them and anyone who looks at the info on the database. But this CANNOT be modifyed by any user except admin.
Okay. You will first have to create your own sub html_record_form and then I can help you do this. If you got it from the Configurator, then post it here and I'll give you the code you need.

In Reply To:
I would like to have the admin to be the only one to add new users with there login, password and email.
Set $auth_signup = 0; in the .cfg file.

In Reply To:
The new user can only have 1 datase file that they can add, modify or even delete ... but if they delete it they can then again only have 1 database file.
Add a field to the database for the userid. Set the $db_key to the name of that field. Set $db_key_track = 0;. Set the $auth_user_field to the number of the userid field.

Since you'll be adding your users, you can give them whatever permissions you want.

In Reply To:
Also i would like to be able to have a user to change his login and password at any time...
I guess I'll have to write a mod for changing the login. I think it's a big mistake to do that, though. There is a mod for changing the password.

In Reply To:
And if a user has forgotten his login and password it can be emailed to him

* Im not sure on the last one (email pass and login) .. cause if it posses a security risk then i wont do it
The secure password lookup mod generates a new password and sends it to the user's email address. It's as secure as it can be made, as far as I can see.

In Reply To:
And with this i would want to make sure if anyone put in the admin email address it would never get sent, as this would be the secuity risk i can only think of right now
Not really. It would just send a new password to your email address. The person who entered it would only be able to get the password if he had access to your mailbox.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Stuck... In reply to
 
So if its a choice between "Do you want checkboxes or a select list?" i will like to have checkboxes

OK then, change of plan for change of login and password.
Ill have it so they can only change password .. but i want them to be able to change it to whatever they want, and if they forget there password it will get emailed to them ... i dont want a new pass being made ... i want it too send existing pass

Ill post the html once we have worked out what i can have or need to do what i am after ... as ill set it up again through your config to get the setup i need before we modify code.

By the way that config you run is kick ass :)



Quote Reply
Re: Stuck... In reply to
With checkboxes, the easiest (and best, IMNSHO Smile) way is to make a field in your database for each option.

Code:
Apples => [8, 'alpha', 0, 6, 0, '', ''],
Oranges => [9, 'alpha', 0, 7, 0, '', ''],
Pears => [10, 'alpha', 0, 5, 0, '', ''],
and then set up your checkbox fields:

Code:
%db_checkbox_fields = (
Apples => 'Apples',
Oranges => 'Oranges',
Pears => 'Pears'
);
It may seem like a pain to have all of those fields, but you will be better off in the long run.

In Reply To:
i dont want a new pass being made ... i want it too send existing pass
Then you will be compromising the security of your database. Let me see if I can explain.

Passwords are saved to the .pass file in encrypted form. There is no way to unencrypt them. If you save them in unencrypted form, anyone who might have access to your files could read them and log in as admin or anyone else. I wrote a mod that would save the passwords unencrypted and it worked. And then a client of mine had someone log in as admin and do a lot of damage to his database. The only way this person could have logged in was to have read the .pass file.

However, if you want to risk it, I'll rewrite the "insecure" mod for you. (There's some things that need to be updated. I've learned a lot since I wrote that mod! Smile)

I'm glad you like the Configurator. It has saved me a lot of time, both in setting up my own databases and in not having to answer questions from other folks. Wink

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Stuck... In reply to
Need Help!!!! with checkboxes.

I was going through all I could find but got lost.

I defined in my config file:

%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Titel => [1, 'alpha', 40, 40, 1, 'Titel', ''],
Fet => [2, 'alpha', 0, 5, 0, '', ''],
Unter => [3, 'alpha', 40, 40, 0, 'Unter', ''],
Text => [4, 'alpha', '40x3', 5500, 0, 'Text', ''],
BILD => [5, 'alpha', 40, 50, 1, 'bild1.gif', ''],
BILDTEXT => [6, 'alpha', '40x3', 20, 0, 'Bildtext', ''],
URL => [7, 'alpha', 40, 100, 1, 'http://', ''],
URLTEXT => [8, 'alpha', 40, 20, 1, 'URL Text', ''],
Date => [9, 'date', 12, 15, 1, &get_date, ''],
Userid => [10, 'alpha', -2, 15, 0, '', ''],
Kat => [11, 'alpha', 10, 40, 0, 'kat', '']
);
%db_checkbox_fields = ( Fet => 'Fet' );

and I used the following expression in order to produce an output:

<TR>
<TD ALIGN="Right" VALIGN="TOP"><$font>Fet:</FONT></TD>
<TD VALIGN="TOP">
|; print &build_checkbox_field("Fet","$rec{'Fet'}"); print qq| </TD>
</TR>

and I received an error:

error building checkboxes: no checkboxes specified in config for field 'Fet'

What I am doing wrong??? Pleas Pleas help

Michael

Quote Reply
Re: Stuck... In reply to
Try this:
%db_checkbox_fields = ( 'Fet' => 'Fet' );
Note the single quotes around the fieldname!


kellner
Quote Reply
Re: Stuck... In reply to
That could be it, but I don't think so.

My guess is that there is something else wrong in the .cfg file before that line, causing the script not to recognize the checkbox.

Please copy your .cfg file to a web-accessible directory (one where you wouel place .html files) and rename it to default_cfg.txt. Then come back and post the URL and I'll take a look at your file.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Stuck... In reply to
Thank you!

You are right it was another mistake in the .cfg file

Michael