@ -42,7 +42,7 @@ function isNickChanged($user){
}
function changeProfil($user, $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){
if(!is_numeric($chat)){
displayErrorMessage(NULL,'Chat-Feld inkorrekt ausgefuellt!','');
return;
@ -83,13 +83,22 @@ function changeProfil($user, $new_pw, $new_nick, $new_nick2, $alt_pw, $homepage,
}
setPassword($user['nickname'], $new_pw);
}
mysql_query('UPDATE user SET homepage=\''.$homepage.'\', icq=\''.$icq.'\', chat = '.$chat.', ads = '.$ads.' WHERE id=\''.$user['id'].'\'');
if($ads == 1) {
if(!isUserInGroup($usergroups, Werbung_an)) {
addUserToGroup($user['nickname'], Werbung_an);
}
} else {
if(isUserInGroup($usergroups, Werbung_an)) {
removeUserToGroup($user['nickname'], Werbung_an);
}
}
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']));
}
function display($user){
function display($user, $usergroups ){
if($user['post']){
$post_check = 'checked';
}
@ -150,7 +159,8 @@ function display($user){
< th align = "center" > Werbegrad:< / th >
< td >
<?php
if($user['ads'] == 0){
if(isUserInGroup($usergroups, Werbung_an)) {
//$user['ads'] == 0){
$che1 = 'checked="checked"';
$che2 = '';
} else{
@ -195,9 +205,9 @@ function display($user){
}
if($charm == '1'){
$user_ida = changeProfil($user_ida, $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);
}
display($user_ida);
display($user_ida, $usergroups );
?>