@ -21,6 +21,7 @@ $new_nick2 = validateName($_GET['new_nick2']);
$homepage = validateString($_GET['homepage']);
$chat = validateString($_GET['chat']);
$ads = validateString($_GET['ads']);
$acc_delete = validateString($_GET['acc_delete']);
$alt_pw = validateString($_GET['alt_pw']);
// Unkritisch
@ -42,7 +43,7 @@ function isNickChanged($user){
}
function changeProfil($user, $usergroups, $new_pw, $new_nick, $new_nick2, $alt_pw, $homepage, $icq, $chat, $ads){
function changeProfil($user, $usergroups, $new_pw, $new_nick, $new_nick2, $alt_pw, $homepage, $icq, $chat, $ads, $acc_delete ){
if(!is_numeric($chat)){
displayErrorMessage(NULL,'Chat-Feld inkorrekt ausgefuellt!','');
return;
@ -89,9 +90,23 @@ function changeProfil($user, $usergroups, $new_pw, $new_nick, $new_nick2, $alt_p
}
} else {
if(isUserInGroup($usergroups, Werbung_an)) {
removeUserTo Group($user['nickname'], Werbung_an);
removeUserFrom Group($user['nickname'], Werbung_an);
}
}
echo 'Accountdelete: '.$acc_delete;
if($acc_delete == 1) {
if(!isUserInGroup($usergroups, aktiv_loeschschutz)) {
addUserToGroup($user['nickname'], aktiv_loeschschutz);
removeUserFromGroup($user['nickname'], inaktiv_loeschschutz);
}
} else if($acc_delete == 0) {
if(isUserInGroup($usergroups, aktiv_loeschschutz)) {
removeUserFromGroup($user['nickname'], aktiv_loeschschutz);
addUserToGroup($user['nickname'], inaktiv_loeschschutz);
}
}
mysql_query('UPDATE user SET homepage=\''.$homepage.'\', icq=\''.$icq.'\', chat = '.$chat.' WHERE id=\''.$user['id'].'\'');
displayErrorMessage('Profil erfolgreich geä ndert','Sollte das Passwort geä ndert worden sein, ist ein erneuter Login erforderlich.','');
return mysql_fetch_assoc(mysql_query('Select * from user where id = '.$user['id']));
@ -107,8 +122,9 @@ function display($user, $usergroups){
}
?>
< form action = " <?php echo $_SERVER [ 'PHP_SELF' ]; ?> " method = "get" >
< input type = "hidden" name = "as" value = "profil" >
< input type = "hidden" name = "charm" value = "1" >
< input type = "hidden" name = "as" value = "profil" > < input type = "hidden"
name="charm" value="1"> < input type = "hidden" name = "acc_delete"
value="-1">
< table cellpadding = "0" cellspacing = "0" width = "100%" height = "51" >
< tr >
< th colspan = "2" align = "center" > Ihr Profil< / th >
@ -133,32 +149,29 @@ function display($user, $usergroups){
?>
< tr >
< th align = "center" > Altes Passwort< / th >
< td >
< input id = "input" name = "alt_pw" type = "password" size = "35" >
< td > < input id = "input" name = "alt_pw" type = "password" size = "35" >
< / td >
< / tr >
< tr >
< th align = "center" > Neues Passwort< / th >
< td >
< input id = "input" name = "new_pw" type = "password" size = "35" >
< td > < input id = "input" name = "new_pw" type = "password" size = "35" >
< / td >
< / tr >
< tr >
< th align = "center" > Homepage< / th >
< td >
< input id = "input" name = "homepage" size = "35" value = "<?php echo $user [ 'homepage' ]; ?> " >
< td > < input id = "input" name = "homepage" size = "35"
value="<?php echo $user [ 'homepage' ]; ?> ">
< / td >
< / tr >
< tr >
< th align = "center" > ICQ:< / th >
< td >
< input id = "input" name = "icq" size = "35" value = "<?php echo $user [ 'icq' ]; ?> " >
< td > < input id = "input" name = "icq" size = "35"
value="<?php echo $user [ 'icq' ]; ?> ">
< / td >
< / tr >
< tr >
< th align = "center" > Werbegrad:< / th >
< td >
<?php
< td > <?php
if(!isUserInGroup($usergroups, Werbung_an)) {
$che1 = 'checked="checked"';
$che2 = '';
@ -166,19 +179,17 @@ function display($user, $usergroups){
$che1 = '';
$che2 = 'checked="checked"';
}
?>
moderat: < input type = "radio" name = "ads" value = "0" <?php echo $che1 ; ?> />
<?php
//if(!(getLayerAdvertisement() == '' or getLayerAdvertisement == null)){
?> moderat: < input type = "radio" name = "ads" value = "0"
<?php echo $che1 ; ?> /> <?php
if(!(getLayerAdvertisement() == '' or getLayerAdvertisement == null)){
echo 'hardcore: < input type = "radio" name = "ads" value = "1" ' . $ che2 . ' / > ';
// }
}
?>
< / td >
< / tr >
< tr >
< th align = "center" > Chat:< / th >
< td >
<?php
< td > <?php
if($user['chat'] == 1){
$che1 = 'checked="checked"';
$che2 = '';
@ -186,15 +197,34 @@ function display($user, $usergroups){
$che1 = '';
$che2 = 'checked="checked"';
}
?>
an: < input type = "radio" name = "chat" value = "1" <?php echo $che1 ; ?> />
?> an: < input type = "radio" name = "chat" value = "1" <?php echo $che1 ; ?> />
aus: < input type = "radio" name = "chat" value = "0" <?php echo $che2 ; ?> />
< / td >
< / tr >
< tr >
< th align = "center" > Account Lö schschutz< / th >
< td > <?php
$disabled = '';
$che1 = '';
$che2 = '';
if(isUserInGroup($usergroups, inaktiv_loeschschutz)){
$che1 = '';
$che2 = 'checked="checked"';
} else if (isUserInGroup($usergroups, aktiv_loeschschutz)){
$che1 = 'checked="checked"';
$che2 = '';
} else {
$disabled = 'disabled';
}
?> an: < input type = "radio" name = "acc_delete" value = "1"
<?php echo $che1 . ' ' . $disabled ; ?> /> aus: < input type = "radio"
name="acc_delete" value="0" <?php echo $che2 . ' ' . $disabled ; ?> />
< / td >
< / tr >
< tr >
< td > < / td >
< td >
< input id = "input" size = "15" type = "submit" value = "ändern" >
< td > < input id = "input" size = "15" type = "submit" value = "ändern" >
< / td >
< / tr >
@ -204,7 +234,7 @@ function display($user, $usergroups){
}
if($charm == '1'){
$user_ida = changeProfil($user_ida, $usergroups, $new_pw, $new_nick, $new_nick2, $alt_pw, $homepage, $icq, $chat, $ads);
$user_ida = changeProfil($user_ida, $usergroups, $new_pw, $new_nick, $new_nick2, $alt_pw, $homepage, $icq, $chat, $ads, $acc_delete );
$usergroups = getUserGroups($user_ida['nickname']);
}
display($user_ida, $usergroups);