Chat abhängig von Usergroup gemacht

aktiv_chat Usergroup hinzugefügt
main
radiskull 13 years ago
parent 50754bcbba
commit 6149fa4832

@ -14,6 +14,7 @@ define("designer", 4);
define("Werbung_an", 5); define("Werbung_an", 5);
define("inaktiv_loeschschutz", 6); define("inaktiv_loeschschutz", 6);
define("aktiv_loeschschutz", 7); define("aktiv_loeschschutz", 7);
define("aktiv_chat", 8);
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/parse.inc.php'); include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/parse.inc.php');

@ -8,7 +8,7 @@
?> ?>
<br><br> <br><br>
<?php <?php
if ($user_ida['chat'] == 1 || $user_ida['chat'] === NULL) { if (isUserInGroup($usergroups, aktiv_chat)) {
include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/messagefunctions.inc.php'); include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/messagefunctions.inc.php');
if($user_ida['id'] === NULL){ if($user_ida['id'] === NULL){
$user_ida['id'] = -1; $user_ida['id'] = -1;

@ -84,6 +84,17 @@ function changeProfil($user, $usergroups, $new_pw, $new_nick, $new_nick2, $alt_p
} }
setPassword($user['nickname'], $new_pw); setPassword($user['nickname'], $new_pw);
} }
if($chat == 1) {
if(!isUserInGroup($usergroups, aktiv_chat)) {
addUserToGroup($user['nickname'], aktiv_chat);
}
} else {
if(isUserInGroup($usergroups, aktiv_chat)) {
removeUserFromGroup($user['nickname'], aktiv_chat);
}
}
if($ads == 1) { if($ads == 1) {
if(!isUserInGroup($usergroups, Werbung_an)) { if(!isUserInGroup($usergroups, Werbung_an)) {
addUserToGroup($user['nickname'], Werbung_an); addUserToGroup($user['nickname'], Werbung_an);
@ -93,6 +104,7 @@ function changeProfil($user, $usergroups, $new_pw, $new_nick, $new_nick2, $alt_p
removeUserFromGroup($user['nickname'], Werbung_an); removeUserFromGroup($user['nickname'], Werbung_an);
} }
} }
if($acc_delete == 1) { if($acc_delete == 1) {
if(!isUserInGroup($usergroups, aktiv_loeschschutz)) { if(!isUserInGroup($usergroups, aktiv_loeschschutz)) {
addUserToGroup($user['nickname'], aktiv_loeschschutz); addUserToGroup($user['nickname'], aktiv_loeschschutz);
@ -106,7 +118,7 @@ function changeProfil($user, $usergroups, $new_pw, $new_nick, $new_nick2, $alt_p
} }
mysql_query('UPDATE user SET homepage=\''.$homepage.'\', icq=\''.$icq.'\', chat = '.$chat.' WHERE id=\''.$user['id'].'\''); mysql_query('UPDATE user SET homepage=\''.$homepage.'\', icq=\''.$icq.'\' WHERE id=\''.$user['id'].'\'');
displayErrorMessage('Profil erfolgreich ge&auml;ndert','Sollte das Passwort ge&auml;ndert worden sein, ist ein erneuter Login erforderlich.',''); displayErrorMessage('Profil erfolgreich ge&auml;ndert','Sollte das Passwort ge&auml;ndert worden sein, ist ein erneuter Login erforderlich.','');
return mysql_fetch_assoc(mysql_query('Select * from user where id = '.$user['id'])); return mysql_fetch_assoc(mysql_query('Select * from user where id = '.$user['id']));
@ -178,8 +190,7 @@ function display($user, $usergroups){
$che1 = ''; $che1 = '';
$che2 = 'checked="checked"'; $che2 = 'checked="checked"';
} }
?> moderat: <input type="radio" name="ads" value="0" ?> moderat: <input type="radio" name="ads" value="0" <?php echo $che1; ?> /> <?php
<?php echo $che1; ?> /> <?php
if(!(getLayerAdvertisement() == '' or getLayerAdvertisement == null)){ if(!(getLayerAdvertisement() == '' or getLayerAdvertisement == null)){
echo 'hardcore: <input type="radio" name="ads" value="1"'.$che2.'/>'; echo 'hardcore: <input type="radio" name="ads" value="1"'.$che2.'/>';
} }
@ -189,7 +200,7 @@ function display($user, $usergroups){
<tr> <tr>
<th align="center">Chat:</th> <th align="center">Chat:</th>
<td><?php <td><?php
if($user['chat'] == 1){ if(isUserInGroup($usergroups, aktiv_chat)) {
$che1 = 'checked="checked"'; $che1 = 'checked="checked"';
$che2 = ''; $che2 = '';
} else{ } else{

Loading…
Cancel
Save