Hi,
I am using version 5.7 rev 1020.
How can I stop one particular group ("members") from resetting the password which is assigned annually by admin. I have very little coding experience but am happy to insert/delete scripts kindly provided by others.
No reset password for selected group
Re: No reset password for selected group
Hello Melroy,
the reset password section appears in 2 case
1- membership_profile.php
2- in the login page
for the first case , you can add a piece of code in footer extras page , to detect the user group, and if he is one of who are not allowed hide the reset passowrd for him
and for the second case , in membership_passwordReset.php , you can use the email or the user name to detect the user group
and if he is a member of a group who are not allowed to reset their passwords , redirect him to the home page
the reset password section appears in 2 case
1- membership_profile.php
2- in the login page
for the first case , you can add a piece of code in footer extras page , to detect the user group, and if he is one of who are not allowed hide the reset passowrd for him
and for the second case , in membership_passwordReset.php , you can use the email or the user name to detect the user group
and if he is a member of a group who are not allowed to reset their passwords , redirect him to the home page
Re: No reset password for selected group
Hi R Tammam,
Thank you for your reply which is very helpful as it will direct me to the areas where I can add/edit the code. Now I just need to work out what piece of code I need. I would appreciate any help from anyone on this please.
Thank you for your reply which is very helpful as it will direct me to the areas where I can add/edit the code. Now I just need to work out what piece of code I need. I would appreciate any help from anyone on this please.
Re: No reset password for selected group
Hello Melroy,
here's the code you will need , it works for me
you will put it into membership_passwordReset.php
the position of the code will be from line 110 to 127
https://www.screencast.com/t/2yFtbNRqeU
and here's the code
youw will only change $not_allowed_groups = array ('students'); with your not allowed students
i hope it would help you
Regards,
Reham
here's the code you will need , it works for me
you will put it into membership_passwordReset.php
the position of the code will be from line 110 to 127
https://www.screencast.com/t/2yFtbNRqeU
and here's the code
youw will only change $not_allowed_groups = array ('students'); with your not allowed students
Code: Select all
$not_allowed_groups = array ('students');
if( $username ){
$reset_coulmn = "memberID";
$reset_value = $username;
}else if ( $email ){
$reset_coulmn = "email";
$reset_value = $email;
}
$query = "select membership_groups.name from membership_groups,membership_users
where membership_users.groupID = membership_groups.groupID and {$reset_coulmn} = '{$reset_value}' ";
$user_group = sqlValue ( $query ,$q);
if ( in_array ($user_group, $not_allowed_groups) ){
header("Location:index.php");
exit;
}
Regards,
Reham
Re: No reset password for selected group
Hi Reham,
Sorry for the delay in responding to your last suggestion. I will give it a try.
Many thanks
Melroy
Sorry for the delay in responding to your last suggestion. I will give it a try.
Many thanks
Melroy
Re: No reset password for selected group
Hi Reham,
I tried the code you provided but it did not work for me. I copied and pasted the code in position 110 changing only $not_allowed_groups = array ('students'); to $not_allowed_groups = array ('members');
I was still able to change the password for a user in the group 'members' when logged in.
I did notice that $reset_coulmn = "memberID"; might have been $reset_column = "memberID"; so I corrected it where appropriate but to no avail.
Any thoughts? Have I missed something?
Regards
Melroy
I tried the code you provided but it did not work for me. I copied and pasted the code in position 110 changing only $not_allowed_groups = array ('students'); to $not_allowed_groups = array ('members');
I was still able to change the password for a user in the group 'members' when logged in.
I did notice that $reset_coulmn = "memberID"; might have been $reset_column = "memberID"; so I corrected it where appropriate but to no avail.
Any thoughts? Have I missed something?
Regards
Melroy
Re: No reset password for selected group
Melory, i think there was something wrong in mentioning the place to put you code ,
so i recorded a screen cast for you explaining where to put your code for the first time and testing it on my project
https://www.screencast.com/t/mJghGyhXLc
so i recorded a screen cast for you explaining where to put your code for the first time and testing it on my project
https://www.screencast.com/t/mJghGyhXLc
Re: No reset password for selected group
Thank you R Tammam for your assistance, Problem has now been resolved. Sorry for not thanking you earlier.