Exemple #1
0
// chek to see if the chatromm is started, in that case we disable some fields
$chatroom_started = $chatroomObj->is_chatroom_startedFN($id_room);
$id_owner = $chatroomObj->id_chat_owner;
if ($chatroom_started) {
    $readonly = 'readonly';
} else {
    $readonly = 0;
}
// check user type
// owner can edit the chatroom
if ($id_owner == $sess_id_user) {
    $msg = translateFN("Utente abilitato per questa operazione.");
} elseif ($id_profile == AMA_TYPE_SWITCHER) {
    $msg = translateFN("Utente abilitato per questa operazione.");
} elseif ($chatroom_started) {
    $is_moderator = $chatroomObj->is_user_moderatorFN($sess_id_user, $id_room);
    if ($is_moderator) {
        $msg = translateFN("Utente abilitato per questa operazione.");
    }
} else {
    $msg = translateFN("Utente non abilitato per questa operazione. Impossibile proseguire");
    $location = $navigationHistoryObj->lastModule();
    header("Location: {$location}?err_msg={$msg}&msg={$msg}");
}
// display message that explains the functionality of the current script
$help = translateFN("Da qui l'utente puo' modificare i dati di chatroom esistente inserendo i valori negli appositi campi.\n <br><br>Attenzione!<br>Per il corretto funzionamento della chat e' importante inserire i valori corretti.");
// title of the script
$status = translateFN("Modifica di una chatroom");
// indicates which fields are compulsory
$star = translateFN("I campi contrassegnati con * sono obbligatori, non possono essere lasciati vuoti!");
// including the banner