2012-09-13 06:45:57 +02:00
< ? php
2012-10-05 07:50:20 +02:00
/*
FusionPBX
Version : MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 ( the " License " ); you may not use this file except in compliance with
the License . You may obtain a copy of the License at
http :// www . mozilla . org / MPL /
Software distributed under the License is distributed on an " AS IS " basis ,
WITHOUT WARRANTY OF ANY KIND , either express or implied . See the License
for the specific language governing rights and limitations under the
License .
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane < markjcrane @ fusionpbx . com >
2021-12-02 06:39:29 +01:00
Portions created by the Initial Developer are Copyright ( C ) 2008 - 2021
2012-10-05 07:50:20 +02:00
the Initial Developer . All Rights Reserved .
Contributor ( s ) :
Mark J Crane < markjcrane @ fusionpbx . com >
2015-02-13 22:17:02 +01:00
Luis Daniel Lucio Quiroz < dlucio @ okay . com . mx >
2012-10-05 07:50:20 +02:00
*/
2017-10-21 19:13:31 +02:00
2022-10-11 00:35:14 +02:00
//set the include path
$conf = glob ( " { /usr/local/etc,/etc}/fusionpbx/config.conf " , GLOB_BRACE );
set_include_path ( parse_ini_file ( $conf [ 0 ])[ 'document.root' ]);
//includes files
2017-10-21 19:13:31 +02:00
require_once " resources/require.php " ;
require_once " resources/check_auth.php " ;
//check permissions
if ( permission_exists ( 'conference_room_add' ) || permission_exists ( 'conference_room_edit' )) {
//access granted
}
else {
echo " access denied " ;
exit ;
}
2012-09-13 06:45:57 +02:00
2012-11-07 11:58:42 +01:00
//add multi-lingual support
2015-01-18 11:06:08 +01:00
$language = new text ;
$text = $language -> get ();
2012-11-07 11:58:42 +01:00
2012-09-13 06:45:57 +02:00
//action add or update
2019-07-04 23:57:04 +02:00
if ( is_uuid ( $_REQUEST [ " id " ])) {
2012-09-13 06:45:57 +02:00
$action = " update " ;
2019-07-04 23:57:04 +02:00
$conference_room_uuid = $_REQUEST [ " id " ];
2012-09-13 06:45:57 +02:00
}
else {
$action = " add " ;
}
//get http post variables and set them to php variables
2012-10-20 01:36:27 +02:00
if ( count ( $_POST ) > 0 ) {
2019-07-04 23:57:04 +02:00
$conference_center_uuid = $_POST [ " conference_center_uuid " ];
$conference_room_name = $_POST [ 'conference_room_name' ];
$moderator_pin = $_POST [ " moderator_pin " ];
$participant_pin = $_POST [ " participant_pin " ];
2021-12-02 06:39:29 +01:00
2019-07-04 23:57:04 +02:00
$profile = $_POST [ " profile " ];
$record = $_POST [ " record " ];
$user_uuid = $_POST [ " user_uuid " ];
$max_members = $_POST [ " max_members " ];
$start_datetime = $_POST [ " start_datetime " ];
$stop_datetime = $_POST [ " stop_datetime " ];
$wait_mod = $_POST [ " wait_mod " ];
2020-05-05 06:15:16 +02:00
$moderator_endconf = $_POST [ " moderator_endconf " ];
2020-03-31 23:51:00 +02:00
$announce_name = $_POST [ " announce_name " ];
$announce_recording = $_POST [ " announce_recording " ];
$announce_count = $_POST [ " announce_count " ];
2019-07-04 23:57:04 +02:00
$sounds = $_POST [ " sounds " ];
$mute = $_POST [ " mute " ];
$created = $_POST [ " created " ];
$created_by = $_POST [ " created_by " ];
2021-12-02 06:39:29 +01:00
$email_address = $_POST [ " email_address " ];
2021-12-05 07:20:45 +01:00
$account_code = $_POST [ " account_code " ];
2023-02-14 19:19:02 +01:00
$enabled = $_POST [ " enabled " ] ? : 'false' ;
2019-07-04 23:57:04 +02:00
$description = $_POST [ " description " ];
2012-09-13 06:45:57 +02:00
//remove any pin number formatting
2013-01-05 14:03:00 +01:00
$moderator_pin = preg_replace ( '{\D}' , '' , $moderator_pin );
$participant_pin = preg_replace ( '{\D}' , '' , $participant_pin );
2012-09-13 06:45:57 +02:00
}
2014-07-04 00:52:17 +02:00
//get the conference centers array and set a default conference center
$sql = " select * from v_conference_centers " ;
2019-07-04 23:57:04 +02:00
$sql .= " where domain_uuid = :domain_uuid " ;
2014-07-04 00:52:17 +02:00
$sql .= " order by conference_center_name asc " ;
2019-07-04 23:57:04 +02:00
$parameters [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$database = new database ;
$conference_centers = $database -> select ( $sql , $parameters , 'all' );
unset ( $sql , $parameters );
2013-05-08 12:35:23 +02:00
2017-10-21 19:13:31 +02:00
//get the conference profiles
$sql = " select * " ;
$sql .= " from v_conference_profiles " ;
$sql .= " where profile_enabled = 'true' " ;
2017-10-21 19:14:18 +02:00
$sql .= " and profile_name <> 'sla' " ;
2019-07-04 23:57:04 +02:00
$database = new database ;
$conference_profiles = $database -> select ( $sql , null , 'all' );
unset ( $sql );
2017-10-21 19:13:31 +02:00
//set the default
if ( $profile === " " ) { $profile = " default " ; }
2021-05-27 10:30:49 +02:00
//define fucntion get_conference_pin - used to find a unique pin number
function get_conference_pin ( $length , $conference_room_uuid ) {
2013-04-16 10:30:06 +02:00
$pin = generate_password ( $length , 1 );
2021-05-27 10:30:49 +02:00
$sql = " select count(*) from v_conference_rooms " ;
2019-07-04 23:57:04 +02:00
$sql .= " where domain_uuid = :domain_uuid " ;
2021-05-27 10:30:49 +02:00
$sql .= " and conference_room_uuid <> :conference_room_uuid " ;
2019-07-04 23:57:04 +02:00
$sql .= " and (moderator_pin = :pin or participant_pin = :pin) " ;
$parameters [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
2021-05-27 10:30:49 +02:00
$parameters [ 'conference_room_uuid' ] = $conference_room_uuid ;
2019-07-04 23:57:04 +02:00
$parameters [ 'pin' ] = $pin ;
$database = new database ;
$num_rows = $database -> select ( $sql , $parameters , 'column' );
if ( $num_rows == 0 ) {
return $pin ;
}
else {
2021-05-27 10:30:49 +02:00
get_conference_pin ( $length , $conference_room_uuid );
2013-01-08 21:58:49 +01:00
}
2019-07-04 23:57:04 +02:00
unset ( $sql , $parameters );
2013-01-08 21:58:49 +01:00
}
2013-02-27 12:06:44 +01:00
//record announcment
if ( $record == " true " ) {
//prepare the values
$default_language = 'en' ;
$default_dialect = 'us' ;
$default_voice = 'callie' ;
2021-05-27 10:30:49 +02:00
$switch_cmd = " conference " . $conference_room_uuid . " @ " . $_SESSION [ 'domain_name' ] . " play " . $_SESSION [ 'switch' ][ 'sounds' ][ 'dir' ] . " / " . $default_language . " / " . $default_dialect . " / " . $default_voice . " /ivr/ivr-recording_started.wav " ;
2013-02-27 12:06:44 +01:00
//connect to event socket
$fp = event_socket_create ( $_SESSION [ 'event_socket_ip_address' ], $_SESSION [ 'event_socket_port' ], $_SESSION [ 'event_socket_password' ]);
if ( $fp ) {
$switch_result = event_socket_request ( $fp , 'api ' . $switch_cmd );
}
}
2013-01-08 21:58:49 +01:00
//generate the pins
2019-07-04 23:57:04 +02:00
if ( is_uuid ( $conference_center_uuid )) {
2021-05-27 10:30:49 +02:00
$sql = " select conference_center_pin_length " ;
$sql .= " from v_conference_centers " ;
$sql .= " where domain_uuid = :domain_uuid " ;
2019-07-04 23:57:04 +02:00
$sql .= " and conference_center_uuid = :conference_center_uuid " ;
$parameters [ 'conference_center_uuid' ] = $conference_center_uuid ;
2021-05-27 10:30:49 +02:00
$parameters [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$database = new database ;
$row = $database -> select ( $sql , $parameters , 'row' );
if ( is_array ( $row ) && sizeof ( $row ) != 0 ) {
$pin_length = $row [ 'conference_center_pin_length' ];
}
unset ( $sql , $parameters );
2023-05-05 18:46:37 +02:00
if ( empty ( $moderator_pin )) {
2021-05-27 10:30:49 +02:00
$moderator_pin = get_conference_pin ( $pin_length , $conference_room_uuid );
}
2023-05-05 18:46:37 +02:00
if ( empty ( $participant_pin )) {
2021-05-27 10:30:49 +02:00
$participant_pin = get_conference_pin ( $pin_length , $conference_room_uuid );
}
2013-01-08 21:58:49 +01:00
}
2012-10-05 07:50:20 +02:00
//delete the user
2016-01-19 06:06:45 +01:00
if ( $_GET [ " a " ] == " delete " && permission_exists ( 'conference_room_delete' )) {
2021-05-27 10:30:49 +02:00
if ( is_uuid ( $_REQUEST [ " conference_room_user_uuid " ])) {
2012-09-13 06:45:57 +02:00
//set the variables
2021-05-27 10:30:49 +02:00
$conference_room_user_uuid = $_REQUEST [ " conference_room_user_uuid " ];
2019-07-04 23:57:04 +02:00
$conference_room_uuid = $_REQUEST [ " conference_room_uuid " ];
2021-05-27 10:30:49 +02:00
2012-09-13 06:45:57 +02:00
//delete the extension from the ring_group
2021-05-27 10:30:49 +02:00
$array [ 'conference_room_users' ][ 0 ][ 'conference_room_user_uuid' ] = $conference_room_user_uuid ;
$array [ 'conference_room_users' ][ 0 ][ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
//un-assigne the users from the conference room
$p = new permissions ;
$p -> add ( 'conference_room_user_delete' , 'temp' );
2019-07-04 23:57:04 +02:00
$database = new database ;
$database -> app_name = 'conference_centers' ;
$database -> app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e' ;
$database -> delete ( $array );
unset ( $array );
2021-05-27 10:30:49 +02:00
$p -> delete ( 'conference_room_user_delete' , 'temp' );
2012-09-13 06:45:57 +02:00
}
2014-02-21 04:56:30 +01:00
2018-08-31 05:09:01 +02:00
message :: add ( $text [ 'message-delete' ]);
2018-06-30 19:36:05 +02:00
header ( " Location: conference_room_edit.php?id= " . escape ( $conference_room_uuid ));
2014-02-21 04:56:30 +01:00
return ;
2012-09-13 06:45:57 +02:00
}
2013-01-08 21:58:49 +01:00
2023-05-05 18:46:37 +02:00
if ( count ( $_POST ) > 0 && empty ( $_POST [ " persistformvar " ])) {
2012-09-13 06:45:57 +02:00
$msg = '' ;
if ( $action == " update " ) {
2019-07-04 23:57:04 +02:00
$conference_room_uuid = $_POST [ " conference_room_uuid " ];
2012-09-13 06:45:57 +02:00
}
2019-09-18 06:12:28 +02:00
//validate the token
$token = new token ;
if ( ! $token -> validate ( $_SERVER [ 'PHP_SELF' ])) {
message :: add ( $text [ 'message-invalid_token' ], 'negative' );
header ( 'Location: conference_rooms.php' );
exit ;
}
2012-10-20 07:05:10 +02:00
//check for a unique pin number and length
2023-05-05 18:46:37 +02:00
if ( strlen ( $moderator_pin ) > 0 || ! empty ( $participant_pin )) {
2013-04-16 10:30:06 +02:00
//make sure the moderator pin number is unique
2021-05-27 10:30:49 +02:00
$sql = " select count(*) from v_conference_rooms " ;
2019-07-04 23:57:04 +02:00
$sql .= " where domain_uuid = :domain_uuid " ;
2021-05-27 10:30:49 +02:00
$sql .= " and conference_room_uuid <> :conference_room_uuid " ;
2019-07-04 23:57:04 +02:00
$sql .= " and ( " ;
2021-05-27 10:30:49 +02:00
$sql .= " moderator_pin = :moderator_pin " ;
$sql .= " or participant_pin = :moderator_pin " ;
2019-07-04 23:57:04 +02:00
$sql .= " ) " ;
$parameters [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$parameters [ 'moderator_pin' ] = $moderator_pin ;
2021-05-27 10:30:49 +02:00
$parameters [ 'conference_room_uuid' ] = $conference_room_uuid ;
2019-07-04 23:57:04 +02:00
$database = new database ;
$num_rows = $database -> select ( $sql , $parameters , 'column' );
if ( $num_rows > 0 ) {
$msg .= $text [ 'message-unique_moderator_pin' ] . " <br /> \n " ;
2013-04-16 10:30:06 +02:00
}
2019-07-04 23:57:04 +02:00
unset ( $sql , $parameters );
2013-04-25 00:25:44 +02:00
2013-04-16 10:30:06 +02:00
//make sure the participant pin number is unique
2021-05-27 10:30:49 +02:00
$sql = " select count(*) from v_conference_rooms " ;
2019-07-04 23:57:04 +02:00
$sql .= " where domain_uuid = :domain_uuid " ;
2021-05-27 10:30:49 +02:00
$sql .= " and conference_room_uuid <> :conference_room_uuid " ;
2019-07-04 23:57:04 +02:00
$sql .= " and ( " ;
2021-05-27 10:30:49 +02:00
$sql .= " moderator_pin = :participant_pin " ;
$sql .= " or participant_pin = :participant_pin " ;
2019-07-04 23:57:04 +02:00
$sql .= " ) " ;
$parameters [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$parameters [ 'participant_pin' ] = $participant_pin ;
2021-05-27 10:30:49 +02:00
$parameters [ 'conference_room_uuid' ] = $conference_room_uuid ;
2019-07-04 23:57:04 +02:00
$num_rows = $database -> select ( $sql , $parameters , 'column' );
if ( $num_rows > 0 ) {
$msg .= $text [ 'message-unique_participant_pin' ] . " <br /> \n " ;
2013-04-16 10:30:06 +02:00
}
2019-07-04 23:57:04 +02:00
unset ( $sql , $parameters );
2013-04-25 00:25:44 +02:00
2013-04-16 10:30:06 +02:00
//additional checks
if ( $moderator_pin == $participant_pin ) {
2015-02-25 19:15:16 +01:00
$msg .= $text [ 'message-non_unique_pin' ] . " <br /> \n " ;
2013-04-16 10:30:06 +02:00
}
2015-02-25 19:15:16 +01:00
if ( strlen ( $moderator_pin ) < $pin_length || strlen ( $participant_pin ) < $pin_length ) {
$msg .= $text [ 'message-minimum_pin_length' ] . " " . $pin_length . " <br /> \n " ;
2012-10-20 01:36:27 +02:00
}
}
2012-09-13 06:45:57 +02:00
//check for all required data
2023-05-05 18:46:37 +02:00
//if (empty($conference_center_uuid)) { $msg .= "Please provide: Conference UUID<br>\n"; }
//if (empty($max_members)) { $msg .= "Please provide: Max Members<br>\n"; }
//if (empty($start_datetime)) { $msg .= "Please provide: Start Date/Time<br>\n"; }
//if (empty($stop_datetime)) { $msg .= "Please provide: Stop Date/Time<br>\n"; }
//if (empty($wait_mod)) { $msg .= "Please provide: Wait for the Moderator<br>\n"; }
//if (empty($profile)) { $msg .= "Please provide: Conference Profile<br>\n"; }
//if (empty($announce)) { $msg .= "Please provide: Announce<br>\n"; }
//if (empty($enter_sound)) { $msg .= "Please provide: Enter Sound<br>\n"; }
//if (empty($mute)) { $msg .= "Please provide: Mute<br>\n"; }
//if (empty($sounds)) { $msg .= "Please provide: Sounds<br>\n"; }
//if (empty($created)) { $msg .= "Please provide: Created<br>\n"; }
//if (empty($created_by)) { $msg .= "Please provide: Created By<br>\n"; }
//if (empty($enabled)) { $msg .= "Please provide: Enabled<br>\n"; }
//if (empty($description)) { $msg .= "Please provide: Description<br>\n"; }
if ( ! empty ( $msg ) && empty ( $_POST [ " persistformvar " ])) {
2020-01-06 19:14:01 +01:00
$document [ 'title' ] = $text [ 'title-conference_room' ];
2013-07-06 08:29:50 +02:00
require_once " resources/header.php " ;
2013-07-06 08:21:12 +02:00
require_once " resources/persist_form_var.php " ;
2012-09-13 06:45:57 +02:00
echo " <div align='center'> \n " ;
echo " <table><tr><td> \n " ;
echo $msg . " <br /> " ;
echo " </td></tr></table> \n " ;
persistformvar ( $_POST );
echo " </div> \n " ;
2013-07-06 08:29:50 +02:00
require_once " resources/footer.php " ;
2012-10-20 01:36:27 +02:00
exit ;
2012-09-13 06:45:57 +02:00
}
//add or update the database
if ( $_POST [ " persistformvar " ] != " true " ) {
2012-10-05 01:04:39 +02:00
if ( $action == " add " && permission_exists ( 'conference_room_add' )) {
2013-01-08 21:58:49 +01:00
//set default values
2023-05-05 18:46:37 +02:00
if ( empty ( $profile )) { $profile = 'default' ; }
if ( empty ( $record )) { $record = 'false' ; }
if ( empty ( $max_members )) { $max_members = 0 ; }
if ( empty ( $wait_mod )) { $wait_mod = 'true' ; }
if ( empty ( $moderator_endconf )) { $moderator_endconf = 'false' ; }
if ( empty ( $announce_name )) { $announce_name = 'true' ; }
if ( empty ( $announce_recording )) { $announce_recording = 'true' ; }
if ( empty ( $announce_count )) { $announce_count = 'true' ; }
if ( empty ( $mute )) { $mute = 'false' ; }
if ( empty ( $enabled )) { $enabled = 'true' ; }
if ( empty ( $sounds )) { $sounds = 'false' ; }
2013-01-08 21:58:49 +01:00
2012-10-05 07:50:20 +02:00
//add a conference room
2012-10-05 01:04:39 +02:00
$conference_room_uuid = uuid ();
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'conference_room_uuid' ] = $conference_room_uuid ;
$array [ 'conference_rooms' ][ 0 ][ 'conference_center_uuid' ] = $conference_center_uuid ;
$array [ 'conference_rooms' ][ 0 ][ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$array [ 'conference_rooms' ][ 0 ][ 'conference_room_name' ] = $conference_room_name ;
$array [ 'conference_rooms' ][ 0 ][ 'profile' ] = $profile ;
$array [ 'conference_rooms' ][ 0 ][ 'record' ] = $record ;
2021-05-27 10:30:49 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'moderator_pin' ] = $moderator_pin ;
$array [ 'conference_rooms' ][ 0 ][ 'participant_pin' ] = $participant_pin ;
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'max_members' ] = $max_members ;
$array [ 'conference_rooms' ][ 0 ][ 'start_datetime' ] = $start_datetime ;
$array [ 'conference_rooms' ][ 0 ][ 'stop_datetime' ] = $stop_datetime ;
$array [ 'conference_rooms' ][ 0 ][ 'wait_mod' ] = $wait_mod ;
2020-05-05 06:15:16 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'moderator_endconf' ] = $moderator_endconf ;
2020-03-31 23:51:00 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'announce_name' ] = $announce_name ;
$array [ 'conference_rooms' ][ 0 ][ 'announce_recording' ] = $announce_recording ;
$array [ 'conference_rooms' ][ 0 ][ 'announce_count' ] = $announce_count ;
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'sounds' ] = $sounds ;
$array [ 'conference_rooms' ][ 0 ][ 'mute' ] = $mute ;
$array [ 'conference_rooms' ][ 0 ][ 'created' ] = 'now()' ;
$array [ 'conference_rooms' ][ 0 ][ 'created_by' ] = $_SESSION [ 'user_uuid' ];
2021-12-02 06:39:29 +01:00
if ( permission_exists ( 'conference_room_email_address' )) {
$array [ 'conference_rooms' ][ 0 ][ 'email_address' ] = $email_address ;
}
2021-12-05 07:20:45 +01:00
if ( permission_exists ( 'conference_room_account_code' )) {
$array [ 'conference_rooms' ][ 0 ][ 'account_code' ] = $account_code ;
2021-12-02 06:39:29 +01:00
}
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'enabled' ] = $enabled ;
$array [ 'conference_rooms' ][ 0 ][ 'description' ] = $description ;
$database = new database ;
$database -> app_name = 'conference_centers' ;
$database -> app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e' ;
$database -> save ( $array );
unset ( $array );
2012-10-27 17:49:06 +02:00
2021-05-27 10:30:49 +02:00
//assign the logged in user to the conference room
2019-07-04 23:57:04 +02:00
if ( is_uuid ( $_SESSION [ " user_uuid " ])) {
2021-05-27 10:30:49 +02:00
$conference_room_user_uuid = uuid ();
$array [ 'conference_room_users' ][ 0 ][ 'conference_room_user_uuid' ] = $conference_room_user_uuid ;
$array [ 'conference_room_users' ][ 0 ][ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$array [ 'conference_room_users' ][ 0 ][ 'conference_room_uuid' ] = $conference_room_uuid ;
$array [ 'conference_room_users' ][ 0 ][ 'user_uuid' ] = $_SESSION [ " user_uuid " ];
2019-07-04 23:57:04 +02:00
$p = new permissions ;
2021-05-27 10:30:49 +02:00
$p -> add ( 'conference_room_user_add' , 'temp' );
2019-07-04 23:57:04 +02:00
$database = new database ;
$database -> app_name = 'conference_centers' ;
$database -> app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e' ;
$database -> save ( $array );
unset ( $array );
2021-05-27 10:30:49 +02:00
$p -> delete ( 'conference_room_user_add' , 'temp' );
2012-10-27 17:49:06 +02:00
}
2014-02-21 04:56:30 +01:00
2021-05-27 10:30:49 +02:00
//add the message
message :: add ( $text [ 'message-add' ]);
2019-07-04 23:57:04 +02:00
}
2012-09-13 06:45:57 +02:00
2012-10-05 01:04:39 +02:00
if ( $action == " update " && permission_exists ( 'conference_room_edit' )) {
2012-09-13 06:45:57 +02:00
2012-10-05 07:50:20 +02:00
//update the conference room
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'conference_room_uuid' ] = $conference_room_uuid ;
$array [ 'conference_rooms' ][ 0 ][ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$array [ 'conference_rooms' ][ 0 ][ 'conference_center_uuid' ] = $conference_center_uuid ;
$array [ 'conference_rooms' ][ 0 ][ 'conference_room_name' ] = $conference_room_name ;
2023-05-05 18:46:37 +02:00
if ( ! empty ( $profile )) {
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'profile' ] = $profile ;
2013-01-08 21:58:49 +01:00
}
2023-05-05 18:46:37 +02:00
if ( ! empty ( $record )) {
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'record' ] = $record ;
2013-01-08 21:58:49 +01:00
}
2021-05-27 10:30:49 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'moderator_pin' ] = $moderator_pin ;
$array [ 'conference_rooms' ][ 0 ][ 'participant_pin' ] = $participant_pin ;
2023-05-05 18:46:37 +02:00
if ( ! empty ( $max_members )) {
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'max_members' ] = $max_members ;
2013-01-08 21:58:49 +01:00
}
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'start_datetime' ] = $start_datetime ;
$array [ 'conference_rooms' ][ 0 ][ 'stop_datetime' ] = $stop_datetime ;
2023-05-05 18:46:37 +02:00
if ( ! empty ( $wait_mod )) {
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'wait_mod' ] = $wait_mod ;
2013-01-08 21:58:49 +01:00
}
2023-05-05 18:46:37 +02:00
if ( ! empty ( $moderator_endconf )) {
2020-05-05 06:15:16 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'moderator_endconf' ] = $moderator_endconf ;
}
2023-05-05 18:46:37 +02:00
if ( ! empty ( $announce_name )) {
2020-03-31 23:51:00 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'announce_name' ] = $announce_name ;
}
2023-05-05 18:46:37 +02:00
if ( ! empty ( $announce_name )) {
2020-03-31 23:51:00 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'announce_recording' ] = $announce_recording ;
}
2023-05-05 18:46:37 +02:00
if ( ! empty ( $announce_name )) {
2020-03-31 23:51:00 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'announce_count' ] = $announce_count ;
2013-01-08 21:58:49 +01:00
}
2023-05-05 18:46:37 +02:00
if ( ! empty ( $mute )) {
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'mute' ] = $mute ;
2013-01-08 21:58:49 +01:00
}
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'sounds' ] = $sounds ;
2021-12-02 06:39:29 +01:00
if ( permission_exists ( 'conference_room_email_address' )) {
$array [ 'conference_rooms' ][ 0 ][ 'email_address' ] = $email_address ;
}
2021-12-05 07:20:45 +01:00
if ( permission_exists ( 'conference_room_account_code' )) {
$array [ 'conference_rooms' ][ 0 ][ 'account_code' ] = $account_code ;
2021-12-02 06:39:29 +01:00
}
2023-05-05 18:46:37 +02:00
if ( ! empty ( $enabled )) {
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'enabled' ] = $enabled ;
2013-01-08 21:58:49 +01:00
}
2019-07-04 23:57:04 +02:00
$array [ 'conference_rooms' ][ 0 ][ 'description' ] = $description ;
$database = new database ;
$database -> app_name = 'conference_centers' ;
$database -> app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e' ;
$database -> save ( $array );
unset ( $array );
2014-02-21 04:56:30 +01:00
2019-07-04 23:57:04 +02:00
//set message
message :: add ( $text [ 'message-update' ]);
}
2012-09-13 06:45:57 +02:00
2021-05-27 10:30:49 +02:00
//assign the user to the conference room
if ( is_uuid ( $user_uuid )) {
$conference_room_user_uuid = uuid ();
$array [ 'conference_room_users' ][ 0 ][ 'conference_room_user_uuid' ] = $conference_room_user_uuid ;
$array [ 'conference_room_users' ][ 0 ][ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$array [ 'conference_room_users' ][ 0 ][ 'conference_room_uuid' ] = $conference_room_uuid ;
$array [ 'conference_room_users' ][ 0 ][ 'user_uuid' ] = $user_uuid ;
2019-07-04 23:57:04 +02:00
2021-05-27 10:30:49 +02:00
$p = new permissions ;
$p -> add ( 'conference_room_user_add' , 'temp' );
2019-07-04 23:57:04 +02:00
2021-05-27 10:30:49 +02:00
$database = new database ;
$database -> app_name = 'conference_centers' ;
$database -> app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e' ;
$database -> save ( $array );
unset ( $array );
2019-07-04 23:57:04 +02:00
2021-05-27 10:30:49 +02:00
$p -> delete ( 'conference_room_user_add' , 'temp' );
2014-02-21 04:56:30 +01:00
2021-05-27 10:30:49 +02:00
message :: add ( $text [ 'message-add' ]);
}
2013-01-05 14:03:00 +01:00
2019-07-04 23:57:04 +02:00
//redirect
2021-05-27 10:30:49 +02:00
header ( " Location: conference_room_edit.php?id= " . escape ( $conference_room_uuid ));
exit ;
2012-09-13 06:45:57 +02:00
2019-07-04 23:57:04 +02:00
}
}
2012-09-13 06:45:57 +02:00
//pre-populate the form
2012-10-20 01:36:27 +02:00
if ( count ( $_GET ) > 0 && $_POST [ " persistformvar " ] != " true " ) {
2013-04-16 09:03:17 +02:00
//get the conference room details
2019-07-04 23:57:04 +02:00
$conference_room_uuid = $_REQUEST [ " id " ];
2021-05-27 10:30:49 +02:00
$sql = " select * from v_conference_rooms " ;
$sql .= " where domain_uuid = :domain_uuid " ;
$sql .= " and conference_room_uuid = :conference_room_uuid " ;
2019-07-04 23:57:04 +02:00
$parameters [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$parameters [ 'conference_room_uuid' ] = $conference_room_uuid ;
$database = new database ;
$row = $database -> select ( $sql , $parameters , 'row' );
if ( is_array ( $row ) && sizeof ( $row ) != 0 ) {
2013-04-16 09:03:17 +02:00
$conference_center_uuid = $row [ " conference_center_uuid " ];
2014-11-30 04:43:04 +01:00
$conference_room_name = $row [ " conference_room_name " ];
2013-04-16 09:03:17 +02:00
$profile = $row [ " profile " ];
$record = $row [ " record " ];
2021-05-27 10:30:49 +02:00
$moderator_pin = $row [ " moderator_pin " ];
$participant_pin = $row [ " participant_pin " ];
2013-04-16 09:03:17 +02:00
$max_members = $row [ " max_members " ];
2014-11-29 22:21:26 +01:00
$start_datetime = $row [ " start_datetime " ];
$stop_datetime = $row [ " stop_datetime " ];
2013-04-16 09:03:17 +02:00
$wait_mod = $row [ " wait_mod " ];
2020-05-05 06:15:16 +02:00
$moderator_endconf = $row [ " moderator_endconf " ];
2020-03-31 23:51:00 +02:00
$announce_name = $row [ " announce_name " ];
$announce_recording = $row [ " announce_recording " ];
$announce_count = $row [ " announce_count " ];
2013-04-16 09:03:17 +02:00
$sounds = $row [ " sounds " ];
$mute = $row [ " mute " ];
$created = $row [ " created " ];
$created_by = $row [ " created_by " ];
2021-12-02 06:39:29 +01:00
$email_address = $row [ " email_address " ];
2021-12-05 07:20:45 +01:00
$account_code = $row [ " account_code " ];
2013-04-16 09:03:17 +02:00
$enabled = $row [ " enabled " ];
$description = $row [ " description " ];
}
2019-07-04 23:57:04 +02:00
unset ( $sql , $parameters , $row );
2016-01-18 22:15:21 +01:00
}
2021-05-27 10:30:49 +02:00
//get the users assigned to this conference room
$sql = " select u.username, u.user_uuid, r.conference_room_user_uuid " ;
$sql .= " from v_users as u, v_conference_room_users as r " ;
$sql .= " where u.user_uuid = r.user_uuid " ;
$sql .= " and r.domain_uuid = :domain_uuid " ;
$sql .= " and r.conference_room_uuid = :conference_room_uuid " ;
2016-01-18 22:15:21 +01:00
$sql .= " order by u.username asc " ;
2019-07-04 23:57:04 +02:00
$parameters [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
2021-05-27 10:30:49 +02:00
$parameters [ 'conference_room_uuid' ] = $conference_room_uuid ;
2019-07-04 23:57:04 +02:00
$database = new database ;
2020-02-15 16:56:49 +01:00
$rows = $database -> select ( $sql , $parameters , 'all' );
if ( is_array ( $rows ) && @ sizeof ( $rows ) != 0 ) {
foreach ( $rows as $row ) {
2021-05-27 10:30:49 +02:00
$conference_room_users [ $row [ 'user_uuid' ]][ 'username' ] = $row [ 'username' ];
$conference_room_users [ $row [ 'user_uuid' ]][ 'conference_room_user_uuid' ] = $row [ 'conference_room_user_uuid' ];
2020-02-15 16:56:49 +01:00
}
}
unset ( $sql , $parameters );
//get the users array
$sql = " select user_uuid, username from v_users " ;
$sql .= " where domain_uuid = :domain_uuid " ;
2021-05-27 10:30:49 +02:00
if ( is_array ( $conference_room_users ) && @ sizeof ( $conference_room_users ) != 0 ) {
$sql .= " and user_uuid not in (' " . implode ( " ',' " , array_keys ( $conference_room_users )) . " ') " ;
2020-02-15 16:56:49 +01:00
}
$sql .= " order by username asc " ;
$parameters [ 'domain_uuid' ] = $_SESSION [ 'domain_uuid' ];
$database = new database ;
$users = $database -> select ( $sql , $parameters , 'all' );
2019-07-04 23:57:04 +02:00
unset ( $sql , $parameters );
2012-09-13 06:45:57 +02:00
2014-02-06 05:01:22 +01:00
//set default profile
2023-05-05 18:46:37 +02:00
if ( empty ( $profile )) { $profile = 'default' ; }
2014-02-06 05:01:22 +01:00
2013-04-16 09:03:17 +02:00
//get default pins
2023-05-05 18:46:37 +02:00
if ( empty ( $moderator_pin )) {
2021-05-27 10:30:49 +02:00
$moderator_pin = get_conference_pin ( $pin_length , $conference_room_uuid );
2013-04-16 09:03:17 +02:00
}
2023-05-05 18:46:37 +02:00
if ( empty ( $participant_pin )) {
2021-05-27 10:30:49 +02:00
$participant_pin = get_conference_pin ( $pin_length , $conference_room_uuid );
2013-01-05 14:03:00 +01:00
}
2013-01-08 21:58:49 +01:00
//format the pins
if ( strlen ( $moderator_pin ) == 9 ) {
$moderator_pin = substr ( $moderator_pin , 0 , 3 ) . " - " . substr ( $moderator_pin , 3 , 3 ) . " - " . substr ( $moderator_pin , - 3 ) . " \n " ;
}
if ( strlen ( $participant_pin ) == 9 ) {
$participant_pin = substr ( $participant_pin , 0 , 3 ) . " - " . substr ( $participant_pin , 3 , 3 ) . " - " . substr ( $participant_pin , - 3 ) . " \n " ;
}
2012-09-13 06:45:57 +02:00
//set default values
2023-05-05 18:46:37 +02:00
if ( empty ( $record )) { $record = 'false' ; }
if ( empty ( $max_members )) { $max_members = 0 ; }
if ( empty ( $wait_mod )) { $wait_mod = 'true' ; }
if ( empty ( $moderator_endconf )) { $moderator_endconf = 'false' ; }
if ( empty ( $announce_name )) { $announce_name = 'true' ; }
if ( empty ( $announce_recording )) { $announce_recording = 'true' ; }
if ( empty ( $announce_count )) { $announce_count = 'true' ; }
if ( empty ( $mute )) { $mute = 'false' ; }
if ( empty ( $sounds )) { $sounds = 'false' ; }
if ( empty ( $enabled )) { $enabled = 'true' ; }
2012-09-13 06:45:57 +02:00
2019-09-18 06:12:28 +02:00
//create token
$object = new token ;
$token = $object -> create ( $_SERVER [ 'PHP_SELF' ]);
2012-09-13 06:45:57 +02:00
//show the header
2020-01-06 19:14:01 +01:00
$document [ 'title' ] = $text [ 'title-conference_room' ];
2013-07-06 08:29:50 +02:00
require_once " resources/header.php " ;
2012-09-13 06:45:57 +02:00
//show the content
2020-03-05 18:02:25 +01:00
echo " <form method='post' name='frm' id='frm'> \n " ;
2014-11-29 22:21:26 +01:00
2020-01-15 00:06:14 +01:00
echo " <div class='action_bar' id='action_bar'> \n " ;
echo " <div class='heading'><b> " . $text [ 'title-conference_room' ] . " </b></div> \n " ;
echo " <div class='actions'> \n " ;
2020-03-05 08:05:45 +01:00
echo button :: create ([ 'type' => 'button' , 'label' => $text [ 'button-back' ], 'icon' => $_SESSION [ 'theme' ][ 'button_icon_back' ], 'id' => 'btn_back' , 'link' => 'conference_rooms.php' ]);
2021-05-27 10:30:49 +02:00
if ( is_uuid ( $conference_room_uuid )) {
2023-01-31 21:14:32 +01:00
if ( permission_exists ( 'conference_interactive_view' )) {
echo button :: create ([ 'type' => 'button' , 'label' => $text [ 'button-view' ], 'icon' => $_SESSION [ 'theme' ][ 'button_icon_view' ], 'style' => 'margin-left: 15px;' , 'link' => '../conferences_active/conference_interactive.php?c=' . urlencode ( $conference_room_uuid )]);
}
else if ( permission_exists ( 'conference_active_view' )) {
echo button :: create ([ 'type' => 'button' , 'label' => $text [ 'button-view' ], 'icon' => $_SESSION [ 'theme' ][ 'button_icon_view' ], 'style' => 'margin-left: 15px;' , 'link' => '../conferences_active/conferences_active.php' ]);
}
2021-11-17 18:23:29 +01:00
if ( permission_exists ( 'conference_session_view' )) {
echo button :: create ([ 'type' => 'button' , 'label' => $text [ 'button-sessions' ], 'icon' => 'list' , 'link' => 'conference_sessions.php?id=' . urlencode ( $conference_room_uuid )]);
}
2012-09-13 06:45:57 +02:00
}
2020-03-05 08:05:45 +01:00
echo button :: create ([ 'type' => 'submit' , 'label' => $text [ 'button-save' ], 'icon' => $_SESSION [ 'theme' ][ 'button_icon_save' ], 'id' => 'btn_save' , 'style' => 'margin-left: 15px;' ]);
2020-01-15 00:06:14 +01:00
echo " </div> \n " ;
echo " <div style='clear: both;'></div> \n " ;
echo " </div> \n " ;
echo " <table width='100%' border='0' cellpadding='0' cellspacing='0'> \n " ;
2012-09-13 06:45:57 +02:00
2013-05-22 02:58:29 +02:00
echo " <tr> \n " ;
2020-01-15 00:06:14 +01:00
echo " <td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-conference_name' ] . " </td> \n " ;
echo " <td width='70%' class='vtable' align='left'> \n " ;
2013-05-22 02:58:29 +02:00
echo " <select class='formfld' name='conference_center_uuid'> \n " ;
2021-05-27 10:30:49 +02:00
foreach ( $conference_centers as $row ) {
2013-05-22 02:58:29 +02:00
if ( $conference_center_uuid == $row [ " conference_center_uuid " ]) {
2018-06-30 19:36:05 +02:00
echo " <option value=' " . escape ( $row [ " conference_center_uuid " ]) . " ' selected='selected'> " . escape ( $row [ " conference_center_name " ]) . " </option> \n " ;
2013-05-22 02:58:29 +02:00
}
else {
2018-06-30 19:36:05 +02:00
echo " <option value=' " . escape ( $row [ " conference_center_uuid " ]) . " '> " . escape ( $row [ " conference_center_name " ]) . " </option> \n " ;
2012-09-13 06:45:57 +02:00
}
}
2013-05-22 02:58:29 +02:00
echo " </select> \n " ;
echo " <br /> \n " ;
echo " \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
2013-01-08 21:58:49 +01:00
echo " <tr> " ;
2014-11-30 04:43:04 +01:00
echo " <td class='vncell' valign='top'> " . $text [ 'label-room-name' ] . " </td> " ;
echo " <td class='vtable' align='left'> " ;
2018-06-30 19:36:05 +02:00
echo " <input class='formfld' type='text' name='conference_room_name' maxlength='255' value=' " . escape ( $conference_room_name ) . " '> \n " ;
2014-11-30 04:43:04 +01:00
echo " <br /> \n " ;
echo " " . $text [ 'description-room-name' ] . " \n " ;
echo " </td> " ;
echo " </tr> " ;
echo " <tr> " ;
echo " <td class='vncell' valign='top'> " . $text [ 'label-moderator-pin' ] . " </td> " ;
2013-01-08 21:58:49 +01:00
echo " <td class='vtable' align='left'> " ;
2021-05-27 10:30:49 +02:00
echo " <input class='formfld' type='text' name='moderator_pin' maxlength='255' value=' " . escape ( $moderator_pin ) . " '> \n " ;
2013-01-08 21:58:49 +01:00
echo " <br /> \n " ;
2015-08-03 23:17:05 +02:00
echo " " . $text [ 'description-moderator_pin' ] . " \n " ;
2013-01-08 21:58:49 +01:00
echo " </td> " ;
echo " </tr> " ;
echo " <tr> " ;
2014-11-30 04:43:04 +01:00
echo " <td class='vncell' valign='top'> " . $text [ 'label-participant-pin' ] . " </td> " ;
2013-01-08 21:58:49 +01:00
echo " <td class='vtable' align='left'> " ;
2021-05-27 10:30:49 +02:00
echo " <input class='formfld' type='text' name='participant_pin' maxlength='255' value=' " . escape ( $participant_pin ) . " '> \n " ;
2013-01-08 21:58:49 +01:00
echo " <br /> \n " ;
echo " " . $text [ 'description-participant-pin' ] . " \n " ;
echo " </td> " ;
echo " </tr> " ;
2012-09-13 06:45:57 +02:00
2015-02-13 22:17:02 +01:00
if ( if_group ( " superadmin " ) || if_group ( " admin " )) {
2016-01-18 22:15:21 +01:00
echo " <tr> " ;
echo " <td class='vncell' valign='top'> " . $text [ 'label-users' ] . " </td> " ;
echo " <td class='vtable' align='left'> " ;
2021-05-27 10:30:49 +02:00
if ( $action == " update " && is_array ( $conference_room_users ) && @ sizeof ( $conference_room_users ) != 0 ) {
2016-01-18 22:15:21 +01:00
echo " <table border='0' style='width : 235px;'> \n " ;
2021-05-27 10:30:49 +02:00
foreach ( $conference_room_users as $user_uuid => $row ) {
2016-01-18 22:15:21 +01:00
echo " <tr> \n " ;
2021-05-27 10:30:49 +02:00
echo " <td class='vtable'> " . escape ( $row [ 'username' ]) . " </td> \n " ;
2016-01-18 22:15:21 +01:00
echo " <td style='width: 25px;' align='right'> \n " ;
2016-01-19 06:06:45 +01:00
if ( permission_exists ( 'conference_room_delete' )) {
2021-05-27 10:30:49 +02:00
echo " <a href='conference_room_edit.php?conference_room_user_uuid= " . escape ( $row [ 'conference_room_user_uuid' ]) . " &conference_room_uuid= " . escape ( $conference_room_uuid ) . " &a=delete' alt='delete' onclick= \" return confirm( " . $text [ 'confirm-delete' ] . " ) \" > $v_link_label_delete </a> \n " ;
2016-01-19 06:06:45 +01:00
}
2016-01-18 22:15:21 +01:00
echo " </td> \n " ;
echo " </tr> \n " ;
2013-02-27 11:10:24 +01:00
}
2016-01-18 22:15:21 +01:00
echo " </table> \n " ;
2020-02-15 16:56:49 +01:00
echo " <br /> \n " ;
2012-09-13 06:45:57 +02:00
}
2020-02-15 16:56:49 +01:00
if ( permission_exists ( 'conference_room_add' ) && is_array ( $users ) && @ sizeof ( $users ) != 0 ) {
echo " <select name='user_uuid' class='formfld' style='width: auto;'> \n " ;
echo " <option value=''></option> \n " ;
foreach ( $users as $user ) {
echo " <option value=' " . escape ( $user [ 'user_uuid' ]) . " '> " . escape ( $user [ 'username' ]) . " </option> \n " ;
2016-01-19 06:06:45 +01:00
}
echo " </select> " ;
if ( $action == " update " ) {
2020-02-15 16:56:49 +01:00
echo button :: create ([ 'type' => 'submit' , 'label' => $text [ 'button-add' ], 'icon' => $_SESSION [ 'theme' ][ 'button_icon_add' ]]);
2016-01-19 06:06:45 +01:00
}
unset ( $users );
echo " <br> \n " ;
2016-01-18 22:15:21 +01:00
}
echo " " . $text [ 'description-users' ] . " \n " ;
echo " </td> " ;
echo " </tr> " ;
2015-02-13 22:17:02 +01:00
}
2013-01-08 21:58:49 +01:00
if ( permission_exists ( 'conference_room_profile' )) {
echo " <tr> \n " ;
2014-11-30 04:43:04 +01:00
echo " <td class='vncellreq' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-profile' ] . " </td> \n " ;
2013-01-08 21:58:49 +01:00
echo " <td class='vtable' align='left'> \n " ;
2017-10-21 19:13:31 +02:00
echo " <select class='formfld' name='profile'> \n " ;
foreach ( $conference_profiles as $row ) {
if ( $profile === $row [ 'profile_name' ]) {
2018-06-30 19:36:05 +02:00
echo " <option value=' " . escape ( $row [ 'profile_name' ]) . " ' selected='selected'> " . escape ( $row [ 'profile_name' ]) . " </option> \n " ;
2017-10-21 19:13:31 +02:00
}
else {
2018-06-30 19:36:05 +02:00
echo " <option value=' " . escape ( $row [ 'profile_name' ]) . " '> " . escape ( $row [ 'profile_name' ]) . " </option> \n " ;
2017-10-21 19:13:31 +02:00
}
}
echo " </select> \n " ;
2013-12-21 17:14:42 +01:00
echo " <br /> \n " ;
echo " " . $text [ 'description-profile' ] . " \n " ;
2013-01-08 21:58:49 +01:00
echo " </td> \n " ;
echo " </tr> \n " ;
2012-10-13 21:26:45 +02:00
}
2013-12-21 17:14:42 +01:00
if ( permission_exists ( 'conference_room_record' )) {
2013-01-08 21:58:49 +01:00
echo " <tr> \n " ;
2014-11-30 04:43:04 +01:00
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-record' ] . " </td> \n " ;
2013-01-08 21:58:49 +01:00
echo " <td class='vtable' align='left'> \n " ;
echo " <select class='formfld' name='record'> \n " ;
echo " <option value=''></option> \n " ;
2014-02-21 04:56:30 +01:00
if ( $record == " true " ) {
2013-01-08 21:58:49 +01:00
echo " <option value='true' selected='selected'> " . $text [ 'label-true' ] . " </option> \n " ;
}
else {
echo " <option value='true'> " . $text [ 'label-true' ] . " </option> \n " ;
}
2014-02-21 04:56:30 +01:00
if ( $record == " false " ) {
2013-01-08 21:58:49 +01:00
echo " <option value='false' selected='selected'> " . $text [ 'label-false' ] . " </option> \n " ;
}
else {
echo " <option value='false'> " . $text [ 'label-false' ] . " </option> \n " ;
}
echo " </select> \n " ;
echo " <br /> \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
2012-09-13 06:45:57 +02:00
}
2013-01-08 21:58:49 +01:00
if ( permission_exists ( 'conference_room_max_members' )) {
echo " <tr> \n " ;
2014-11-30 04:43:04 +01:00
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-max-members' ] . " </td> \n " ;
2013-01-08 21:58:49 +01:00
echo " <td class='vtable' align='left'> \n " ;
2018-06-30 19:36:05 +02:00
echo " <input class='formfld' type='text' name='max_members' maxlength='255' value=' " . escape ( $max_members ) . " '> \n " ;
2013-01-08 21:58:49 +01:00
echo " <br /> \n " ;
echo " \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
2012-09-13 06:45:57 +02:00
}
2013-01-08 21:58:49 +01:00
2014-11-29 22:21:26 +01:00
echo " <tr> \n " ;
2014-11-30 04:43:04 +01:00
echo " <td class='vncell' valign='top' nowrap='nowrap' width='30%'> " . $text [ 'label-schedule' ] . " </td> \n " ;
2016-04-13 21:23:07 +02:00
echo " <td class='vtable' width='70%' align='left' style='position: relative; min-width: 275px;'> \n " ;
2019-08-22 19:04:03 +02:00
echo " <input type='text' class='formfld datetimepicker' data-toggle='datetimepicker' data-target='#start_datetime' onblur= \" $ (this).datetimepicker('hide'); \" style='min-width: 115px; width: 115px; max-width: 115px;' name='start_datetime' id='start_datetime' placeholder=' " . $text [ 'label-from' ] . " ' value=' " . escape ( $start_datetime ) . " '> \n " ;
echo " <input type='text' class='formfld datetimepicker' data-toggle='datetimepicker' data-target='#stop_datetime' onblur= \" $ (this).datetimepicker('hide'); \" style='min-width: 115px; width: 115px; max-width: 115px;' name='stop_datetime' id='stop_datetime' placeholder=' " . $text [ 'label-to' ] . " ' value=' " . escape ( $stop_datetime ) . " '> \n " ;
2014-11-29 22:21:26 +01:00
echo " <br> " . $text [ 'description-schedule' ];
echo " </td> \n " ;
echo " </tr> \n " ;
2013-01-08 21:58:49 +01:00
if ( permission_exists ( 'conference_room_wait_mod' )) {
echo " <tr> \n " ;
2015-08-03 23:17:05 +02:00
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-wait_for_moderator' ] . " </td> \n " ;
2013-01-08 21:58:49 +01:00
echo " <td class='vtable' align='left'> \n " ;
echo " <select class='formfld' name='wait_mod'> \n " ;
echo " <option value=''></option> \n " ;
2014-02-21 04:56:30 +01:00
if ( $wait_mod == " true " ) {
2013-01-08 21:58:49 +01:00
echo " <option value='true' selected='selected'> " . $text [ 'label-true' ] . " </option> \n " ;
}
else {
echo " <option value='true'> " . $text [ 'label-true' ] . " </option> \n " ;
}
2014-02-21 04:56:30 +01:00
if ( $wait_mod == " false " ) {
2013-01-08 21:58:49 +01:00
echo " <option value='false' selected='selected'> " . $text [ 'label-false' ] . " </option> \n " ;
}
else {
echo " <option value='false'> " . $text [ 'label-false' ] . " </option> \n " ;
}
echo " </select> \n " ;
echo " <br /> \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
2012-09-13 06:45:57 +02:00
}
2013-01-08 21:58:49 +01:00
2020-05-05 06:15:16 +02:00
if ( permission_exists ( 'conference_room_moderator_endconf' )) {
echo " <tr> \n " ;
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-moderator_endconf' ] . " </td> \n " ;
echo " <td class='vtable' align='left'> \n " ;
echo " <select class='formfld' name='moderator_endconf'> \n " ;
echo " <option value=''></option> \n " ;
if ( $moderator_endconf == " true " ) {
echo " <option value='true' selected='selected'> " . $text [ 'label-true' ] . " </option> \n " ;
}
else {
echo " <option value='true'> " . $text [ 'label-true' ] . " </option> \n " ;
}
if ( $moderator_endconf == " false " ) {
echo " <option value='false' selected='selected'> " . $text [ 'label-false' ] . " </option> \n " ;
}
else {
echo " <option value='false'> " . $text [ 'label-false' ] . " </option> \n " ;
}
echo " </select> \n " ;
echo " <br /> \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
}
2020-03-31 23:51:00 +02:00
if ( permission_exists ( 'conference_room_announce_name' )) {
echo " <tr> \n " ;
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-announce_name' ] . " </td> \n " ;
echo " <td class='vtable' align='left'> \n " ;
echo " <select class='formfld' name='announce_name'> \n " ;
echo " <option value=''></option> \n " ;
if ( $announce_name == " true " ) {
echo " <option value='true' selected='selected'> " . $text [ 'label-true' ] . " </option> \n " ;
}
else {
echo " <option value='true'> " . $text [ 'label-true' ] . " </option> \n " ;
}
if ( $announce_name == " false " ) {
echo " <option value='false' selected='selected'> " . $text [ 'label-false' ] . " </option> \n " ;
}
else {
echo " <option value='false'> " . $text [ 'label-false' ] . " </option> \n " ;
}
echo " </select> \n " ;
echo " <br /> \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
}
if ( permission_exists ( 'conference_room_announce_count' )) {
echo " <tr> \n " ;
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-announce_count' ] . " </td> \n " ;
echo " <td class='vtable' align='left'> \n " ;
echo " <select class='formfld' name='announce_count'> \n " ;
echo " <option value=''></option> \n " ;
if ( $announce_count == " true " ) {
echo " <option value='true' selected='selected'> " . $text [ 'label-true' ] . " </option> \n " ;
}
else {
echo " <option value='true'> " . $text [ 'label-true' ] . " </option> \n " ;
}
if ( $announce_count == " false " ) {
echo " <option value='false' selected='selected'> " . $text [ 'label-false' ] . " </option> \n " ;
}
else {
echo " <option value='false'> " . $text [ 'label-false' ] . " </option> \n " ;
}
echo " </select> \n " ;
echo " <br /> \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
}
if ( permission_exists ( 'conference_room_announce_recording' )) {
2013-01-08 21:58:49 +01:00
echo " <tr> \n " ;
2020-03-31 23:51:00 +02:00
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-announce_recording' ] . " </td> \n " ;
2013-01-08 21:58:49 +01:00
echo " <td class='vtable' align='left'> \n " ;
2020-03-31 23:51:00 +02:00
echo " <select class='formfld' name='announce_recording'> \n " ;
2013-01-08 21:58:49 +01:00
echo " <option value=''></option> \n " ;
2020-03-31 23:51:00 +02:00
if ( $announce_recording == " true " ) {
2013-01-08 21:58:49 +01:00
echo " <option value='true' selected='selected'> " . $text [ 'label-true' ] . " </option> \n " ;
}
else {
echo " <option value='true'> " . $text [ 'label-true' ] . " </option> \n " ;
}
2020-03-31 23:51:00 +02:00
if ( $announce_recording == " false " ) {
2013-01-08 21:58:49 +01:00
echo " <option value='false' selected='selected'> " . $text [ 'label-false' ] . " </option> \n " ;
}
else {
echo " <option value='false'> " . $text [ 'label-false' ] . " </option> \n " ;
}
echo " </select> \n " ;
echo " <br /> \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
2012-09-13 06:45:57 +02:00
}
2013-01-05 12:38:10 +01:00
//echo "<tr>\n";
//echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
2015-02-15 07:50:00 +01:00
//echo " ".$text['label-enter-sound']."\n";
2013-01-05 12:38:10 +01:00
//echo "</td>\n";
//echo "<td class='vtable' align='left'>\n";
2018-06-30 19:36:05 +02:00
//echo " <input class='formfld' type='text' name='enter_sound' maxlength='255' value=\"".escape($enter_sound)."\">\n";
2013-01-05 12:38:10 +01:00
//echo "<br />\n";
//echo "\n";
//echo "</td>\n";
//echo "</tr>\n";
2012-09-13 06:45:57 +02:00
2013-01-08 21:58:49 +01:00
if ( permission_exists ( 'conference_room_mute' )) {
echo " <tr> \n " ;
2014-11-30 04:43:04 +01:00
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-mute' ] . " </td> \n " ;
2013-01-08 21:58:49 +01:00
echo " <td class='vtable' align='left'> \n " ;
echo " <select class='formfld' name='mute'> \n " ;
echo " <option value=''></option> \n " ;
2014-02-21 04:56:30 +01:00
if ( $mute == " true " ) {
2013-01-08 21:58:49 +01:00
echo " <option value='true' selected='selected'> " . $text [ 'label-true' ] . " </option> \n " ;
}
else {
echo " <option value='true'> " . $text [ 'label-true' ] . " </option> \n " ;
}
2014-02-21 04:56:30 +01:00
if ( $mute == " false " ) {
2013-01-08 21:58:49 +01:00
echo " <option value='false' selected='selected'> " . $text [ 'label-false' ] . " </option> \n " ;
}
else {
echo " <option value='false'> " . $text [ 'label-false' ] . " </option> \n " ;
}
echo " </select> \n " ;
echo " <br /> \n " ;
echo " \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
2012-09-13 06:45:57 +02:00
}
2021-12-02 06:39:29 +01:00
if ( permission_exists ( 'conference_room_email_address' )) {
echo " <tr> \n " ;
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
echo " " . $text [ 'label-email_address' ] . " \n " ;
echo " </td> \n " ;
echo " <td class='vtable' align='left'> \n " ;
echo " <input class='formfld' type='text' name='email_address' maxlength='255' value= \" " . escape ( $email_address ) . " \" > \n " ;
echo " <br /> \n " ;
echo " " . $text [ 'description-email_address' ] . " \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
}
2021-12-05 07:20:45 +01:00
if ( permission_exists ( 'conference_room_account_code' )) {
2021-12-02 06:39:29 +01:00
echo " <tr> \n " ;
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2021-12-05 07:20:45 +01:00
echo " " . $text [ 'label-account_code' ] . " \n " ;
2021-12-02 06:39:29 +01:00
echo " </td> \n " ;
echo " <td class='vtable' align='left'> \n " ;
2021-12-05 07:20:45 +01:00
echo " <input class='formfld' type='text' name='account_code' maxlength='255' value= \" " . escape ( $account_code ) . " \" > \n " ;
2021-12-02 06:39:29 +01:00
echo " <br /> \n " ;
2021-12-05 07:20:45 +01:00
echo " " . $text [ 'description-account_code' ] . " \n " ;
2021-12-02 06:39:29 +01:00
echo " </td> \n " ;
echo " </tr> \n " ;
}
2019-09-20 16:52:08 +02:00
if ( permission_exists ( 'conference_room_enabled' )) {
2013-01-08 21:58:49 +01:00
echo " <tr> \n " ;
2014-11-30 04:43:04 +01:00
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-enabled' ] . " </td> \n " ;
2013-01-08 21:58:49 +01:00
echo " <td class='vtable' align='left'> \n " ;
2023-02-14 19:19:02 +01:00
if ( substr ( $_SESSION [ 'theme' ][ 'input_toggle_style' ][ 'text' ], 0 , 6 ) == 'switch' ) {
echo " <label class='switch'> \n " ;
echo " <input type='checkbox' id='enabled' name='enabled' value='true' " . ( $enabled == 'true' ? " checked='checked' " : null ) . " > \n " ;
echo " <span class='slider'></span> \n " ;
echo " </label> \n " ;
2013-01-08 21:58:49 +01:00
}
else {
2023-02-14 19:19:02 +01:00
echo " <select class='formfld' id='enabled' name='enabled'> \n " ;
echo " <option value='true' " . ( $enabled == 'true' ? " selected='selected' " : null ) . " > " . $text [ 'option-true' ] . " </option> \n " ;
echo " <option value='false' " . ( $enabled == 'false' ? " selected='selected' " : null ) . " > " . $text [ 'option-false' ] . " </option> \n " ;
echo " </select> \n " ;
2013-01-08 21:58:49 +01:00
}
echo " <br /> \n " ;
echo " \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
2012-09-13 06:45:57 +02:00
}
2013-02-27 11:10:24 +01:00
if ( permission_exists ( 'conference_room_sounds' )) {
echo " <tr> \n " ;
2014-11-30 04:43:04 +01:00
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-sounds' ] . " </td> \n " ;
2013-02-27 11:10:24 +01:00
echo " <td class='vtable' align='left'> \n " ;
echo " <select class='formfld' name='sounds'> \n " ;
echo " <option value=''></option> \n " ;
2014-02-21 04:56:30 +01:00
if ( $sounds == " true " ) {
2013-02-27 11:10:24 +01:00
echo " <option value='true' selected='selected'> " . $text [ 'label-true' ] . " </option> \n " ;
}
else {
echo " <option value='true'> " . $text [ 'label-true' ] . " </option> \n " ;
}
2014-02-21 04:56:30 +01:00
if ( $sounds == " false " ) {
2013-02-27 11:10:24 +01:00
echo " <option value='false' selected='selected'> " . $text [ 'label-false' ] . " </option> \n " ;
}
else {
echo " <option value='false'> " . $text [ 'label-false' ] . " </option> \n " ;
}
echo " </select> \n " ;
echo " <br /> \n " ;
echo " \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
2013-02-01 13:23:39 +01:00
}
echo " <tr> \n " ;
2014-11-30 04:43:04 +01:00
echo " <td class='vncell' valign='top' align='left' nowrap='nowrap'> " . $text [ 'label-description' ] . " </td> \n " ;
2012-09-13 06:45:57 +02:00
echo " <td class='vtable' align='left'> \n " ;
2018-06-30 19:36:05 +02:00
echo " <input class='formfld' type='text' name='description' maxlength='255' value= \" " . escape ( $description ) . " \" > \n " ;
2012-09-13 06:45:57 +02:00
echo " <br /> \n " ;
echo " \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
2014-11-30 04:43:04 +01:00
2020-01-15 00:06:14 +01:00
echo " </table> \n " ;
echo " <br><br> \n " ;
2012-09-13 06:45:57 +02:00
if ( $action == " update " ) {
2020-01-15 00:06:14 +01:00
echo " <input type='hidden' name='conference_room_uuid' value=' " . escape ( $conference_room_uuid ) . " '> \n " ;
2012-09-13 06:45:57 +02:00
}
2020-01-15 00:06:14 +01:00
echo " <input type='hidden' name=' " . $token [ 'name' ] . " ' value=' " . $token [ 'hash' ] . " '> \n " ;
2014-11-29 22:21:26 +01:00
2012-09-13 06:45:57 +02:00
echo " </form> " ;
//include the footer
2013-07-06 08:29:50 +02:00
require_once " resources/footer.php " ;
2018-06-30 19:36:05 +02:00
2020-03-31 23:51:00 +02:00
?>