changed git call from https to git readonly
[atutor.git] / mods / openmeetings / lib / openmeetings.inc.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Cindy Qi Li, Harris Wong                */
6 /* Adaptive Technology Resource Centre / University of Toronto                  */
7 /* http://atutor.ca                                                                                                             */
8 /*                                                                                                                                              */
9 /* This program is free software. You can redistribute it and/or                */
10 /* modify it under the terms of the GNU General Public License                  */
11 /* as published by the Free Software Foundation.                                                */
12 /************************************************************************/
13 // $Id: openmeetings.inc.php 7575 2008-06-04 18:17:14Z hwong $
14 if (!defined('AT_INCLUDE_PATH')) { exit; }
15
16 /**
17  * Check against the array, if the value within is empty, replace each with the
18  * default values.
19  * @param       array   parameter
20  * @return      array 
21  */
22 function loadDefaultValues($post){
23         $_om_config = array (
24                 'openmeetings_roomtype'                         => 1,   //conference
25                 'openmeetings_num_of_participants'      => 5,
26                 'openmeetings_ispublic'                         => 1,   //true
27                 'openmeetings_vid_w'                            => 270,
28                 'openmeetings_vid_h'                            => 270,
29                 'openmeetings_show_wb'                          => 1,   //true
30                 'openmeetings_wb_w'                                     => 600,
31                 'openmeetings_wb_h'                                     => 660,
32                 'openmeetings_show_fp'                          => 1,   //true
33                 'openmeetings_fp_w'                                     => 270,
34                 'openmeetings_fp_h'                                     => 270
35         );
36
37         //replace each key if empty
38         foreach ($_om_config as $key=>$value){
39                 if (empty($post[$key])){
40                         $post[$key] = $value;
41                 }
42         }
43
44         return $post;
45 }
46
47
48 /**
49  * Check if openmeeting is being setup correctly.
50  * @param       int     the course id
51  */
52 function checkAccess($course_id){
53         global $_config, $msg;
54         if (!isset($_config['openmeetings_username']) || !isset($_config['openmeetings_userpass'])){
55                 include(AT_INCLUDE_PATH.'header.inc.php');
56                 $msg->addError('OPENMEETINGS_NOT_SETUP');
57                 include(AT_INCLUDE_PATH.'footer.inc.php');
58                 exit;
59         }
60 }
61 ?>