in the idx_users table, what is the difference between status and group_id?
what are the possible values for each and how/when/where is each value used in INDEXU???
in the idx_users table, what is the difference between status and group_id?
what are the possible values for each and how/when/where is each value used in INDEXU???
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."
.
status is for determine users status:
- 0 : not active / not yet enter validation code
- 1 : active user
group id:
- 0 : admin
- 1 : editor
- 100 : normal user
hmmm....all new users are assigned a group_id of 2.Originally posted by dody
group id:
- 0 : admin
- 1 : editor
- 100 : normal user
The ApproveEditor function in link.class.php does not change the group_id. I cannot find where the group_id in the idx_user is ever changed when a user is approved as an editor. Thus, all users are have a group_id of 2
I'm confused about the GetUserAuthentication function in users.class.php
the function itself shows GetUserAuthentication($group_id = 100) {
that would assign the group_id a value of 100 ( a normal user per your definition above although they all have a value of 2 in the database )
Since group_id is assigned a value of 100, it would seem like passing a parameter thru the GetUserAuthentication would not work.
passing 0 would not work: if($users_obj->GetUserAuthentication(0)!=0){
In cp/index.php you have
// get editor menu
if($users_obj->GetUserAuthentication(1)==0){
doesn't the GetUserAuthentication($group_id = 100) mean that the 1 is never used inside to the function ( wouldn't it need to be GetUserAuthentication($g_id, $group_id = 100). Then $g_id would have the value of 1 inside the GetUserAuthentication function?)
QUESTION: is
!$users_obj->GetUserAuthentication()==0
the same as
$users_obj->GetUserAuthentication()!=0
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."
.
GetUserAuthentication($group_id = 100) mean the default value is 100 if there's no paramenter.
It's my carelessness having value 2 and 100 for normal user. Both are the same. Sorry for ambigiuity.
even both work well, but
$users_obj->GetUserAuthentication()!=0 is more readable
OK, I see! said the blind man...: rolleyes:
Now that I understand how passing parameters in PHP works ( well, at least in this situation).
If you do not pass a parameter, then GetUserAuthentication() uses this section.
If you do pass a parameter, then GetUserAuthentication(1) uses this section.Code:if ($group_id == 100) { if($COOKIE_USER_AUTHENTICATED && $COOKIE_PASSWORD == $pwd) return 0; else return 1; }
My question is this: I cannot find where the group_id is set to 1 for an approved editor.Code:else { if($COOKIE_USER_AUTHENTICATED && $COOKIE_PASSWORD == $pwd && $group_id == $gid) return 0; else return 1; }
Thus, if the group_id is not set to 1 for an editor, then in /cp/index.php the following line will fail
Code:// get editor menu if($users_obj->GetUserAuthentication(1)==0){
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."
.
Yooooo .... correct! Please read php manual for detail passing a value to functionIf you do pass a parameter, then GetUserAuthentication(1) uses this section.
I check the codes again, indexu never sign group_id to 1 to editors, it just replate editor status to 1. It's my mistake, group id not working perfectly: 0 for admin, and others for normal users.My question is this: I cannot find where the group_id is set to 1 for an approved editor.
Thus, if the group_id is not set to 1 for an editor, then in /cp/index.php the following line will fail
(now you know why i re-write all codes again, it's more than year and half old codes, and my mistakes on bad coding)
OK! I am trying to learn some PHP...Originally posted by dody
Yooooo .... correct! Please read php manual for detail passing a value to function![]()
Trying to teach an old dog like me some new tricks takes time..!
![]()
your code is excellent, not need to apologize, and certainly not to me...Originally posted by dody
It's my mistake, group id not working perfectly:...and my mistakes on bad coding)
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."
.