I recently instated a tenure system to the clans after numerous complaints about players taking over a clan by gaining the trust of the leader so that they would promote them to a leader as well.
Once that person became a leader, they kicked out the current leader(s) and officer(s) so that they could become the leader of the clan.
Granted that clan leaders should be susceptible to an overthrow, but I thought the system as it is makes it too easy to remove the current leader. I plan on developing a leader approval rating system wherein the members of said clan vote yes, no or neutral on their approval of the current leader's proficiency at leading the clan. If the leader's approval rating drops below a certain percentage, then the clan members nominate new leaders. The two members that receive the most nominations become nominees for a week long vote of clan members.
I digress; that code will take some time to implement. So, for a quick fix, I changed the clan.php code so that no leaders or clan officers can demote others of their rank if they joined later than the other leader/officer.
That simply means that if you are a leader/officer of a clan, you may not demote or remove another clan leader/officer if they have tenure. In other words, if they joined the clan before you, you can't demote or remove them.
Here is the original code of clan.php (lines 593-599):
if ($row['clanrank']<=$session['user']['clanrank'] && $row['clanrank']>CLAN_APPLICANT && $row['login']!=$session['user']['login']){
rawoutput("<a href='clan.php?op=membership&setrank=".($row['clanrank']-1)."&who=".rawurlencode($row['login'])."'>$demote</a> | ");
addnav("","clan.php?op=membership&setrank=".($row['clanrank']-1)."&who=".rawurlencode($row['login']));
}else{
output_notl("%s | ", $demote);
}
if ($row['clanrank'] <= $session['user']['clanrank'] && $row['login']!=$session['user']['login']){
I suggest the following change to those lines:
if ($row['clanrank']<=$session['user']['clanrank'] && $row['clanrank']>CLAN_APPLICANT && $row['login']!=$session['user']['login'] && $row['clanjoindate'] > $session['user']['clanjoindate']){
rawoutput("<a href='clan.php?op=membership&setrank=".($row['clanrank']-1)."&who=".rawurlencode($row['login'])."'>$demote</a> | ");
addnav("","clan.php?op=membership&setrank=".($row['clanrank']-1)."&who=".rawurlencode($row['login']));
}else{
output_notl("%s | ", $demote);
}
if ($row['clanrank'] <= $session['user']['clanrank'] && $row['login']!=$session['user']['login'] && $row['clanjoindate'] > $session['user']['clanjoindate']){