#!/usr/bin/perl # MimerDesk # Web based groupware and eLearning environment # www.mimerdesk.org # # Copyright (C) 2001 Ionstream Ltd. # www.ionstream.fi # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program is distributed with a hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # $Id: visionman.html,v 1.5 2002/06/06 14:58:02 inf Exp $ ########################################### # # # MimerDesk: I-vision manager # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # (c) Ionstream Oy 1999 - 2001 # # # # Programmed by: Teemu Arina # # # ########################################### # Asetukset ################################## use strict; use vars qw ($APPLICATION $ACTIVEGRP $USER $IP $LAST_ACT $FORWARDED $TIME_USED $IDLE $form $ref $sth $admin_status $trans); use lib::MimerDesk; $APPLICATION = 'Tools - TV broadcast'; # Ohjelma ################################## $config{'theme'} = 'default'; read_config('../config/mimerdesk.cfg'); initialize(); lock_tables('READ', 'configuration'); db_list("SELECT * FROM configuration"); while (my $ref = $sth->fetchrow_arrayref()) {$config{$ref->[0]} = $ref->[1] if !$config{$ref->[0]};} db_end(); unlock_tables(); $form = decode_multipart(); $form->{'ID'} =~ tr/0-9//cd; $form->{'auth'} =~ tr/0-9a-z//cd; ($USER, $IP, $LAST_ACT, $FORWARDED, $TIME_USED, $IDLE, $ACTIVEGRP) = authenticate($form->{'ID'}, $form->{'auth'}, $form->{'changeGroup'}); $trans = lib::MimerDesk->new_gettext(program => 'tvbroadcast',language => $config{'language'}); $APPLICATION = $trans->gettext('Tools - TV broadcast'); lock_tables('READ', "users"); db_list("SELECT flags FROM users where nimi = '$USER'"); while (my $ref = $sth->fetchrow_hashref()) {$admin_status = $ref->{'flags'};} db_end(); unlock_tables(); template_tulostus("$config{'theme'}_accfailure") if $admin_status !~ /T0/; tunnista_lomake(); # Aliohjelmat ################################## ################### # Tunnista lomake # ################### sub tunnista_lomake { if ($form->{'submit2'}) {submit();} elsif ($form->{'show_ivision'}) { $form->{'ID'} = $form->{'ID'}; redirect("$config{'loc_server'}$config{'bin_dir'}/vision.html?ID=$form->{'ID'}\&auth=$form->{'auth'}\&go=vision"); } else {template_tulostus('visionman');} } ############################### # Lue template ja tulosta se # ############################### sub template_tulostus { my ($template,$ref,$fulltemplate); $template = shift; print_header('pragma'); $ref = get_template('maintemplate',$template); $ref->{'maintemplate'} =~ s/<>/$ref->{$template}/m; $fulltemplate = $ref->{'maintemplate'}; $ref = get_template('js_doClock', 'js_help', 'js_gotosite'); my $stuff = join "", ($ref->{'js_doClock'},$ref->{'js_help'},$ref->{'js_gotosite'}); $fulltemplate =~ s/<>/$stuff/ms; $fulltemplate = create_buttons($fulltemplate, 'Tools', 'TV Broadcast', $form); $fulltemplate =~ s/<>/minea/gm; $fulltemplate =~ s/<>/MimerDesk: $APPLICATION/ms; $fulltemplate = replace_tags($fulltemplate, $USER, $form->{'auth'}, $form->{'ID'}, $TIME_USED); $fulltemplate = add_popups($fulltemplate, $USER, $form->{'auth'}, $form->{'ID'}); print $fulltemplate; db_end('disconnect'); exit; } ################################## # Update i-vision configuration # ################################## sub submit { $form->{'refresh'} =~ s/refresh (.*)/$1/g; $form->{'request_count'} =~ s/request_count (.*)/$1/g; lock_tables('WRITE', 'configuration'); update_conf_value('vision_delay', $form->{'refresh'}); update_conf_value('article_count', $form->{'request_count'}); unlock_tables(); write_log("Configuration was updated by $USER. vision delay: $form->{'refresh'} article count: $form->{'request_count'}", "notify"); template_tulostus('visionman'); }