A measre of security
am 14.02.2007 12:39:00 von Gustav Wiberg
--2943234-5770-1171453167-2924
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Hi!
=20
This is a kind of security-question....
=20
I'm starting up a system, where several customers should be able to login w=
ith there own information.
Each company I give unique identity with "hard-coding" and each company has=
its own folder...
=20
=20
Harding-coding, something like:
$company -> setIDCompany(1);
$company -> setIDCompany(2);
$company -> setIDCompany(3);
=20
Diffrent folders:
customers/company1=20
customers/company2
customers/company3
=20
and so on...
=20
=20
This isn't complicated, but when I add a new company.... ...I must be 20=
0% sure that the IDCompany is set correct (There is a chance of setting the=
wrong ID for a new company or forgetting to change it)
The companys ARE NOT ALLOWED to see each others information.
=20
Is there any good way of solving this with some sort of comparision-mechani=
sm or something like that? Any thoughts?
=20
Best regards
/Gustav Wiberg
--2943234-5770-1171453167-2924--
Re: [PHP-WIN] A measre of security
am 17.02.2007 10:26:20 von bedul
cmiiw
----- Original Message -----
From: "Gustav Wiberg"
To:
Sent: Wednesday, February 14, 2007 6:39 PM
Subject: [PHP-WIN] A measre of security
Hi!
This is a kind of security-question....
I'm starting up a system, where several customers should be able to login
with there own information.
Each company I give unique identity with "hard-coding" and each company has
its own folder...
Harding-coding, something like:
$company -> setIDCompany(1);
$company -> setIDCompany(2);
$company -> setIDCompany(3);
[bedul]
you should not try hardcoding by your self.. is suffer your health.. hehehe
why don't you use an id.. if you enter this using db.. every new record or
company will given a new id..
like you enter new comp anda the new will have 4 and soon
but if this not what you wanted.. just created a random var like this
i enter new comp.. where the var given = a4s43.. this comp will have id
a4s43 and have folder named a4s43
=====================================================
Diffrent folders:
customers/company1
customers/company2
customers/company3
and so on...
This isn't complicated, but when I add a new company.... ...I must be
200% sure that the IDCompany is set correct (There is a chance of setting
the wrong ID for a new company or forgetting to change it)
[bedul]
to search what your id entered .. try use
int mysql_insert_id ( [resource link_identifier] )
Retrieves the ID generated for an AUTO_INCREMENT column by the previous
INSERT query.
=======================================
The companys ARE NOT ALLOWED to see each others information.
[bedul]
try above suggestion.. use random var for folder.. how to get em??
$idFromTable=mysql_insert_id ($handle);
$rndNum=rand(2100);
$randomID="a".$idFromTable."s".$rndNum;
========================================
Is there any good way of solving this with some sort of
comparision-mechanism or something like that? Any thoughts?
[bedul]
interesting. can u explain more about 'sort of comparision-mechanism'??
===================
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] A measre of security
am 17.02.2007 10:26:20 von bedul
cmiiw
----- Original Message -----
From: "Gustav Wiberg"
To:
Sent: Wednesday, February 14, 2007 6:39 PM
Subject: [PHP-WIN] A measre of security
Hi!
This is a kind of security-question....
I'm starting up a system, where several customers should be able to login
with there own information.
Each company I give unique identity with "hard-coding" and each company has
its own folder...
Harding-coding, something like:
$company -> setIDCompany(1);
$company -> setIDCompany(2);
$company -> setIDCompany(3);
[bedul]
you should not try hardcoding by your self.. is suffer your health.. hehehe
why don't you use an id.. if you enter this using db.. every new record or
company will given a new id..
like you enter new comp anda the new will have 4 and soon
but if this not what you wanted.. just created a random var like this
i enter new comp.. where the var given = a4s43.. this comp will have id
a4s43 and have folder named a4s43
=====================================================
Diffrent folders:
customers/company1
customers/company2
customers/company3
and so on...
This isn't complicated, but when I add a new company.... ...I must be
200% sure that the IDCompany is set correct (There is a chance of setting
the wrong ID for a new company or forgetting to change it)
[bedul]
to search what your id entered .. try use
int mysql_insert_id ( [resource link_identifier] )
Retrieves the ID generated for an AUTO_INCREMENT column by the previous
INSERT query.
=======================================
The companys ARE NOT ALLOWED to see each others information.
[bedul]
try above suggestion.. use random var for folder.. how to get em??
$idFromTable=mysql_insert_id ($handle);
$rndNum=rand(2100);
$randomID="a".$idFromTable."s".$rndNum;
========================================
Is there any good way of solving this with some sort of
comparision-mechanism or something like that? Any thoughts?
[bedul]
interesting. can u explain more about 'sort of comparision-mechanism'??
===================
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: A measre of security
am 19.02.2007 08:28:00 von Gustav Wiberg
=20
-----Original Message-----
From: bedul [mailto:landavia81@gmail.com]=20
Sent: Saturday, February 17, 2007 10:26 AM
To: Gustav Wiberg; php-windows@lists.php.net
Cc: php-db@lists.php.net
Subject: Re: [PHP-WIN] A measre of security
Importance: High
cmiiw
----- Original Message -----
From: "Gustav Wiberg"
To:
Sent: Wednesday, February 14, 2007 6:39 PM
Subject: [PHP-WIN] A measre of security
Hi!
This is a kind of security-question....
I'm starting up a system, where several customers should be able to login
with there own information.
Each company I give unique identity with "hard-coding" and each company has
its own folder...
Harding-coding, something like:
$company -> setIDCompany(1);
$company -> setIDCompany(2);
$company -> setIDCompany(3);
[bedul]
you should not try hardcoding by your self.. is suffer your health.. hehehe
why don't you use an id.. if you enter this using db.. every new record or
company will given a new id..
like you enter new comp anda the new will have 4 and soon
but if this not what you wanted.. just created a random var like this
i enter new comp.. where the var given =3D a4s43.. this comp will have id
a4s43 and have folder named a4s43
==================== =====3D=
==================== =====3D=
===3D
Diffrent folders:
customers/company1
customers/company2
customers/company3
and so on...
This isn't complicated, but when I add a new company.... ...I must be
200% sure that the IDCompany is set correct (There is a chance of setting
the wrong ID for a new company or forgetting to change it)
[bedul]
to search what your id entered .. try use
int mysql_insert_id ( [resource link_identifier] )
Retrieves the ID generated for an AUTO_INCREMENT column by the previous
INSERT query.
==================== =====3D=
==============
The companys ARE NOT ALLOWED to see each others information.
[bedul]
try above suggestion.. use random var for folder.. how to get em??
$idFromTable=3Dmysql_insert_id ($handle);
$rndNum=3Drand(2100);
$randomID=3D"a".$idFromTable."s".$rndNum;
==================== =====3D=
===============3D
Is there any good way of solving this with some sort of
comparision-mechanism or something like that? Any thoughts?
[bedul]
interesting. can u explain more about 'sort of comparision-mechanism'??
Hi there!
Thanx for your suggestion! What I meant with comparisaion-mechanism was tha=
t I=20
Want to have som kind of fucntion that is "almost" impossible to set ID 1 -=
Company 2, impossible to set ID2 for company 1. The function should check=
=20
Somehow that the right ID is set.. Like ID 1 =3D Company1, ID 2 =3D Company=
and so on...
Best Regards
/Gustav Wiberg
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php