You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by se...@apache.org on 2012/09/10 19:55:13 UTC

svn commit: r1383003 - in /incubator/openmeetings/trunk/plugins/atutor/openmeetings: ./ html/ lib/

Author: sebawagner
Date: Mon Sep 10 17:55:12 2012
New Revision: 1383003

URL: http://svn.apache.org/viewvc?rev=1383003&view=rev
Log:
OPENMEETINGS-280 commit changes from Josh to ATutor plugin

Modified:
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/NOTICE.txt
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/README.txt
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/add_group_meetings.php
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/create_room.inc.php
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/create_room.tmpl.php
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/update_room.inc.php
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/index.php
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/REST_openmeetings.php
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/openmeetings.class.php
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/openmeetings.inc.php
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.css
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.sql
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.xml
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/module_install.php
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/openmeetings.php
    incubator/openmeetings/trunk/plugins/atutor/openmeetings/openmeetings_instructor.php

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/NOTICE.txt
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/NOTICE.txt?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/NOTICE.txt (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/NOTICE.txt Mon Sep 10 17:55:12 2012
@@ -1,6 +1,6 @@
-Apache OpenMeetings
-Copyright 2011-2012 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
+Apache OpenMeetings
+Copyright 2011-2012 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/README.txt
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/README.txt?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/README.txt (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/README.txt Mon Sep 10 17:55:12 2012
@@ -1,13 +1,13 @@
-This ATutor plugin uses Apache OpenMeetings [Incubating].
-You need your own Apache OpenMeetings instance running.
-
-Be sure Openmeetings is installed and functioning properly before attempting to install this module. 
-
-Requires Openmeetings to be installed on this server, installation guide can be found at:
-http://incubator.apache.org/openmeetings/
-
-Installation
-1. Unzip the module into the ATutor mods/ directory.
-2. Login to ATutor as the administrator and run the ATutor administrator's Install Module tool. Select OpenMeetings to install.
-3. Once installed, on the administrator modules screen, enabled to module.
-4. Open the administrator's OpenMeetings screen and enter the URL, username and password to the Apache OpenMeetings installion you will be using.  The user account must have Admin-rights (at least access to REST API).
+This ATutor plugin uses Apache OpenMeetings [Incubating].
+You need your own Apache OpenMeetings instance running.
+
+Be sure Openmeetings is installed and functioning properly before attempting to install this module. 
+
+Requires Openmeetings to be installed on this server, installation guide can be found at:
+http://incubator.apache.org/openmeetings/
+
+Installation
+1. Unzip the module into the ATutor mods/ directory.
+2. Login to ATutor as the administrator and run the ATutor administrator's Install Module tool. Select OpenMeetings to install.
+3. Once installed, on the administrator modules screen, enabled to module.
+4. Open the administrator's OpenMeetings screen and enter the URL, username and password to the Apache OpenMeetings installion you will be using.  The user account must have Admin-rights (at least access to REST API).

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/add_group_meetings.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/add_group_meetings.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/add_group_meetings.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/add_group_meetings.php Mon Sep 10 17:55:12 2012
@@ -18,11 +18,6 @@
 * under the License.
 */
 
-//ini_set('display_errors',1);  
-
-// Report all PHP errors (notices, errors, warnings, etc.)  
-//error_reporting(E_ALL);
-
 define('AT_INCLUDE_PATH', '../../include/');
 require (AT_INCLUDE_PATH.'vitals.inc.php');
 require ('lib/openmeetings.class.php');
@@ -89,7 +84,7 @@ if (isset($_POST['create_room']) || (iss
 		
 		//add the room with the given parameters.
 		$om_obj->om_addRoom($room_name, $_POST);
-		//exit('stop here');
+
 		$msg->addFeedback('OPENMEETINGS_ADDED_SUCEEDED');
 		header('Location: index.php');
 		exit;
@@ -112,20 +107,6 @@ if (isset($_POST['create_room']) || (iss
 	$room_obj = $om_obj->om_getRoomById($room_id);
 
 	//Assign existing variables to the room
-	/*
-	$_POST['openmeetings_roomtype']				= intval($room_obj['return']['roomtype']['roomtypes_id']);
-	$_POST['openmeetings_room_name']			= $addslashes($room_obj['return']['name']);
-	$_POST['openmeetings_num_of_participants']	= $addslashes($room_obj['return']['numberOfPartizipants']);
-	(($room_obj['return']['ispublic'])=='true')?$_POST['openmeetings_ispublic']=1:$_POST['openmeetings_ispublic']=0;
-	$_POST['openmeetings_vid_w']				= intval($room_obj['return']['videoPodWidth']);
-	$_POST['openmeetings_vid_h']				= intval($room_obj['return']['videoPodHeight']);
-	(($room_obj['return']['showWhiteBoard'])=='true')?$_POST['openmeetings_show_wb']=1:$_POST['openmeetings_show_wb']=0;
-	$_POST['openmeetings_wb_w']					= intval($room_obj['return']['whiteBoardPanelWidth']);
-	$_POST['openmeetings_wb_h']					= intval($room_obj['return']['whiteBoardPanelHeight']);
-	(($room_obj['return']['showFilesPanel'])=='true')?$_POST['openmeetings_show_fp']=1:$_POST['openmeetings_show_fp']=0;
-	$_POST['openmeetings_fp_w']					= intval($room_obj['return']['filesPanelWidth']);
-	$_POST['openmeetings_fp_h']					= intval($room_obj['return']['filesPanelHeight']);
-	*/
 	$_POST['openmeetings_roomtype']				= intval($room_obj['roomtypes_id']);
 	$_POST['openmeetings_room_name']			= $addslashes($room_obj['name']);
 	$_POST['openmeetings_num_of_participants']	= $addslashes($room_obj['numberOfPartizipants']);

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/create_room.inc.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/create_room.inc.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/create_room.inc.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/create_room.inc.php Mon Sep 10 17:55:12 2012
@@ -1,50 +1,50 @@
-<?php
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied.  See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-//Get default values if POST is empty
-$_POST = loadDefaultValues($_POST);	//openmeetings.inc.php
-
-?>
-<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
-	<div class="input-form">
-		<div class="row"><p><?php echo _AT('openmeetings_create_room_instr'); ?></p></div>
-	</div>
-	<div class="input-form">
-		<?php include ('create_room.tmpl.php'); ?>
-
-		<div class="row buttons">
-			<input type="submit" name="create_room" value="<?php echo _AT('openmeetings_create_room'); ?>"  />
-		</div>
-	</div>
-</form>
-
-<script type="text/javascript">
-	function om_toggler(name, enabled){
-		var obj_w = document.getElementById(name + '_w');
-		var obj_h = document.getElementById(name + '_h');
-		if(enabled==true) {
-			obj_w.disabled = "";	
-			obj_h.disabled = "";	
-		} else if (enabled==false){
-			obj_w.disabled = "disabled";
-			obj_h.disabled = "disabled";
-		}
-	}
-</script>
+<?php
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+//Get default values if POST is empty
+$_POST = loadDefaultValues($_POST);	//openmeetings.inc.php
+
+?>
+<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
+	<div class="input-form">
+		<div class="row"><p><?php echo _AT('openmeetings_create_room_instr'); ?></p></div>
+	</div>
+	<div class="input-form">
+		<?php include ('create_room.tmpl.php'); ?>
+
+		<div class="row buttons">
+			<input type="submit" name="create_room" value="<?php echo _AT('openmeetings_create_room'); ?>"  />
+		</div>
+	</div>
+</form>
+
+<script type="text/javascript">
+	function om_toggler(name, enabled){
+		var obj_w = document.getElementById(name + '_w');
+		var obj_h = document.getElementById(name + '_h');
+		if(enabled==true) {
+			obj_w.disabled = "";	
+			obj_h.disabled = "";	
+		} else if (enabled==false){
+			obj_w.disabled = "disabled";
+			obj_h.disabled = "disabled";
+		}
+	}
+</script>

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/create_room.tmpl.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/create_room.tmpl.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/create_room.tmpl.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/create_room.tmpl.php Mon Sep 10 17:55:12 2012
@@ -40,50 +40,3 @@
 	<input type="radio" name="openmeetings_ispublic" id="openmeetings_ispublic_y" value="1" <?php echo $om_ispublic_y;?>/><label for="openmeetings_ispublic_y"><?php echo _AT('yes');  ?></label> 
 	<input type="radio" name="openmeetings_ispublic" id="openmeetings_ispublic_n" value="0" <?php echo $om_ispublic_n;?>/><label for="openmeetings_ispublic_n"><?php echo _AT('no');  ?></label> 
 </div>
-
-<!-- Video settings -->
-<!--<div class="row">
-	<p><label for="openmeetings_vid_w"><?php echo _AT('openmeetings_vid_w'); ?></label></p>	
-	<input type="text" name="openmeetings_vid_w" value="<?php echo $_POST['openmeetings_vid_w']; ?>" id="openmeetings_vid_w" size="20" />
-</div>
-<div class="row">
-	<p><label for="openmeetings_vid_h"><?php echo _AT('openmeetings_vid_h'); ?></label></p>	
-	<input type="text" name="openmeetings_vid_h" value="<?php echo $_POST['openmeetings_vid_h']; ?>" id="openmeetings_vid_h" size="20" />
-</div>-->
-
-<!-- Whiteboard settings -->
-<!--<div class="row">
-	<?php
-		($_POST['openmeetings_show_wb']== 1)? $om_show_wb_y = 'checked="checked"' : $om_show_wb_n = 'checked="checked"';
-	?>
-	<p><label for="openmeetings_show_wb"><?php echo _AT('openmeetings_show_wb'); ?></label></p>	
-	<input type="radio" name="openmeetings_show_wb" id="openmeetings_show_wb_enabled" value="1" <?php echo $om_show_wb_y;?> onclick="om_toggler('openmeetings_wb', true);"/>
-	<label for="openmeetings_show_wb_enabled"><?php echo _AT('enable');  ?></label> 
-	<input type="radio" name="openmeetings_show_wb" id="openmeetings_show_wb_disabled" value="0" <?php echo $om_show_wb_n;?> onclick="om_toggler('openmeetings_wb', false);"/><label for="openmeetings_show_wb_disabled"><?php echo _AT('disable');  ?></label> 
-</div>
-<div class="row">
-	<p><label for="openmeetings_wb_w"><?php echo _AT('openmeetings_wb_w'); ?></label></p>	
-	<input type="text" name="openmeetings_wb_w" value="<?php echo $_POST['openmeetings_wb_w']; ?>" id="openmeetings_wb_w" size="20" />
-</div>
-<div class="row">
-	<p><label for="openmeetings_wb_h"><?php echo _AT('openmeetings_wb_h'); ?></label></p>	
-	<input type="text" name="openmeetings_wb_h" value="<?php echo $_POST['openmeetings_wb_h']; ?>" id="openmeetings_wb_h" size="20" />
-</div>-->
-
-<!-- File Panel settings -->
-<!--<div class="row">
-	<?php
-		($_POST['openmeetings_show_fp']== 1)? $om_show_fp_y = 'checked="checked"' : $om_show_fp_n = 'checked="checked"';
-	?>
-	<p><label for="openmeetings_show_fp"><?php echo _AT('openmeetings_show_fp'); ?></label></p>	
-	<input type="radio" name="openmeetings_show_fp" id="openmeetings_show_fp_enabled" value="1" <?php echo $om_show_fp_y;?> onclick="om_toggler('openmeetings_fp', true);"/><label for="openmeetings_show_fp_enabled"><?php echo _AT('enable');  ?></label> 
-	<input type="radio" name="openmeetings_show_fp" id="openmeetings_show_fp_disabled" value="0" <?php echo $om_show_fp_n;?> onclick="om_toggler('openmeetings_fp', false);"/><label for="openmeetings_show_fp_disabled"><?php echo _AT('disable');  ?></label> 
-</div>
-<div class="row">
-	<p><label for="openmeetings_fp_w"><?php echo _AT('openmeetings_fp_w'); ?></label></p>	
-	<input type="text" name="openmeetings_fp_w" value="<?php echo $_POST['openmeetings_fp_w']; ?>" id="openmeetings_fp_w" size="20" />
-</div>
-<div class="row">
-	<p><label for="openmeetings_fp_h"><?php echo _AT('openmeetings_fp_h'); ?></label></p>	
-	<input type="text" name="openmeetings_fp_h" value="<?php echo $_POST['openmeetings_fp_h']; ?>" id="openmeetings_fp_h" size="20" />
-</div>-->

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/update_room.inc.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/update_room.inc.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/update_room.inc.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/html/update_room.inc.php Mon Sep 10 17:55:12 2012
@@ -1,47 +1,47 @@
-<?php
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied.  See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-?>
-<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
-	<div class="input-form">
-		<?php include ('create_room.tmpl.php'); ?>
-
-		<div class="row buttons">
-			<input type="hidden" name="openmeetings_room_name" value="<?php echo $_POST['openmeetings_room_name']; ?>" />
-			<input type="hidden" name="room_id" value="<?php echo $room_id; ?>"  />
-			<input type="submit" name="update_room" value="<?php echo _AT('save'); ?>"  />
-			<input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>"  />
-		</div>
-	</div>
-</form>
-
-<script type="text/javascript">
-	function om_toggler(name, enabled){
-		var obj_w = document.getElementById(name + '_w');
-		var obj_h = document.getElementById(name + '_h');
-		if(enabled==true) {
-			obj_w.disabled = "";	
-			obj_h.disabled = "";	
-		} else if (enabled==false){
-			obj_w.disabled = "disabled";
-			obj_h.disabled = "disabled";
-		}
-	}
-</script>
+<?php
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+?>
+<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
+	<div class="input-form">
+		<?php include ('create_room.tmpl.php'); ?>
+
+		<div class="row buttons">
+			<input type="hidden" name="openmeetings_room_name" value="<?php echo $_POST['openmeetings_room_name']; ?>" />
+			<input type="hidden" name="room_id" value="<?php echo $room_id; ?>"  />
+			<input type="submit" name="update_room" value="<?php echo _AT('save'); ?>"  />
+			<input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>"  />
+		</div>
+	</div>
+</form>
+
+<script type="text/javascript">
+	function om_toggler(name, enabled){
+		var obj_w = document.getElementById(name + '_w');
+		var obj_h = document.getElementById(name + '_h');
+		if(enabled==true) {
+			obj_w.disabled = "";	
+			obj_h.disabled = "";	
+		} else if (enabled==false){
+			obj_w.disabled = "disabled";
+			obj_h.disabled = "disabled";
+		}
+	}
+</script>

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/index.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/index.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/index.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/index.php Mon Sep 10 17:55:12 2012
@@ -38,9 +38,6 @@ require (AT_INCLUDE_PATH.'header.inc.php
 //Initiate Openmeeting
 $om_obj = new Openmeetings($course_id, $_SESSION['member_id']);
 
-//Login
-// failing here
-
 $om_obj->om_login();
 
 //Handles form actions

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/REST_openmeetings.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/REST_openmeetings.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/REST_openmeetings.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/REST_openmeetings.php Mon Sep 10 17:55:12 2012
@@ -25,7 +25,7 @@ class REST_openmeetings {
 	function REST_openmeetings($rest) {
 	
 		$this->_rest = $rest;
-		$getSession_obj	= $this->_performAPICall();	
+		$getSession_obj	= $this->_performAPICall();
 
 		//check for session id
 		try {
@@ -35,12 +35,12 @@ class REST_openmeetings {
 			var_dump($e->getMessage());
 			exit('Error: no \'session_id\' in REST API response');
 		}
-
 	}
 
 	// make API calls w/ params
 	// NOTE: code based off of Apache OpenMeetings Moodle plug-in
 	function _performAPICall($resource='getSession', $service='UserService', $params=array()){
+
 		// This will allow you to view errors in the browser       
 		// Note: set 'display_errors' to 0 in production  
 		//ini_set('display_errors',1);  
@@ -51,46 +51,42 @@ class REST_openmeetings {
 
 		// URI used for making REST call. Each Web Service uses a unique URL.  
 		$request = $this->_rest.$service.'/'.$resource;
-						
-		// Initialize the session by passing the request as a parameter	
-		$session = curl_init($request); 
-
-		// Set curl options by passing session and flags
-		// CURLOPT_HEADER allows us to receive the HTTP header
-		curl_setopt($session, CURLOPT_HEADER, true);  
-		  
-		// CURLOPT_RETURNTRANSFER will return the response   
-		curl_setopt($session, CURLOPT_RETURNTRANSFER, true);	
-		
-		$temp = array();
-		//echo '<pre>'; print_r($params);echo '</pre>';
-		foreach ($params as $key => $value) {
-			array_push($temp, $key.'='.$value);
+
+		// build the query string
+		$qs = http_build_query($params);
+
+		try {
+			// NOTE: Need php-curl to use (sudo apt-get install php-curl)
+			// Initialize the session by passing the request as a parameter	
+			$session = curl_init($request); 
+			  
+			// CURLOPT_RETURNTRANSFER will return the response   
+			curl_setopt($session, CURLOPT_RETURNTRANSFER, true);	
+
+			// send query string
+			curl_setopt($session, CURLOPT_POSTFIELDS, $qs);	
+		
+			// Make the request  
+			$response = curl_exec($session); 		
+			  
+			// get the status code
+			$status_code = curl_getinfo($session, CURLINFO_HTTP_CODE);
+
+			// Close the curl session  
+			curl_close($session);
+
+		} catch (Exception $e) {
+			exit('Error: PHP cUrl extension not found. Must install php-curl (sudo apt-get install php-curl)');
 		}
-		$qs = implode('&', $temp);
-		$qs = str_replace(' ', '+', $qs);
-		curl_setopt($session, CURLOPT_POSTFIELDS, $qs);	
-		
-		// Make the request  
-		$response = curl_exec($session); 		
-		  
-		// Close the curl session  
-		curl_close($session);
 		
 		// Confirm that the request was transmitted to the OpenMeetings! Image Search Service  
 		if(!$response) {  
 		   //die('Request OpenMeetings! OpenMeetings Service failed and no response was returned.'); 
 		   die('Please make sure an OpenMeetings instance is running. Unable to connect to OpenMeetings.'); 
-		}  
-		
-		// Create an array to store the HTTP response codes  
-		$status_code = array();  
-		  
-		// Use regular expressions to extract the code from the header  
-		preg_match('/\d\d\d/', $response, $status_code);  
+		}  		
 		  
 		// Check the HTTP Response code and display message if status code is not 200 (OK)  
-		switch( $status_code[0] ) {  
+		switch($status_code) {  
 		        case 200:  
 		                // Success  
 		                break;  
@@ -110,17 +106,28 @@ class REST_openmeetings {
 		                     That means:  Bad request. The parameters passed to the service did not match as expected.   
 		                     The exact error is returned in the XML response.');  
 		                break;  
-		        default:  
-		        	die('Your call to OpenMeetings Web Services returned an unexpected HTTP status of: ' 
-				    . $status_code[0].' Request '.$request);  
+		        default:
+				if ($status_code) {
+					die('Your call to OpenMeetings Web Services returned an unexpected HTTP status of: ' 
+				   	 . $status_code.' Request '.$request);  
+				} else {
+					die('Your call to OpenMeetings Web Services returned no HTTP status. 
+                                             Have you installed php-curl on the ATutor server?');
+				}
+
 		} 
 		
 		// Get the XML from the response, bypassing the header
 		if (!($xml = strstr($response, '<ns'))) {
 			$xml = null;
 		} 
-		
-		// NOTE: Need php-xml to use (sudo yum install php-xml)
+
+		// uncomment these 3 lines to view raw response data from API
+		// echo '<b>Request:</b> '.$request.'<br><b>Params:</b> ';
+		// print_r($params);
+		// echo '<br><b>Code:</b> '.$status_code.'<br><b>Response:</b> '.htmlspecialchars($xml).'<br><br>';
+
+		// NOTE: Need php-xml to use (sudo apt-get install php-xml)
 		try {
 			$dom = new DOMDocument();
 		} catch (Exception $e) {
@@ -135,6 +142,7 @@ class REST_openmeetings {
 		foreach ($returnNodeList as $returnNode) {
 			$returnArray[$returnNode->localName] = $returnNode->nodeValue;
 		}
+
 		return $returnArray;
 	}
 
@@ -200,7 +208,7 @@ class REST_openmeetings {
 	}
 
 	function myErrors() {
-		// leftover function from nusoap implementation
+		// leftover function from soap implementation
 		return '';
 	}
 

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/openmeetings.class.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/openmeetings.class.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/openmeetings.class.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/openmeetings.class.php Mon Sep 10 17:55:12 2012
@@ -19,83 +19,34 @@
 */
 
 if (!defined('AT_INCLUDE_PATH')) { exit; }
-//require('SOAP_openmeetings.php');
+
 require('REST_openmeetings.php');
 
 class Openmeetings {
-	var $_sid = '';		//Openmeetings session id
+	var $_sid = '';	       //Openmeetings session id
 	var $_course_id = '';
 	var $_member_id = '';
 	var $_group_id = '';
+	var $_om;
 
 	//Constructor
 	function Openmeetings($course_id, $member_id, $group_id=0){
 		$this->_course_id	= abs($course_id);
 		$this->_member_id	= abs($member_id);
 		$this->_group_id	= abs($group_id);
-
 	}
 
-	/**
-	 * Login to openmeetings
-	 * Login process is, login, saveuserinstance
-	 */
-	/*function om_login() {
-		global $_config;
-		//$om = new REST_openmeetings($_config['openmeetings_location'].'/services/UserService/');
-		$om = new SOAP_openmeetings($_config['openmeetings_location'].'/services/UserService?wsdl');
-		$param = array (	'username' => $_config['openmeetings_username'], 
-							'userpass' => $_config['openmeetings_userpass']);
-		/**
-		 * Login to the openmeetings
-		 * ref: http://code.google.com/p/openmeetings/wiki/DirectLoginSoapGeneralFlow
-		 
-		$result = $om->login($param);
-		if ($result < 0){
-			debug($om->getError($result), 'error');
-			return;
-		} 
-		
-		//If no error, then get the generated OM session id
-		$this->_sid = $om->getSid();
-
-		//exit($this->_sid);
-
-		//Retrieve members information
-		$sql = 'SELECT login, first_name, last_name, email FROM '.TABLE_PREFIX.'members WHERE member_id='.$this->_member_id;
-		$result = mysql_query($sql);
-		$row = mysql_fetch_assoc($result);
-
-		// Save user instance
-		$params = array(
-					"username"				=> $row['login'],
-					"firstname"				=> $row['first_name'],
-					"lastname"				=> $row['last_name'],
-					"profilePictureUrl"		=> '',
-					"email"					=> $row['email']
-				  );
-		$om->saveUserInstance($params);
-	}*/
-
 	//new function
 	function om_login() {
 
 		global $_config;
 		
 		$om = new REST_openmeetings($_config['openmeetings_location'].'/services/');
-		
-		//$om = new SOAP_openmeetings($_config['openmeetings_location'].'/services/UserService?wsdl');
+
 		$param = array ('username' => $_config['openmeetings_username'], 
 				'userpass' => $_config['openmeetings_userpass']);
-		
-		/**
-		 * Login to the openmeetings
-		 * ref: http://code.google.com/p/openmeetings/wiki/DirectLoginSoapGeneralFlow
-		 */
-		$result = $om->login($param);
 
-		//print_r($result);
-		//echo '<br><br>';
+		$result = $om->login($param);
 
 		if ($result < 0){
 			debug($om->getError($result), 'error');
@@ -104,14 +55,10 @@ class Openmeetings {
 		
 		//If no error, then get the generated OM session id
 		$this->_sid = $om->getSid();
-		//echo $this->_sid;
-		//echo '<br><br>';
-		//exit($this->_sid);
 
 		//Retrieve members information
 		$sql = 'SELECT login, first_name, last_name, email FROM '.TABLE_PREFIX.'members WHERE member_id='.$this->_member_id;
-		//echo $sql;
-		//echo '<br><br>';
+
 		$result = mysql_query($sql);
 		$row = mysql_fetch_assoc($result);
 
@@ -128,6 +75,9 @@ class Openmeetings {
 
 		
 		$om->saveUserInstance($params);
+		$this->_om=$om;
+
+		return $this->_sid;
 	}
 
 	/**
@@ -137,7 +87,7 @@ class Openmeetings {
 	 * @return room # of the created room, or the room # of the existed room
 	 */
 	function om_addRoom($room_name, $om_param=array()){
-		//exit('adding room failed');
+
 		global $_config;
 
 		if ($this->_course_id < 0){
@@ -150,41 +100,26 @@ class Openmeetings {
 			return $room_id;
 		}
 		
-		//Add this room
-		//$om = new SOAP_openmeetings($_config['openmeetings_location'].'/services/RoomService?wsdl');
-		$om = new REST_openmeetings($_config['openmeetings_location'].'/services/');
+		$om = $this->_om;
 
-		/*$param = array (	
-					'SID'					=> $this->_sid,
-					'name'					=> $room_name,
-					'roomtypes_id'			=> $om_param['openmeetings_roomtype'],
-					'numberOfPartizipants'	=> $om_param['openmeetings_num_of_participants'],
-					'ispublic'				=> $om_param['openmeetings_ispublic'],
-					'videoPodWidth'			=> $om_param['openmeetings_vid_w'],
-					'videoPodHeight'		=> $om_param['openmeetings_vid_h'],
-					'showWhiteBoard'		=> $om_param['openmeetings_show_wb'],
-					'whiteBoardPanelWidth'	=> $om_param['openmeetings_wb_w'],
-					'whiteBoardPanelHeight'	=> $om_param['openmeetings_wb_h'],
-					'showFilesPanel'		=> $om_param['openmeetings_show_fp'],
-					'filesPanelHeight'		=> $om_param['openmeetings_fp_h'],
-					'filesPanelWidth'		=> $om_param['openmeetings_fp_w']
-					);*/
-
-		$param = array (	
-					'SID'					=> $this->_sid,
-					'name'					=> $room_name,
-					'roomtypes_id'			=> $om_param['openmeetings_roomtype'],
-					'numberOfPartizipants'	=> $om_param['openmeetings_num_of_participants'],
-					'ispublic'				=> $om_param['openmeetings_ispublic'],
-					'appointment'			=> 0,
-					'isDemoRoom'                    => 0,
-					'demoTime'                      => 1000,
-					// TODO Check if it is
-					'isModeratedRoom'		=>0
-					);
+		$param = array ( 'SID'				=> $this->_sid,
+				 'name'				=> $room_name,
+				 'roomtypes_id'			=> $om_param['openmeetings_roomtype'],
+				 'numberOfPartizipants'		=> $om_param['openmeetings_num_of_participants'],
+				 'ispublic'			=> $om_param['openmeetings_ispublic'],
+				 'appointment'			=> 0,
+				 'isDemoRoom'                   => 0,
+				 'demoTime'                     => 1000,
+				 // TODO Check if it is
+				 'isModeratedRoom'		=> 0
+				);
+
+		//Add this room
 		$result = $om->addRoom($param);
+
 		//TODO: Check for error, and handles success/failure
 		if ($result){
+
 			//TODO: On success, add to DB entry.
 			$sql = 'INSERT INTO '.TABLE_PREFIX.'openmeetings_rooms SET rooms_id='.$result['return'].', course_id='.$this->_course_id 
 				 . ', owner_id=' . $this->_member_id;
@@ -200,6 +135,7 @@ class Openmeetings {
 				return $result['return'];
 			}
 		}
+		
 		return false;
 	}
 
@@ -208,41 +144,24 @@ class Openmeetings {
 	 * update room
 	 */
 	function om_updateRoom($room_id, $om_param=array()){
+		
 		global $_config;
 
-		//update this room
-		//$om = new SOAP_openmeetings($_config['openmeetings_location'].'/services/RoomService?wsdl');
-		$om = new REST_openmeetings($_config['openmeetings_location'].'/services/');
-		/*$param = array (	
-					'SID'					=> $this->_sid,
-					'rooms_id'				=> $room_id,
-					'name'					=> $om_param['openmeetings_room_name'],
-					'roomtypes_id'			=> $om_param['openmeetings_roomtype'],
-					'numberOfPartizipants'	=> $om_param['openmeetings_num_of_participants'],
-					'ispublic'				=> $om_param['openmeetings_ispublic'],
-					'videoPodWidth'			=> $om_param['openmeetings_vid_w'],
-					'videoPodHeight'		=> $om_param['openmeetings_vid_h'],
-					'showWhiteBoard'		=> $om_param['openmeetings_show_wb'],
-					'whiteBoardPanelWidth'	=> $om_param['openmeetings_wb_w'],
-					'whiteBoardPanelHeight'	=> $om_param['openmeetings_wb_h'],
-					'showFilesPanel'		=> $om_param['openmeetings_show_fp'],
-					'filesPanelHeight'		=> $om_param['openmeetings_fp_h'],
-					'filesPanelWidth'		=> $om_param['openmeetings_fp_w']
-					);*/	
-		$param = array (	
-					'SID'					=> $this->_sid,
-					'rooms_id'				=> $room_id,
-					'name'					=> $om_param['openmeetings_room_name'],
-					'roomtypes_id'			=> $om_param['openmeetings_roomtype'],
-					'numberOfPartizipants'	=> $om_param['openmeetings_num_of_participants'],
-					'ispublic'				=> $om_param['openmeetings_ispublic'],
-					'appointment'			=> 0,
-					'isDemoRoom'                    => 0,
-					'demoTime'                      => 1000,
-					// TODO Check if it is
-					'isModeratedRoom'		=> 0
-					);
+		$om = $this->_om;
 
+		$param = array ( 'SID'				=> $this->_sid,
+				 'rooms_id'			=> $room_id,
+				 'name'				=> $om_param['openmeetings_room_name'],
+				 'roomtypes_id'			=> $om_param['openmeetings_roomtype'],
+				 'numberOfPartizipants'		=> $om_param['openmeetings_num_of_participants'],
+				 'ispublic'			=> $om_param['openmeetings_ispublic'],
+				 'appointment'			=> 0,
+				 'isDemoRoom'                   => 0,
+				 'demoTime'                     => 1000,
+				 // TODO Check if it is
+				 'isModeratedRoom'		=> 0
+				);
+		//update this room
 		$result = $om->updateRoom($param);
 		return $result;
 	}
@@ -261,10 +180,8 @@ class Openmeetings {
 	 * @return	the room id if there is a room already assigned to this course; false otherwise
 	 */
 	function om_getRoom(){
-//		$sql = 'SELECT rooms_id FROM '.TABLE_PREFIX.'openmeetings_rooms INNER JOIN '.TABLE_PREFIX."openmeetings_groups WHERE 
-//				course_id = $this->_course_id AND owner_id = $this->_member_id AND group_id = $this->_group_id";
-		$sql = 'SELECT rooms_id FROM '.TABLE_PREFIX.'openmeetings_rooms r NATURAL JOIN '.TABLE_PREFIX."openmeetings_groups g WHERE 
-				course_id = $this->_course_id AND group_id = $this->_group_id";
+		$sql = 'SELECT rooms_id FROM '.TABLE_PREFIX.'openmeetings_rooms r NATURAL JOIN '
+		 .TABLE_PREFIX."openmeetings_groups g WHERE course_id = $this->_course_id AND group_id = $this->_group_id";
 		$result = mysql_query($sql);
 		if (mysql_numrows($result) > 0){
 			$row = mysql_fetch_assoc($result);
@@ -283,12 +200,11 @@ class Openmeetings {
 		if ($room_id == ''){
 			return false;
 		}
-		//$om = new SOAP_openmeetings($_config['openmeetings_location'].'/services/RoomService?wsdl');
-		$om = new REST_openmeetings($_config['openmeetings_location'].'/services/');
-		$param = array (	
-					'SID'			=> $this->_sid,
-					'rooms_id'		=> $room_id
-					);
+
+		$om = $this->_om;
+		$param = array ( 'SID'	     => $this->_sid,
+				 'rooms_id'  => $room_id
+			       );
 		$result = $om->getRoomById($param);
 		return $result;
 	}
@@ -306,15 +222,14 @@ class Openmeetings {
 	 */
 	function om_deleteRoom($room_id){
 		global $_config;
-		//$om = new SOAP_openmeetings($_config['openmeetings_location'].'/services/RoomService?wsdl');
-		$om = new REST_openmeetings($_config['openmeetings_location'].'/services/');
-		$param = array (	
-					'SID'			=> $this->_sid,
-					'rooms_id'		=> $room_id
-					);
+		$om = $this->_om;
+		$param = array ( 'SID'	    => $this->_sid,
+				 'rooms_id' => $room_id
+				);
 
 		$result = $om->deleteRoom($param);
-		$sql = 'DELETE r, g FROM (SELECT om_id FROM '.TABLE_PREFIX."openmeetings_rooms WHERE rooms_id=$room_id) AS t, ".TABLE_PREFIX
+		$sql = 'DELETE r, g FROM (SELECT om_id FROM '.TABLE_PREFIX
+		 ."openmeetings_rooms WHERE rooms_id=$room_id) AS t, ".TABLE_PREFIX
 				.'openmeetings_rooms r NATURAL JOIN '.TABLE_PREFIX.'openmeetings_groups g WHERE r.om_id =t.om_id';
 		mysql_query($sql);
 	}

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/openmeetings.inc.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/openmeetings.inc.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/openmeetings.inc.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/lib/openmeetings.inc.php Mon Sep 10 17:55:12 2012
@@ -28,17 +28,17 @@ if (!defined('AT_INCLUDE_PATH')) { exit;
  */
 function loadDefaultValues($post){
 	$_om_config = array (
-		'openmeetings_roomtype'				=> 1,	//conference
+		'openmeetings_roomtype'			=> 1,	//conference
 		'openmeetings_num_of_participants'	=> 5,
-		'openmeetings_ispublic'				=> 1,	//true
-		'openmeetings_vid_w'				=> 270,
-		'openmeetings_vid_h'				=> 270,
-		'openmeetings_show_wb'				=> 1,	//true
-		'openmeetings_wb_w'					=> 600,
-		'openmeetings_wb_h'					=> 660,
-		'openmeetings_show_fp'				=> 1,	//true
-		'openmeetings_fp_w'					=> 270,
-		'openmeetings_fp_h'					=> 270
+		'openmeetings_ispublic'			=> 1,	//true
+		'openmeetings_vid_w'			=> 270,
+		'openmeetings_vid_h'			=> 270,
+		'openmeetings_show_wb'			=> 1,	//true
+		'openmeetings_wb_w'			=> 600,
+		'openmeetings_wb_h'			=> 660,
+		'openmeetings_show_fp'			=> 1,	//true
+		'openmeetings_fp_w'			=> 270,
+		'openmeetings_fp_h'			=> 270
 	);
 
 	//replace each key if empty

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.css
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.css?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.css (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.css Mon Sep 10 17:55:12 2012
@@ -1,17 +1,17 @@
-div.openmeetings {
-	background-color: #F8F8F8;
-	border: 1px solid #666;
-	padding: 1em;
-	margin: 1em;
-}
-
-div.openmeetings ul{
-	list-style: none;
-	font-family: Verdana, Helevetica, Arial, sans-serif;
-}
-
-div.openmeetings h5{
-	padding-top: 0;
-	padding-bottom: 0.5em;
-}
-
+div.openmeetings {
+	background-color: #F8F8F8;
+	border: 1px solid #666;
+	padding: 1em;
+	margin: 1em;
+}
+
+div.openmeetings ul{
+	list-style: none;
+	font-family: Verdana, Helevetica, Arial, sans-serif;
+}
+
+div.openmeetings h5{
+	padding-top: 0;
+	padding-bottom: 0.5em;
+}
+

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.sql
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.sql?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.sql (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.sql Mon Sep 10 17:55:12 2012
@@ -1,66 +1,66 @@
-# sql file for Openmeeting module
-
-# Table for openmeetings
-CREATE TABLE `openmeetings_rooms` (
-   `om_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
-   `course_id` mediumint(8) unsigned NOT NULL,
-   `owner_id` mediumint(8) unsigned NOT NULL,
-   `rooms_id` bigint( 20 ) NOT NULL ,
-   PRIMARY KEY ( `om_id` )
-);
-
-CREATE TABLE `openmeetings_groups` (
-   `om_id` mediumint(8) unsigned NOT NULL,
-   `group_id` mediumint(8) unsigned NOT NULL,
-   PRIMARY KEY ( `om_id`, `group_id` )
-);
-
-INSERT INTO `language_text` VALUES ('en', '_module', 'openmeetings_missing_url', 'You must supply the URL to your Openmeetings installation in the field below.', NOW(), '');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings','Openmeetings',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_open','Open Openmeetings Admin',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_location','The location of your Openmeetings installation. This should be the base URL of your Openmeetings installation (e.g. http://www.myserver.com:5080/openmeetings).',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_own_window','Open Openmeetings in a New Window:',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_course_meetings','Course Openmeetings',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_view_meetings','View Openmeetings',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_grp_meetings','Group Openmeetings',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_existing_room','You already have started a <a href="%s">room</a>, would you like to edit your room or to start a new one?',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_deleting_warning','(Note, starting a new room will close your current room.  Once the room is closed, <strong>all chat logs and associated room materials will be deleted</strong>.)',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_no_course_meetings','There is no course meeting at the moment.  Instructor can add a course meeting.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_no_group_meetings','There is no group meeting at the moment.  You have to be assigned to a group in order to start a group meeting.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_course_conference','Course conference:',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_group_conference','Group conference(s):',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_num_of_participants','Number of participants',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_ispublic','Public meeting?',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_vid_w','Video Width (in pixel)',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_vid_h','Video Height (in pixel)',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_show_wb','Display whiteboard?',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_wb_w','Whiteboard Width (in pixel)',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_wb_h','Whiteboard Height (in pixel)',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_show_fp','Display file panel?',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_fp_w','File Panel Width (in pixel)',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_fp_h','File Panel Height (in pixel)',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_username','Openmeeting Username (Must have admin-rights)', NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_userpass','Openmeeting Password',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_grp_meetings','Openmeeting Group Meetings',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_delete','Delete Meeting Room',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_confirm_delete','Are you sure you want to delete this conference room?  All the associated chats and files will be deleted.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_roomtype','Room Mode',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_conference','Conference Mode',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_audience','Audience Mode',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_create_room_instr','Adjust the following settings, then click "Create" to start the conference/audience room.  For more information on the settings, please see the <a href="http://code.google.com/p/openmeetings/wiki/SoapMethods#addRoom" target="_new">Openmeetings documentation</a>.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_edit_room','Edit room',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_create_room','Create new room',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_delete_room','Remove room',NOW(),'');
-
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_OPENMEETINGS_URL_ADD_SAVED','Openmeetings configuration options were successfully saved.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_OPENMEETINGS_CANCELLED','Successfully cancelled without saving any changes.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_OPENMEETINGS_DELETE_SUCEEDED','The room has been successfully deleted.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_OPENMEETINGS_ADDED_SUCEEDED','The room has been added successfully.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_OPENMEETINGS_UPDATE_SUCEEDED','The room has been updated successfully.',NOW(),'');
-
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_NOT_SETUP','Openmeetings has not been setup yet, please contact your administrator.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_ADD_FAILED','The room cannot be created.  You must be belong to this group or you must have the permission to create a room.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_DELETE_FAILED','An error has occured while deleting the room, please contact the administrator.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_URL_ADD_EMPTY','You must enter a URL to the location of your Openmeetings installation.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_USERNAME_ADD_EMPTY','You must enter an username to the account of your Openmeetings installation.',NOW(),'');
-INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_USERPASS_ADD_EMPTY','You must enter a password to the account of your Openmeetings installation.',NOW(),'');
+# sql file for Openmeeting module
+
+# Table for openmeetings
+CREATE TABLE `openmeetings_rooms` (
+   `om_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
+   `course_id` mediumint(8) unsigned NOT NULL,
+   `owner_id` mediumint(8) unsigned NOT NULL,
+   `rooms_id` bigint( 20 ) NOT NULL ,
+   PRIMARY KEY ( `om_id` )
+);
+
+CREATE TABLE `openmeetings_groups` (
+   `om_id` mediumint(8) unsigned NOT NULL,
+   `group_id` mediumint(8) unsigned NOT NULL,
+   PRIMARY KEY ( `om_id`, `group_id` )
+);
+
+INSERT INTO `language_text` VALUES ('en', '_module', 'openmeetings_missing_url', 'You must supply the URL to your Openmeetings installation in the field below.', NOW(), '');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings','Openmeetings',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_open','Open Openmeetings Admin',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_location','The location of your Openmeetings installation. This should be the base URL of your Openmeetings installation (e.g. http://www.myserver.com:5080/openmeetings).',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_own_window','Open Openmeetings in a New Window:',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_course_meetings','Course Openmeetings',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_view_meetings','View Openmeetings',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_grp_meetings','Group Openmeetings',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_existing_room','You already have started a <a href="%s">room</a>, would you like to edit your room or to start a new one?',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_deleting_warning','(Note, starting a new room will close your current room.  Once the room is closed, <strong>all chat logs and associated room materials will be deleted</strong>.)',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_no_course_meetings','There is no course meeting at the moment.  Instructor can add a course meeting.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_no_group_meetings','There is no group meeting at the moment.  You have to be assigned to a group in order to start a group meeting.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_course_conference','Course conference:',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_group_conference','Group conference(s):',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_num_of_participants','Number of participants',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_ispublic','Public meeting?',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_vid_w','Video Width (in pixel)',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_vid_h','Video Height (in pixel)',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_show_wb','Display whiteboard?',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_wb_w','Whiteboard Width (in pixel)',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_wb_h','Whiteboard Height (in pixel)',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_show_fp','Display file panel?',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_fp_w','File Panel Width (in pixel)',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_fp_h','File Panel Height (in pixel)',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_username','Openmeeting Username (Must have admin-rights)', NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_userpass','Openmeeting Password',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_grp_meetings','Openmeeting Group Meetings',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_delete','Delete Meeting Room',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_confirm_delete','Are you sure you want to delete this conference room?  All the associated chats and files will be deleted.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_roomtype','Room Mode',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_conference','Conference Mode',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_audience','Audience Mode',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_create_room_instr','Adjust the following settings, then click "Create" to start the conference/audience room.  For more information on the settings, please see the <a href="http://incubator.apache.org/openmeetings/RoomService.html#addRoomWithModeration" target="_new">Openmeetings documentation</a>.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_edit_room','Edit room',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_create_room','Create new room',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_module','openmeetings_delete_room','Remove room',NOW(),'');
+
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_OPENMEETINGS_URL_ADD_SAVED','Openmeetings configuration options were successfully saved.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_OPENMEETINGS_CANCELLED','Successfully cancelled without saving any changes.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_OPENMEETINGS_DELETE_SUCEEDED','The room has been successfully deleted.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_OPENMEETINGS_ADDED_SUCEEDED','The room has been added successfully.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_FEEDBACK_OPENMEETINGS_UPDATE_SUCEEDED','The room has been updated successfully.',NOW(),'');
+
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_NOT_SETUP','Openmeetings has not been setup yet, please contact your administrator.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_ADD_FAILED','The room cannot be created.  You must be belong to this group or you must have the permission to create a room.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_DELETE_FAILED','An error has occured while deleting the room, please contact the administrator.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_URL_ADD_EMPTY','You must enter a URL to the location of your Openmeetings installation.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_USERNAME_ADD_EMPTY','You must enter an username to the account of your Openmeetings installation.',NOW(),'');
+INSERT INTO `language_text` VALUES ('en', '_msgs','AT_ERROR_OPENMEETINGS_USERPASS_ADD_EMPTY','You must enter a password to the account of your Openmeetings installation.',NOW(),'');

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.xml
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.xml?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.xml (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/module.xml Mon Sep 10 17:55:12 2012
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="ISO-8859-1"?> 
-<module version="0.5"> 
-    <name lang="en">openmeetings</name> 
-    <description lang="en">Apache OpenMeetings is a Multi-Language Cross-Platform Customizable Video-Conferencing and Collaboration Flash based web application.</description> 
-    <maintainers>
-        <maintainer> 
-            <name>Apache OpenMeetings</name> 
-            <email>openmeetings-user@incubator.apache.org</email> 
-        </maintainer>
-    </maintainers> 
-    <url>http://incubator.apache.org/openmeetings/</url> 
-    <license>ASF</license> 
-    <release> 
-        <version>0.5</version> 
-        <date>2012-07-02</date> 
-        <state>stable</state> 
-	<notes>Requires Apache OpenMeetings to be installed on the user's system.  Details can be found at http://incubator.apache.org/openmeetings/installation.html</notes> 
-    </release> 
-</module>
+<?xml version="1.0" encoding="ISO-8859-1"?> 
+<module version="0.5"> 
+    <name lang="en">openmeetings</name> 
+    <description lang="en">Apache OpenMeetings is a Multi-Language Cross-Platform Customizable Video-Conferencing and Collaboration Flash based web application.</description> 
+    <maintainers>
+        <maintainer> 
+            <name>Apache OpenMeetings</name> 
+            <email>openmeetings-user@incubator.apache.org</email> 
+        </maintainer>
+    </maintainers> 
+    <url>http://incubator.apache.org/openmeetings/</url> 
+    <license>ASF</license> 
+    <release> 
+        <version>0.5</version> 
+        <date>2012-07-02</date> 
+        <state>stable</state> 
+	<notes>Requires Apache OpenMeetings to be installed on the user's system.  Details can be found at http://incubator.apache.org/openmeetings/installation.html</notes> 
+    </release> 
+</module>

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/module_install.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/module_install.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/module_install.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/module_install.php Mon Sep 10 17:55:12 2012
@@ -1,65 +1,65 @@
-<?php
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied.  See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-/*******
- * the line below safe-guards this file from being accessed directly from
- * a web browser. It will only execute if required from within an ATutor script,
- * in our case the Module::install() method.
- */
-if (!defined('AT_INCLUDE_PATH')) { exit; }
-/*******
- * Note: the many options for these variables are used to decrease confusion.
- *       TRUE | FALSE | 1 will be the convention.
- *
- * $_course_privilege
- *     specifies the type of instructor privilege this module uses.
- *     set to empty | FALSE | 0   to disable any privileges.
- *     set to 1 | AT_PRIV_ADMIN   to use the instructor only privilege.
- *     set to TRUE | 'new'        to create a privilege specifically for this module:
- *                                will make this module available as a student privilege.
- *
- * $_admin_privilege
- *    specifies the type of ATutor administrator privilege this module uses.
- *    set to FALSE | AT_ADMIN_PRIV_ADMIN   to use the super administrator only privilege.
- *    set to TRUE | 'new'                  to create a privilege specifically for this module:
- *                                         will make this module available as an administrator privilege.
- *
- *
- * $_cron_interval
- *    if non-zero specifies in minutes how often the module's cron job should be run.
- *    set to 0 or not set to disable.
- */
-$_course_privilege = TRUE; // possible values: FALSE | AT_PRIV_ADMIN | TRUE
-$_admin_privilege  = TRUE; // possible values: FALSE | TRUE
-
-
-if (!$msg->containsErrors() && file_exists(dirname(__FILE__) . '/module.sql')) {
-	// deal with the SQL file:
-	require(AT_INCLUDE_PATH . 'classes/sqlutility.class.php');
-	$sqlUtility =& new SqlUtility();
-
-	/*
-	 * the SQL file could be stored anywhere, and named anything, "module.sql" is simply
-	 * a convention we're using.
-	 */
-	$sqlUtility->queryFromFile(dirname(__FILE__) . '/module.sql', TABLE_PREFIX);
-}
-
-?>
+<?php
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+/*******
+ * the line below safe-guards this file from being accessed directly from
+ * a web browser. It will only execute if required from within an ATutor script,
+ * in our case the Module::install() method.
+ */
+if (!defined('AT_INCLUDE_PATH')) { exit; }
+/*******
+ * Note: the many options for these variables are used to decrease confusion.
+ *       TRUE | FALSE | 1 will be the convention.
+ *
+ * $_course_privilege
+ *     specifies the type of instructor privilege this module uses.
+ *     set to empty | FALSE | 0   to disable any privileges.
+ *     set to 1 | AT_PRIV_ADMIN   to use the instructor only privilege.
+ *     set to TRUE | 'new'        to create a privilege specifically for this module:
+ *                                will make this module available as a student privilege.
+ *
+ * $_admin_privilege
+ *    specifies the type of ATutor administrator privilege this module uses.
+ *    set to FALSE | AT_ADMIN_PRIV_ADMIN   to use the super administrator only privilege.
+ *    set to TRUE | 'new'                  to create a privilege specifically for this module:
+ *                                         will make this module available as an administrator privilege.
+ *
+ *
+ * $_cron_interval
+ *    if non-zero specifies in minutes how often the module's cron job should be run.
+ *    set to 0 or not set to disable.
+ */
+$_course_privilege = TRUE; // possible values: FALSE | AT_PRIV_ADMIN | TRUE
+$_admin_privilege  = TRUE; // possible values: FALSE | TRUE
+
+
+if (!$msg->containsErrors() && file_exists(dirname(__FILE__) . '/module.sql')) {
+	// deal with the SQL file:
+	require(AT_INCLUDE_PATH . 'classes/sqlutility.class.php');
+	$sqlUtility =& new SqlUtility();
+
+	/*
+	 * the SQL file could be stored anywhere, and named anything, "module.sql" is simply
+	 * a convention we're using.
+	 */
+	$sqlUtility->queryFromFile(dirname(__FILE__) . '/module.sql', TABLE_PREFIX);
+}
+
+?>

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/openmeetings.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/openmeetings.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/openmeetings.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/openmeetings.php Mon Sep 10 17:55:12 2012
@@ -1,88 +1,88 @@
-<?php
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied.  See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-/**
- * This is the ATutor Openmeetings module page. It allows an admin user
- * to set or edit  the URL for the Openmeetings installation for ATutor, and define an optional guest password.
- */
-define('AT_INCLUDE_PATH', '../../include/');
-require (AT_INCLUDE_PATH.'vitals.inc.php');
-$_custom_css = $_base_path . 'mods/openmeetings/module.css'; // use a custom stylesheet
-admin_authenticate(AT_ADMIN_PRIV_OPENMEETINGS);
-
-if (isset($_POST['submit'])) {
-	$_POST['om_uri'] = $addslashes(trim($_POST['om_uri']));
-	if (substr($_POST['om_uri'], -1, 1) == '/') {
-		$_POST['om_uri'] = substr($_POST['om_uri'], 0, -1);
-	}
-	$_POST['om_username'] = $addslashes(trim($_POST['om_username']));
-	$_POST['om_userpass'] = $addslashes(trim($_POST['om_userpass']));
-
-	if (!$_POST['om_uri']){
-		$msg->addError('OPENMEETINGS_URL_ADD_EMPTY');
-	}
-	if (!$_POST['om_username']){
-		$msg->addError('OPENMEETINGS_USERNAME_ADD_EMPTY');
-	}
-	if (!$_POST['om_userpass']){
-		$msg->addError('OPENMEETINGS_USERPASS_ADD_EMPTY');
-	}	
-			
-	if (!$msg->containsErrors()) {
-		$_POST['om_uri'] = $addslashes($_POST['om_uri']);
-		$sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('openmeetings_location', '$_POST[om_uri]'), ('openmeetings_username', '$_POST[om_username]'), ('openmeetings_userpass', '$_POST[om_userpass]')";
-		mysql_query($sql, $db);
-		$msg->addFeedback('OPENMEETINGS_URL_ADD_SAVED');
-
-		header('Location: '.$_SERVER['PHP_SELF']);
-		exit;
-	}
-}
-
-require (AT_INCLUDE_PATH.'header.inc.php');
-
-?>
-<form action="<?php  $_SERVER['PHP_SELF']; ?>" method="post">
-	<div class="input-form">
-		<div class="row">
-			<p><label for="om_uri"><?php echo _AT('openmeetings_location'); ?></label></p>	
-			<input type="text" name="om_uri" value="<?php echo $_config['openmeetings_location']; ?>" id="om_uri" size="80" style="min-width: 95%;" />
-		</div>
-		<div class="row">
-			<p><label for="om_username"><?php echo _AT('openmeetings_username'); ?></label></p>	
-			<input type="text" name="om_username" value="<?php echo $_config['openmeetings_username']; ?>" id="om_username" size="20" />
-
-			<p><label for="om_userpass"><?php echo _AT('openmeetings_userpass'); ?></label></p>	
-			<input type="text" name="om_userpass" value="<?php echo $_config['openmeetings_userpass']; ?>" id="om_userpass" size="20" />
-		</div>
-		<div class="row buttons">
-			<input type="submit" name="submit" value="<?php echo _AT('save'); ?>"  />
-		</div>
-	</div>
-</form>
-<div>
-<a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('<?php echo $_config['openmeetings_location']; ?>','openmeetingswin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('openmeetings_own_window'); ?></a> </li>
-
-<?php exit; if ($_config['openmeetings_location'] != ''): ?>
-<iframe name="openmeetings" id="openmeetings" title="Openmeetings" frameborder="1" scrolling="auto" src="<?php echo $_config['openmeetings_location']; ?>/index.jsp" height="500" width="90%" align="center" style="border:thin white solid; align:center;" allowautotransparency="true"></iframe>
-<?php endif; ?>
-
-</div>
-<?php  require (AT_INCLUDE_PATH.'footer.inc.php'); ?>
+<?php
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+/**
+ * This is the ATutor Openmeetings module page. It allows an admin user
+ * to set or edit  the URL for the Openmeetings installation for ATutor, and define an optional guest password.
+ */
+define('AT_INCLUDE_PATH', '../../include/');
+require (AT_INCLUDE_PATH.'vitals.inc.php');
+$_custom_css = $_base_path . 'mods/openmeetings/module.css'; // use a custom stylesheet
+admin_authenticate(AT_ADMIN_PRIV_OPENMEETINGS);
+
+if (isset($_POST['submit'])) {
+	$_POST['om_uri'] = $addslashes(trim($_POST['om_uri']));
+	if (substr($_POST['om_uri'], -1, 1) == '/') {
+		$_POST['om_uri'] = substr($_POST['om_uri'], 0, -1);
+	}
+	$_POST['om_username'] = $addslashes(trim($_POST['om_username']));
+	$_POST['om_userpass'] = $addslashes(trim($_POST['om_userpass']));
+
+	if (!$_POST['om_uri']){
+		$msg->addError('OPENMEETINGS_URL_ADD_EMPTY');
+	}
+	if (!$_POST['om_username']){
+		$msg->addError('OPENMEETINGS_USERNAME_ADD_EMPTY');
+	}
+	if (!$_POST['om_userpass']){
+		$msg->addError('OPENMEETINGS_USERPASS_ADD_EMPTY');
+	}	
+			
+	if (!$msg->containsErrors()) {
+		$_POST['om_uri'] = $addslashes($_POST['om_uri']);
+		$sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('openmeetings_location', '$_POST[om_uri]'), ('openmeetings_username', '$_POST[om_username]'), ('openmeetings_userpass', '$_POST[om_userpass]')";
+		mysql_query($sql, $db);
+		$msg->addFeedback('OPENMEETINGS_URL_ADD_SAVED');
+
+		header('Location: '.$_SERVER['PHP_SELF']);
+		exit;
+	}
+}
+
+require (AT_INCLUDE_PATH.'header.inc.php');
+
+?>
+<form action="<?php  $_SERVER['PHP_SELF']; ?>" method="post">
+	<div class="input-form">
+		<div class="row">
+			<p><label for="om_uri"><?php echo _AT('openmeetings_location'); ?></label></p>	
+			<input type="text" name="om_uri" value="<?php echo $_config['openmeetings_location']; ?>" id="om_uri" size="80" style="min-width: 95%;" />
+		</div>
+		<div class="row">
+			<p><label for="om_username"><?php echo _AT('openmeetings_username'); ?></label></p>	
+			<input type="text" name="om_username" value="<?php echo $_config['openmeetings_username']; ?>" id="om_username" size="20" />
+
+			<p><label for="om_userpass"><?php echo _AT('openmeetings_userpass'); ?></label></p>	
+			<input type="text" name="om_userpass" value="<?php echo $_config['openmeetings_userpass']; ?>" id="om_userpass" size="20" />
+		</div>
+		<div class="row buttons">
+			<input type="submit" name="submit" value="<?php echo _AT('save'); ?>"  />
+		</div>
+	</div>
+</form>
+<div>
+<a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('<?php echo $_config['openmeetings_location']; ?>','openmeetingswin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('openmeetings_own_window'); ?></a> </li>
+
+<?php exit; if ($_config['openmeetings_location'] != ''): ?>
+<iframe name="openmeetings" id="openmeetings" title="Openmeetings" frameborder="1" scrolling="auto" src="<?php echo $_config['openmeetings_location']; ?>/index.jsp" height="500" width="90%" align="center" style="border:thin white solid; align:center;" allowautotransparency="true"></iframe>
+<?php endif; ?>
+
+</div>
+<?php  require (AT_INCLUDE_PATH.'footer.inc.php'); ?>

Modified: incubator/openmeetings/trunk/plugins/atutor/openmeetings/openmeetings_instructor.php
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/plugins/atutor/openmeetings/openmeetings_instructor.php?rev=1383003&r1=1383002&r2=1383003&view=diff
==============================================================================
--- incubator/openmeetings/trunk/plugins/atutor/openmeetings/openmeetings_instructor.php (original)
+++ incubator/openmeetings/trunk/plugins/atutor/openmeetings/openmeetings_instructor.php Mon Sep 10 17:55:12 2012
@@ -39,11 +39,11 @@ if (isset($_POST['create_room']) && isse
 	$_POST['room_id'] = intval($_POST['room_id']);
 	$om_obj->om_deleteRoom($_POST['room_id']);
 	$msg->addFeedback('OPENMEETINGS_DELETE_SUCEEDED');
-} elseif (isset($_POST['delete_room']) && isset($_POST['room_id'])){
+} else if (isset($_POST['delete_room']) && isset($_POST['room_id'])){
 	$_POST['room_id'] = intval($_POST['room_id']);
 	$om_obj->om_deleteRoom($_POST['room_id']);
 	$msg->addFeedback('OPENMEETINGS_DELETE_SUCEEDED');
-} elseif (isset($_POST['create_room']) || (isset($_POST['update_room']) && isset($_POST['room_id']))){
+} else if (isset($_POST['create_room']) || (isset($_POST['update_room']) && isset($_POST['room_id']))){
 	//mysql escape
 	$_POST['openmeetings_roomtype']				= intval($_POST['openmeetings_roomtype']);
 	$_POST['openmeetings_num_of_participants']	= intval($_POST['openmeetings_num_of_participants']);
@@ -68,18 +68,21 @@ if (isset($_POST['create_room']) && isse
 		}
 
 		//add the room with the given parameters.
-		$om_obj->om_addRoom($room_name, $_POST);
+		if (!$om_obj->om_addRoom($room_name, $_POST)) {
+			exit('couldnt add room');
+		
+		}
 		$msg->addFeedback('OPENMEETINGS_ADDED_SUCEEDED');
 		header('Location: index.php');
 		exit;
-	} elseif (isset($_POST['update_room'])){
+	} else if (isset($_POST['update_room'])){
 		//update a room
 		$om_obj->om_updateRoom(intval($_POST['room_id']), $_POST);
 		$msg->addFeedback('OPENMEETINGS_UPDATE_SUCEEDED');
 		header('Location: index.php');
 		exit;
 	}
-} elseif (isset($_POST['edit_room']) && isset($_POST['room_id'])){
+} else if (isset($_POST['edit_room']) && isset($_POST['room_id'])){
 	//Log into the room
 	$room_id = $om_obj->om_getRoom();
 
@@ -103,11 +106,11 @@ if (isset($_POST['create_room']) && isse
 	include ('html/update_room.inc.php');
 	include (AT_INCLUDE_PATH.'footer.inc.php'); 
 	exit;
-} elseif (isset($_POST['cancel'])){
+} else if (isset($_POST['cancel'])){
 	$msg->addFeedback('OPENMEETINGS_CANCELLED');
 	header('Location: index.php');
 	exit;
-} elseif (isset($_GET['action']) && $_GET['action'] == 'view'){
+} else if (isset($_GET['action']) && $_GET['action'] == 'view'){
 	$room_id = intval($_GET['room_id']);
 	$sid	 = $addslashes($_GET['sid']);
 	header('Location: view_meetings.php?room_id='.$room_id.SEP.'sid='.$sid);