diff --git a/ag/clan/clan_info.php b/ag/clan/clan_info.php
index efd7dcd..ba11509 100644
--- a/ag/clan/clan_info.php
+++ b/ag/clan/clan_info.php
@@ -41,7 +41,7 @@ if($clan_id == NULL){
}
-if(isset($_GET['value1'])) {
+if(isset($_GET['value1']) || isset($_GET['value2'])) {
switch($what) {
case 'Banner':
case 'Homepage':
@@ -373,6 +373,7 @@ function sendClanNewsletter($user, $text){
}
function setProfile($what, $value1, $value2, $clanid, $rootlvl){
+ echo 'setProfile ';
if($rootlvl < 1) {
return 'Du hast keine Rechte um diese Aktion auszuführen!';
}
@@ -390,7 +391,11 @@ function setProfile($what, $value1, $value2, $clanid, $rootlvl){
mysql_query('UPDATE clan SET Info = \''.$value1.'\' where id = '.$clanid);
return NULL;
case 'Leadership':
- if($value1 == 0){$value1 = 'null';}
+ echo 'setLeadership! ';
+ $clan = getClan($clanid);
+
+ if($value1 == 0 && $rootlvl == 2){$value1 = 'null';}
+ else if($rootlvl == 1) { $value1 = $clan['leader']; }
if($value2 == 0){$value2 = 'null';}
// okay, are we allowed to change?? If we have max members, it is not allowed to remove the co_leader
@@ -398,14 +403,15 @@ function setProfile($what, $value1, $value2, $clanid, $rootlvl){
$members = getClanMembersCount($clanid);
$members_max = getMaximumMembers($clan['id']);
- if($members_max == $members && $clan['leader'] != $clan['co_leader'] && $value1 == $value2) {
+ if($members_max == $members && $clan['leader'] != $clan['co_leader'] && $value1 == $value2 || $value2 == 'null') {
// Okay, actually there are the max amount of users in the clan
// it is now not possible to change to a leader only clan!!
- return 'Es ist nicht m&oouml;glich den co_leader zu feuern, da der clan die maximale Anzahl Member besitzt!';
+ return 'Es ist nicht möglich den Co-Leader zu ändern, da der clan die maximale Anzahl Member besitzt!';
}
if($rootlvl == 1){ // the co leader may only set the co leader XD
$sql = 'UPDATE clan SET co_leader = '.$value2.' where id = '.$clanid;
+ echo $sql.' ';
mysql_query($sql);
} else if($rootlvl == 2) { // the leader may set the leader and the co leader
$sql = 'UPDATE clan SET leader = '.$value1.', co_leader = '.$value2.' where id = '.$clanid;
@@ -454,7 +460,7 @@ function displayEdit($what, $clanid, $rootlvl){
}
}
- if($root){
+ if($rootlvl == 2){
$content = '