php-general Digest 3 May 2010 13:34:23 -0000 Issue 6725
Topics (messages 304851 through 304876):
Need login suggestions
304851 by: Ashley M. Kirchner
304852 by: Nilesh Govindarajan
304853 by: Nathan Rixham
304854 by: Ashley M. Kirchner
304855 by: Bobby Pejman
304856 by: Nathan Rixham
304857 by: Nathan Rixham
304858 by: Ashley M. Kirchner
304859 by: Ashley M. Kirchner
304860 by: Ashley M. Kirchner
304862 by: Angus Mann
304863 by: Mark Kelly
304864 by: Ashley M. Kirchner
304865 by: Paul M Foster
304866 by: Adam Richardson
304867 by: Ashley M. Kirchner
304868 by: Ashley M. Kirchner
304869 by: Nilesh Govindarajan
304870 by: Karl DeSaulniers
304871 by: Ashley M. Kirchner
304872 by: Karl DeSaulniers
304873 by: Ashley M. Kirchner
How do I use date_diff in my code (both codes are included, mine and the
example function) I need process.php
304861 by: justino garcia
Re: Two color rows in table inside while iteration -- just say no to mod
304874 by: Jochen Schultz
Re: ldap add Invalid DN syntax
304875 by: Manolis Vlachakis
Inserting rows with missing IDs
304876 by: Andre Polykanine
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Slightly OT, but I can't think of a better forum to ask this in. I'm sure a
lot of us here have at some point or another built a system that requires
registration to gain access. What I'm trying to figure is how to set
different levels of access.
We're building a large site for a school district, to be used by both
students and parents. When a student logs in, they gain some access to the
site, and when a parent logs in, they gain access to other sections on the
site. That's all fine and dandy, it's the actual registration process that
I'm having a hard time with.
How to determine if a registration is a student or a parent. Do I simply
give them a check box (or other method) to pick from (student or parent) and
hope they're being honest? Has anyone here have to deal with that in the
past, and would you be willing to give me some ideas of what you did?
Thanks!
--- End Message ---
--- Begin Message ---
On 05/03/2010 07:39 AM, Ashley M. Kirchner wrote:
Slightly OT, but I can't think of a better forum to ask this in. I'm sure a
lot of us here have at some point or another built a system that requires
registration to gain access. What I'm trying to figure is how to set
different levels of access.
We're building a large site for a school district, to be used by both
students and parents. When a student logs in, they gain some access to the
site, and when a parent logs in, they gain access to other sections on the
site. That's all fine and dandy, it's the actual registration process that
I'm having a hard time with.
How to determine if a registration is a student or a parent. Do I simply
give them a check box (or other method) to pick from (student or parent) and
hope they're being honest? Has anyone here have to deal with that in the
past, and would you be willing to give me some ideas of what you did?
Thanks!
Its a very bad idea to allow public registration for parents, instead
the school IT department should give accounts to students and parents.
--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !
--- End Message ---
--- Begin Message ---
Ashley M. Kirchner wrote:
> Slightly OT, but I can't think of a better forum to ask this in. I'm sure a
> lot of us here have at some point or another built a system that requires
> registration to gain access. What I'm trying to figure is how to set
> different levels of access.
>
>
>
> We're building a large site for a school district, to be used by both
> students and parents. When a student logs in, they gain some access to the
> site, and when a parent logs in, they gain access to other sections on the
> site. That's all fine and dandy, it's the actual registration process that
> I'm having a hard time with.
>
>
>
> How to determine if a registration is a student or a parent. Do I simply
> give them a check box (or other method) to pick from (student or parent) and
> hope they're being honest? Has anyone here have to deal with that in the
> past, and would you be willing to give me some ideas of what you did?
> Thanks!
Ideally you need to be able to unambiguously identify either a student
or a parent, you're best bet is to go for student - thus try and find a
single bit of information that both a student and you know about that
student, possibilities are:
student id
class
teacher
year
and so forth.. if the person signing up has any of these things then
they must be a student.
Best,
Nathan
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Nilesh Govindarajan [mailto:li...@itech7.com]
> Sent: Sunday, May 02, 2010 8:20 PM
> To: php-gene...@lists.php.net
> Subject: Re: [PHP] Need login suggestions
>
> Its a very bad idea to allow public registration for parents, instead
> the school IT department should give accounts to students and parents.
Now, how does that answer the question? What does it matter to you how or
where this is being done? That's not what I was asking. The simple fact that
I mentioned a school district in my e-mail, you took that approach. I could've
just as well mentioned a completely different scenario. The point is, the
question is about different levels of access based on a registration process.
--- End Message ---
--- Begin Message ---
I would also agree that allowing parent registration could be risky. What you
may be able to do just off the top is create a UserLevel field in your users
table and assign value 1 for all those who say they're students. That is, if
you have no student ids at your disposal.
Then, when parents register, you can ask who their kid is, and assign a user
level 2, for example. When a parent finishes their registration, don't allow
them access. Display a message saying "you'll have to call in to get your
password" or something similar.
What you're essentially doing is identifying parents by their user level yet
making sure parents are parents.
Just an idea I thought I share.
-----Original Message-----
From: Nathan Rixham <nrix...@gmail.com>
Date: Mon, 03 May 2010 03:21:12
To: Ashley M. Kirchner<ash...@pcraft.com>
Cc: <php-gene...@lists.php.net>
Subject: [PHP] Re: Need login suggestions
Ashley M. Kirchner wrote:
> Slightly OT, but I can't think of a better forum to ask this in. I'm sure a
> lot of us here have at some point or another built a system that requires
> registration to gain access. What I'm trying to figure is how to set
> different levels of access.
>
>
>
> We're building a large site for a school district, to be used by both
> students and parents. When a student logs in, they gain some access to the
> site, and when a parent logs in, they gain access to other sections on the
> site. That's all fine and dandy, it's the actual registration process that
> I'm having a hard time with.
>
>
>
> How to determine if a registration is a student or a parent. Do I simply
> give them a check box (or other method) to pick from (student or parent) and
> hope they're being honest? Has anyone here have to deal with that in the
> past, and would you be willing to give me some ideas of what you did?
> Thanks!
Ideally you need to be able to unambiguously identify either a student
or a parent, you're best bet is to go for student - thus try and find a
single bit of information that both a student and you know about that
student, possibilities are:
student id
class
teacher
year
and so forth.. if the person signing up has any of these things then
they must be a student.
Best,
Nathan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Bobby Pejman wrote:
> I would also agree that allowing parent registration could be risky. What
> you may be able to do just off the top is create a UserLevel field in your
> users table and assign value 1 for all those who say they're students. That
> is, if you have no student ids at your disposal.
>
> Then, when parents register, you can ask who their kid is, and assign a user
> level 2, for example. When a parent finishes their registration, don't allow
> them access. Display a message saying "you'll have to call in to get your
> password" or something similar.
>
> What you're essentially doing is identifying parents by their user level yet
> making sure parents are parents.
>
> Just an idea I thought I share.
yeah - that's quite a strong point! whatever you do, do not give any
details of students to anybody unless they are 100% verified and allowed
the info - that's one thing I would not want to screw up on myself,
could be a nasty lawsuit.
best,
nathan
--- End Message ---
--- Begin Message ---
Ashley M. Kirchner wrote:
>> -----Original Message-----
>> From: Nilesh Govindarajan [mailto:li...@itech7.com]
>> Sent: Sunday, May 02, 2010 8:20 PM
>> To: php-gene...@lists.php.net
>> Subject: Re: [PHP] Need login suggestions
>>
>> Its a very bad idea to allow public registration for parents, instead
>> the school IT department should give accounts to students and parents.
>
> Now, how does that answer the question? What does it matter to you how or
> where this is being done? That's not what I was asking. The simple fact
> that I mentioned a school district in my e-mail, you took that approach. I
> could've just as well mentioned a completely different scenario. The point
> is, the question is about different levels of access based on a registration
> process.
>
Ashley,
I think Nilesh, (and later both Bobby & I), were just looking out for
our fellow developer, with good, if not the best intentions.
Consider the scenario where you are making a school district site for
students and parents, and you slipped up and gave access to kids details
to anybody who claimed to be a parent - I think in that scenario you'd
really appreciate the gentle nudge - and we, many of us parents,
wouldn't want the possibility of a hurt (or worse) child due to not
speaking up ;)
Regards,
Nathan
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Nathan Rixham [mailto:nrix...@gmail.com]
> Sent: Sunday, May 02, 2010 8:39 PM
> To: Ashley M. Kirchner
> Cc: php-gene...@lists.php.net; Nilesh Govindarajan
> Subject: Re: [PHP] Need login suggestions
>
> Ashley,
>
> I think Nilesh, (and later both Bobby & I), were just looking out for
> our fellow developer, with good, if not the best intentions.
>
> Consider the scenario where you are making a school district site for
> students and parents, and you slipped up and gave access to kids
> details
> to anybody who claimed to be a parent - I think in that scenario you'd
> really appreciate the gentle nudge - and we, many of us parents,
> wouldn't want the possibility of a hurt (or worse) child due to not
> speaking up ;)
While I can appreciate that, this isn't the case here. This isn't sensitive
information being broadcasted here. It's simply a matter of figuring out who's
registering for what. Kids would be registering for a photo contest, parents
will be registering for something completely different. So what if a student
registers on the wrong side of the wall? Nothing happens there other than not
having the ability to participate in the photo contest because it won't be
available to them. And they can't *see* anything that the parents have done
either, those are all contained within each specific account.
I did take offense in Nilesh response because to me all he did was jump right
down my throat and tell me not to do something (or that it's a "very bad idea")
without even knowing WHAT it is that's being done. Whether this was a school
district, or a gaming website between friends, it makes absolutely no
difference. I'm asking about the specifics for a registration mechanism, NOT
whether I should share information, nor what kind of information is being
shared.
This is a public school district, and we DO allow public registrations on our
campus, because not all schools fall under our central system, and because
parents want information.
I'm simply inquiring from others if anyone has thought this through and come up
with some way of determining who's who when they register, and I hate to say
it, but so far the only person that actually answered my question with ideas
was you, Nathan. So far everyone else has done nothing but say 'don't do it'.
That's not helping any.
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Nathan Rixham [mailto:nrix...@gmail.com]
> Sent: Sunday, May 02, 2010 8:21 PM
> To: Ashley M. Kirchner
> Cc: php-gene...@lists.php.net
> Subject: Re: Need login suggestions
>
> Ideally you need to be able to unambiguously identify either a student
> or a parent, you're best bet is to go for student - thus try and find a
> single bit of information that both a student and you know about that
> student, possibilities are:
Yep, easier said than done. It would be rather easy to determine a
student, they're all common login formats. Staff e-mails are different yet,
as are others. However, for the charter schools, they don't fall in the
same "common" pool, and thus have totally different e-mails, public e-mails
at that. So I can't simply rely on their e-mail.
I can certainly ask for a student ID (and verify that on the
backend), but again, parents also know their student's IDs. They also know
what year. Teacher won't have any bearing here because there is no such
thing as a 'home room' at the level we're working at. I'm not so much
worried about a parent registering on the wrong side of the wall ... the
access would be even less anyway. And while a student registering on the
wrong side simply won't give them access to the contest, there is also no
reason for them to be there. And rather than me getting an e-mail to change
their registration, I'd rather it happen automatically. There is nothing on
the parent side that is a secret or that the student can't know. This isn't
any kind of secure or secret site we're working with here.
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Bobby Pejman [mailto:bpej...@gmail.com]
> Sent: Sunday, May 02, 2010 8:30 PM
> To: Nathan Rixham; Ashley M. Kirchner
> Cc: php-gene...@lists.php.net
> Subject: Re: [PHP] Re: Need login suggestions
>
> I would also agree that allowing parent registration could be risky.
> What you may be able to do just off the top is create a UserLevel field
> in your users table and assign value 1 for all those who say they're
> students. That is, if you have no student ids at your disposal.
>
> Then, when parents register, you can ask who their kid is, and assign a
> user level 2, for example. When a parent finishes their registration,
> don't allow them access. Display a message saying "you'll have to call
> in to get your password" or something similar.
>
> What you're essentially doing is identifying parents by their user
> level yet making sure parents are parents.
>
> Just an idea I thought I share.
What you're suggesting, multi level access, is already in place. It's
determined by whatever group a login falls in, student, staff,
administrator, contractor, volunteer, parent, etc., etc. However, for what
I'm doing, working with one of the departments, we don't have full access to
the LDAP server to verify a login, nor can we expect someone registering for
*transportation* is also registered in the main LDAP server. So things work
separately.
What we're doing has nothing at all to do with what's on the main server.
No personal information is being shared or broadcasted. No student
information, absolutely nothing. This is strictly a case of 'user A' versus
'user B' and figuring out a way to determine, through registration, what
level of access they get. Is it based solely on the honor system, hoping
that each user does the right thing when they register, or have people come
up with some other kind of mechanism ...
--- End Message ---
--- Begin Message ---
We're building a large site for a school district, to be used by both
students and parents. When a student logs in, they gain some access to
the
site, and when a parent logs in, they gain access to other sections on the
site. That's all fine and dandy, it's the actual registration process
that
I'm having a hard time with.
How to determine if a registration is a student or a parent. Do I simply
give them a check box (or other method) to pick from (student or parent)
and
hope they're being honest? Has anyone here have to deal with that in the
past, and would you be willing to give me some ideas of what you did?
Thanks!
It sounds like it really doesn't matter how you do it. Nothing bad happens
if a student registers as a parent or vice-versa and the only person
inconvenienced is the end-user. I would just take some simple steps to ask
the person if they want to view as a student or as a parent. Have you
considered the option of just letting people register, and then allowing
them to select a radio-button labelled "Show me information important to
parents" or "Show me information relevant to students" or "Show me
information relevant to both".
Some users might quite legitimately want to see both sets of content.
That will be 2 cents, please.
--- End Message ---
--- Begin Message ---
Hi.
On Monday 03 May 2010 at 03:49 Ashley M. Kirchner wrote:
[snip]
>So what if a student registers on the wrong side of the wall? Nothing
> happens
[snip]
> Kids would be registering for a
> photo contest, parents will be registering for something completely
> different.
You might try changing the interface to reflect the above - instead of
dividing the users into students and parents, give them two nice big buttons
to click "Register for Photo Contest" and "Register for This Other Thing".
As far as managing the differences in code, when they log in stick $userType
(from the database I guess) in the session and check it in every secured page
to control who sees what. I've done several variations on this particular
theme; it's simple to manage, especially if you have a page initialisation
function/method you can put the $userType check into.
HTH,
Mark
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Angus Mann [mailto:angusm...@pobox.com]
> Sent: Sunday, May 02, 2010 10:43 PM
> To: Ashley M. Kirchner; php-gene...@lists.php.net
> Subject: Re: [PHP] Need login suggestions
>
> It sounds like it really doesn't matter how you do it. Nothing bad
> happens
> if a student registers as a parent or vice-versa and the only person
> inconvenienced is the end-user. I would just take some simple steps to
> ask
> the person if they want to view as a student or as a parent. Have you
> considered the option of just letting people register, and then
> allowing
> them to select a radio-button labelled "Show me information important
> to
> parents" or "Show me information relevant to students" or "Show me
> information relevant to both".
>
> Some users might quite legitimately want to see both sets of content.
Hmm, didn't think of that. I suppose it's possible a parent might want to
see both sides, though a student ... can't think of a reason why but in the
end, I don't know if it really matters. Thanks for the suggestion!
--- End Message ---
--- Begin Message ---
On Sun, May 02, 2010 at 08:09:07PM -0600, Ashley M. Kirchner wrote:
> Slightly OT, but I can't think of a better forum to ask this in. I'm sure a
> lot of us here have at some point or another built a system that requires
> registration to gain access. What I'm trying to figure is how to set
> different levels of access.
>
>
>
> We're building a large site for a school district, to be used by both
> students and parents. When a student logs in, they gain some access to the
> site, and when a parent logs in, they gain access to other sections on the
> site. That's all fine and dandy, it's the actual registration process that
> I'm having a hard time with.
>
>
>
> How to determine if a registration is a student or a parent. Do I simply
> give them a check box (or other method) to pick from (student or parent) and
> hope they're being honest? Has anyone here have to deal with that in the
> past, and would you be willing to give me some ideas of what you did?
> Thanks!
>
The only reliable way to resolve this is to let the school
administration to handle it. Each registration would *attempt* to
register as a student, parent or whatever. Those attempted registrations
would go into a "wait" queue. Meantime, emails would be sent to an
administrator whose job is would be to "bless" those registrations. They
would check to see if a potential registrant was what they claimed to
be. You'd give them a page where the queued registration attempts would
show up. And they would check the proper box for each potential
registrant. Once done, the registration would be completed, and in the
proper category.
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
On Mon, May 3, 2010 at 12:42 AM, Angus Mann <angusm...@pobox.com> wrote:
> We're building a large site for a school district, to be used by both
>> students and parents. When a student logs in, they gain some access to
>> the
>> site, and when a parent logs in, they gain access to other sections on the
>> site. That's all fine and dandy, it's the actual registration process
>> that
>> I'm having a hard time with.
>>
>> How to determine if a registration is a student or a parent. Do I simply
>> give them a check box (or other method) to pick from (student or parent)
>> and
>> hope they're being honest? Has anyone here have to deal with that in the
>> past, and would you be willing to give me some ideas of what you did?
>> Thanks!
>>
>> It sounds like it really doesn't matter how you do it. Nothing bad
> happens if a student registers as a parent or vice-versa and the only person
> inconvenienced is the end-user. I would just take some simple steps to ask
> the person if they want to view as a student or as a parent. Have you
> considered the option of just letting people register, and then allowing
> them to select a radio-button labelled "Show me information important to
> parents" or "Show me information relevant to students" or "Show me
> information relevant to both".
>
> Some users might quite legitimately want to see both sets of content.
>
> That will be 2 cents, please.
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Just be cautious with FERPA guidelines (which can actually get quite
confusing) if you're doing this in the US. For instance, normally a child's
name is considered "Directory information", or that is, information that a
school can disseminate without consent. However, this requires that the
school provided the parents an opportunity to opt-out of such disclosures.
As a developer of some educational games AND the husband of an elementary
teacher, I realize FERPA can be quite challenging at times.
I point this out just in case the process you considered included presenting
a drop-down of student names or anything like that in the publicly
accessible interface.
Here's the links just in case you haven't already read-up (that is, if this
even applies to you):
http://www2.ed.gov/policy/gen/guid/fpco/ferpa/index.html
If you've already researched this or you're not in the US, I apologize for
the irrelevant info.
Happy coding,
Adam
--
Nephtali: PHP web framework that functions beautifully
http://nephtaliproject.com
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Paul M Foster [mailto:pa...@quillandmouse.com]
> Sent: Sunday, May 02, 2010 10:53 PM
> To: php-gene...@lists.php.net
> Subject: Re: [PHP] Need login suggestions
>
> The only reliable way to resolve this is to let the school
> administration to handle it. Each registration would *attempt* to
> register as a student, parent or whatever. Those attempted
> registrations
> would go into a "wait" queue. Meantime, emails would be sent to an
> administrator whose job is would be to "bless" those registrations.
> They
> would check to see if a potential registrant was what they claimed to
> be. You'd give them a page where the queued registration attempts would
> show up. And they would check the proper box for each potential
> registrant. Once done, the registration would be completed, and in the
> proper category.
Yeah, that would fall on our shoulders. School administration won't do
this. It comes back to the IT Department and we have to "figure it out".
The problem is, while we can "bless" student registrations, we can't always
tell if the next one is a parent or not, or if it's a parent in our
district.
We do have another system in place, one in which we hand out 2 unique keys
for each student at each school and parents pick those up. Internally those
keys are matched to that student so we know who it is that's registering.
However, that requires a lot of front work to get those keys out.
For this particular project, we want to make it as painless as possible, but
the more I think about it, the more I'm accepting the impossible nature of
it.
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Adam Richardson [mailto:simples...@gmail.com]
> Sent: Sunday, May 02, 2010 10:59 PM
> To: php-gene...@lists.php.net
> Subject: Re: [PHP] Need login suggestions
>
> Just be cautious with FERPA guidelines (which can actually get quite
> confusing) if you're doing this in the US. For instance, normally a
> child's
> name is considered "Directory information", or that is, information
> that a
> school can disseminate without consent. However, this requires that
> the
> school provided the parents an opportunity to opt-out of such
> disclosures.
> As a developer of some educational games AND the husband of an
> elementary
> teacher, I realize FERPA can be quite challenging at times.
>
> I point this out just in case the process you considered included
> presenting
> a drop-down of student names or anything like that in the publicly
> accessible interface.
>
> Here's the links just in case you haven't already read-up (that is, if
> this
> even applies to you):
> http://www2.ed.gov/policy/gen/guid/fpco/ferpa/index.html
Nothing is getting displayed anywhere, especially student information. In
fact, this particular interface is detached from our main database for that
exact reason. It's being done on an opt-in system too. We don't make the
assumption that everyone wants to be included by default. We let them come
to us.
--- End Message ---
--- Begin Message ---
On 05/03/2010 10:33 AM, Ashley M. Kirchner wrote:
-----Original Message-----
From: Paul M Foster [mailto:pa...@quillandmouse.com]
Sent: Sunday, May 02, 2010 10:53 PM
To: php-gene...@lists.php.net
Subject: Re: [PHP] Need login suggestions
The only reliable way to resolve this is to let the school
administration to handle it. Each registration would *attempt* to
register as a student, parent or whatever. Those attempted
registrations
would go into a "wait" queue. Meantime, emails would be sent to an
administrator whose job is would be to "bless" those registrations.
They
would check to see if a potential registrant was what they claimed to
be. You'd give them a page where the queued registration attempts would
show up. And they would check the proper box for each potential
registrant. Once done, the registration would be completed, and in the
proper category.
Yeah, that would fall on our shoulders. School administration won't do
this. It comes back to the IT Department and we have to "figure it out".
The problem is, while we can "bless" student registrations, we can't always
tell if the next one is a parent or not, or if it's a parent in our
district.
We do have another system in place, one in which we hand out 2 unique keys
for each student at each school and parents pick those up. Internally those
keys are matched to that student so we know who it is that's registering.
However, that requires a lot of front work to get those keys out.
For this particular project, we want to make it as painless as possible, but
the more I think about it, the more I'm accepting the impossible nature of
it.
Ugh that's what I had suggested, but you turned it into a big fight LOL.
--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !
--- End Message ---
--- Begin Message ---
Hi Ashley,
I would have your database that is attached to this part of the website,
verify with another database that stores all your student and parent
info for your school
and when they register, you can actually check against a database of
students that actually
attend the school and the parents of that student on your server not
through a login form.
I believe there is a way to set up a cron or something like that
where the check is made at
the server level and no one else can check that way.
I am not a professional at php, but I believe I read about this
capability somewhere.
If someone knows the actual term for this please, interject.
Also, I would probably ask how to do that on the PHP-Database list
Databases and PHP - choose this one
http://www.php.net/mailing-lists.php
HTH,
On May 2, 2010, at 9:09 PM, Ashley M. Kirchner wrote:
Slightly OT, but I can't think of a better forum to ask this in.
I'm sure a
lot of us here have at some point or another built a system that
requires
registration to gain access. What I'm trying to figure is how to set
different levels of access.
We're building a large site for a school district, to be used by both
students and parents. When a student logs in, they gain some
access to the
site, and when a parent logs in, they gain access to other sections
on the
site. That's all fine and dandy, it's the actual registration
process that
I'm having a hard time with.
How to determine if a registration is a student or a parent. Do I
simply
give them a check box (or other method) to pick from (student or
parent) and
hope they're being honest? Has anyone here have to deal with that
in the
past, and would you be willing to give me some ideas of what you did?
Thanks!
Karl DeSaulniers
Design Drumm
http://designdrumm.com
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Karl DeSaulniers [mailto:k...@designdrumm.com]
> Sent: Sunday, May 02, 2010 11:44 PM
> To: PHP
> Subject: Re: [PHP] Need login suggestions
>
> Hi Ashley,
> I would have your database that is attached to this part of the
> website,
> verify with another database that stores all your student and parent
> info for your school
> and when they register, you can actually check against a database of
> students that actually
> attend the school and the parents of that student on your server not
> through a login form.
> I believe there is a way to set up a cron or something like that
> where the check is made at
> the server level and no one else can check that way.
That will only work for a rather small subset of students and parents.
Unfortunately not all students in the district are actually in our main
database. Those attending charter schools are not, so we can't verify them.
And not all parents are actually registered in our main database. Like I
mentioned, we don't assume everyone wants "in" on our systems, we let them
come to us. So if they don't, we don't have them. (It's amazing how many
don't care how their kids are doing in school.)
For this project we're working on, we have parents and students who are not
in our main DB wanting to be part of it. Manually, we can check who they
are and do the verification that way. But, try doing that for several
thousands of registrations and it gets old really fast. This is why we've
been asked to make it as automated as possible.
Can't say I'm happy to work on this but such is life ...
--- End Message ---
--- Begin Message ---
I see, well I have a login that has multiple levels and here is how I
have it.
Obvious pertinent info has been changed, but you can adopt and add
your own.
a config file with userlevel values EG:
$parent = 2; //Parent Level
$student = 1; //Student Level
$guest = 0;//Guest level
A define.php file with things defined EG:
include or require the config.php in this file
define("PARENT", $parent);
define("STUDENT", $student);
Then work some functions to check the levels in your sessions php file.
That way every page thats pulled up, it checks the login status and
the userlevel.
EG:
include or require the define.php in the session php
//Inside the session php
function isParent(){
return ($this->userlvl == PARENT);
}
function isStudent(){
return ($this->userlvl == STUDENT);
}
$this->userlvl will be the level recorded after registration was
completed the first time.
You should be checking this and retrieving this at login. Basically
setting it as a session variable with it that gets carried through.
Eg usage:
if($this->isParent()) {
//do this
}
HTH,
On May 3, 2010, at 12:43 AM, Karl DeSaulniers wrote:
Hi Ashley,
I would have your database that is attached to this part of the
website,
verify with another database that stores all your student and
parent info for your school
and when they register, you can actually check against a database
of students that actually
attend the school and the parents of that student on your server
not through a login form.
I believe there is a way to set up a cron or something like that
where the check is made at
the server level and no one else can check that way.
I am not a professional at php, but I believe I read about this
capability somewhere.
If someone knows the actual term for this please, interject.
Also, I would probably ask how to do that on the PHP-Database list
Databases and PHP - choose this one
http://www.php.net/mailing-lists.php
HTH,
On May 2, 2010, at 9:09 PM, Ashley M. Kirchner wrote:
Slightly OT, but I can't think of a better forum to ask this in.
I'm sure a
lot of us here have at some point or another built a system that
requires
registration to gain access. What I'm trying to figure is how to set
different levels of access.
We're building a large site for a school district, to be used by both
students and parents. When a student logs in, they gain some
access to the
site, and when a parent logs in, they gain access to other
sections on the
site. That's all fine and dandy, it's the actual registration
process that
I'm having a hard time with.
How to determine if a registration is a student or a parent. Do I
simply
give them a check box (or other method) to pick from (student or
parent) and
hope they're being honest? Has anyone here have to deal with that
in the
past, and would you be willing to give me some ideas of what you did?
Thanks!
Karl DeSaulniers
Design Drumm
http://designdrumm.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Karl DeSaulniers
Design Drumm
http://designdrumm.com
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Karl DeSaulniers [mailto:k...@designdrumm.com]
> Sent: Monday, May 03, 2010 12:03 AM
> To: PHP
> Subject: Re: [PHP] Need login suggestions
>
> I see, well I have a login that has multiple levels and here is how I
> have it.
> Obvious pertinent info has been changed, but you can adopt and add
> your own.
That part I already have and isn't the problem. We're at the 'who is this
person registering' stage before I can even determine what level they belong
in. :)
--- End Message ---
--- Begin Message ---
HOw would I use this function below, from this url
http://php.net/manual/en/function.date-diff.php
I need to output the subject, date, and the final answer to the calcuation
of the time difference (say from e.g. 10:00 AM to 12:00 PM) . Getting total
time wrked on at a job site, doing helpdesk. I am doing this for me to send
a preformated email to acounting, it will help since I am busy at work and
suck at counting time worked due to my adhd and dyslxia.
Thanks
<http://php.net/manual/en/function.date-diff.php>
This function calculates the difference up to the second.
<?php
function date_diff($start, $end="NOW")
{
$sdate = strtotime($start);
$edate = strtotime($end);
$time = $edate - $sdate;
if($time>=0 && $time<=59) {
// Seconds
$timeshift = $time.' seconds ';
} elseif($time>=60 && $time<=3599) {
// Minutes + Seconds
$pmin = ($edate - $sdate) / 60;
$premin = explode('.', $pmin);
$presec = $pmin-$premin[0];
$sec = $presec*60;
$timeshift = $premin[0].' min '.round($sec,0).' sec ';
} elseif($time>=3600 && $time<=86399) {
// Hours + Minutes
$phour = ($edate - $sdate) / 3600;
$prehour = explode('.',$phour);
$premin = $phour-$prehour[0];
$min = explode('.',$premin*60);
$presec = '0.'.$min[1];
$sec = $presec*60;
$timeshift = $prehour[0].' hrs '.$min[0].' min '.round($sec,
0).' sec ';
} elseif($time>=86400) {
// Days + Hours + Minutes
$pday = ($edate - $sdate) / 86400;
$preday = explode('.',$pday);
$phour = $pday-$preday[0];
$prehour = explode('.',$phour*24);
$premin = ($phour*24)-$prehour[0];
$min = explode('.',$premin*60);
$presec = '0.'.$min[1];
$sec = $presec*60;
$timeshift = $preday[0].' days '.$prehour[0].' hrs '.$min[0
].' min '.round($sec,0).' sec ';
}
return $timeshift;
}
// EXAMPLE:
$start_date = 2010-03-15 13:00:00
$end_date = 2010-03-17 09:36:15
echo date_diff($start_date, $end_date);
?>
*MY
CODE-------------------------------------------------------------------------------===============================--------------------------------
*
"<html><body>
Hello there TechSquad!<br >
<form action="process.php" method="post">
<p>
<select name="item">
<option selected>MLS</option>
<option>ITS</option>
<option>JCPA</option>
<option>Kocher</option>
<option>Bagel Buffet</option>
<option>Warranty Title</option>
<option>Metalico</option>
</select> </p>
<p>Date: <input type="'text"
name=date ??></p>
<p>Subject: <input name="quantity" style="WIDTH: 280px; HEIGHT: 25px"
size="27"> </p>
<p>
<select name=StartTime>
<?php
$hours = range(0, 12);
$mins = range(0, 59, 15);
$time = array();
foreach ($hours as $h)
{
foreach ($mins as $m)
{
$val = sprintf("%02d:%02d"." AM", $h, $m);
$time[$val] = $val;
echo '<option>' . $time[$val] . '</option>' .
"\n";
}
}
?>
</select>
<select name=EndTime>
<?php
$hours = range(1, 12);
$mins = range(0, 59, 15);
$time = array();
foreach ($hours as $h)
{
foreach ($mins as $m)
{
$val = sprintf("%02d:%02d"." PM", $h, $m);
$time[$val] = $val;
echo '<option>' . $time[$val] . '</option>' .
"\n";
}
}
?>
</select>
<textarea style="Z-INDEX: 0; WIDTH: 343px; HEIGHT: 163px; TOP: 258px; LEFT:
15px" rows="6" cols="27" name="body_email">Enter the work done
here.</textarea></p>
<p><input value="Submit Query" type="submit">
</p></form></body></html>
--
Justin
IT-TECH
--
Justin
IT-TECH
--- End Message ---
--- Begin Message ---
> [snip]
And unless we are adding a multiple seconds to the load time is anyone
going to notice a difference of 1 second?
yes
regards
Jochen
--- End Message ---
--- Begin Message ---
and my code begins like this...
$uploaddir =
$_SERVER['DOCUMENT_ROOT'].'/webteam/voiko/public_html/uploads/';
$file = $uploaddir . basename($_FILES['uploadfile']['name']);
$data = file_get_contents($uploaddir . $_FILES["uploadfile"]["name"]);
$data=split("[;\r]",$data);
;
$num = count($data);
var_dump($data);
............
and goes on as i show you on the last mails..
On 30 April 2010 17:22, Manolis Vlachakis <vlachakis.mano...@gmail.com>wrote:
> on the array and on the server side i can see the names are added normally
> and with the correct encode(despite what i show you )
> and the only thing is tha i get that DN not valid...
> i used the \r cause i use it on my csv file at least one...
> but i am sure (i used a counter for the letters + i compered the name they
> are the same)
>
> so it is pretty strange why is not working...
>
>
> 1.trust me after many times faced problems with delimiters i can tell you
> the correct is with [ ] and your delimiter in between
> 2.print_r seems good exactly what i have in csv file..
> 3.var_dump works fine counts everything and stuff but even though i get the
> right attributes ...
> i still have the same error....(see below)
> it's made me crazy....
>
>
>
> onoma-->�������|epwnimo-->��������������
> *Warning*: ldap_add()
> [function.ldap-add<https://195.251.90.188:65007/~voiko/admin/function.ldap-add>]:
> Add: Invalid DN syntax
>
> Thank you for your answer
>
>
> On 30 April 2010 16:53, Ashley Sheridan <a...@ashleysheridan.co.uk> wrote:
>
>> On Fri, 2010-04-30 at 14:34 +0300, Manolis Vlachakis wrote:
>>
>> Hallo there everyone
>> although i have built my code correctly according to the examples i found on
>> the net..
>> i get Invalid DN syntax error when i try to insert some attributes with ldap
>> add..
>>
>> i get and read a csv file where i get the data correctly as i can see on the
>> echos that follow:
>>
>> *$data=split("[;\r]",$data);*
>> *
>> *
>> * **$info["cn"]= $data[$c];*
>> * **echo "|onoma-->";*
>> * **echo $info["cn"] ;//*
>> * ** ** $c++;*
>> * **$info["sn"]= $data[$c];*
>> * **echo "|epwnimo-->";*
>> * **echo $info["sn"] ;*
>> * *
>> * **$info["objectclass"][0] = "top";*
>> * ** ** $info["objectclass"][1] = "organizationalPerson";*
>> * *
>> * ** *
>> * ** $r = ldap_add($ldapconn,
>> "cn=".$info['cn'].",cn=*****,ou=@@@,ou=****.,ou=****,dc=.....dc=....",
>> $info);*
>>
>> funny thing is that when i put them absolute like *$info["sn"]= "bla
>> bla";* it works fine...
>> any ideas?
>>
>>
>> Are you using the correct split() delimiter? What happens if you just
>> output that array with print_r() or var_dump()? I see the delimiter as:
>>
>> [;
>> ]
>>
>> Because the \r is recognised as a carriage return because your string is
>> in double quotes.
>>
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>>
>>
>>
>
>
> --
> Manolis Vlachakis
>
> Nelly's Family Hotel
> Visit : www.nellys-hotel.gr
> www.nellys.gr
> Skype : manolis.vlachakis
>
--
Manolis Vlachakis
Nelly's Family Hotel
Visit : www.nellys-hotel.gr
www.nellys.gr
Skype : manolis.vlachakis
--- End Message ---
--- Begin Message ---
Hello everyone,
It's not a strictly PHP question, however since I use that with PHP,
I'm asking it there.
How can I accomplish the task of inserting rows into MySql database
with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and
195. How do I make the check that allows to insert firstly the missing
IDs and only then apply the auto-increment?
Thanks!
--
With best regards from Ukraine,
Andre
Http://oire.org/ - The Fantasy blogs of Oire
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: http://twitter.com/m_elensule
--- End Message ---