Back to List

View Original Layout

Sample code demonstrating how to use omNovia's Single Sign On with PHP
omNovia Technologies Inc.
Latest modifications: November 11, 2008

Single Sign On (SSO) is an API that allows you to send your members, once authenticated, from your site, to the omNovia Secure Conference login page. By passing their identification and other security parameters, they do not need to enter yet another password to access your Secure Conference room.

Open the PHP Script

<?PHP
Define some variables
$version = '1.3';

$companyID = 181;		// supplied by omNovia Support
$companyPass = 'test';	// supplied by omNovia Support
$roomID = 246;		// supplied by omNovia Support
Example 1 : with Email address
$companyUsername =	str_replace("@", "_", "joe@smith.com");

$firstName = 'joe';
$lastName = 'martin';


$link_duration = 0.5;	
duration in number of hours between the time they leave your site and the time they can actually access the room
$timestamp = time() + (3600 * $link_duration);

$isPresenter = 0;   // 0 for attendees.  1 for presenter or moderator

$userNo = 0;        // ** MUST be 0 for guest attendees. 
                    // ** For moderators, presenters or regular attendeesCAN be 0 if the person does not 
                    // have an account at omNovia OR it should be the userNo in the omNovia system if they have one

Whether you want the user to first go to an omNovia login page or directly access the room
$directAccess = 0;

If $directAccess is 0 it first takes the users to an omNovia login page which would test their Flash install and provide other info **THIS IS RECOMMENDED**

If $directAccess is 1, they would access the room directly . **NOT RECOMMENDED**

$openInSeparateWindow = 0;  // ONLY if you set $directAccess = 1;
You might want to open the room in a separate window. The advantage is the room will have a bigger interface as you can remove the navigation buttons and other menus on top of a newly opened browser. You cannot do so on an already open browser.
$inquiry = ($directAccess == 1 ? '&inquiry=login' : '');
Create a md5 hash
if ($userNo == 0)
  $md5 = md5($companyID.$companyPass.$roomID.$firstName.$lastName.$isPresenter.$version.$companyUsername.$timestamp);
else
  $md5 = md5($companyID.$companyPass.$roomID.$userNo.$isPresenter.$version.$companyUsername.$timestamp);
Construct the link
$base_omnovia_link = "https://www.omnovia.com/pages/sc2/roomlogin?";

if ($userNo == 0)
{
  $room_link = "companyID=$companyID&isPresenter=$isPresenter&loginType=2&roomID=$roomID$inquiry"
    . "&firstName=" . rawurlencode($firstName) . "&lastName=" . rawurlencode($lastName)
    . "&companyUsername=$companyUsername&_ts=$timestamp&_t=$md5&_v=$version";
}
else
{
  $room_link = "companyID=$companyID&isPresenter=$isPresenter&loginType=2&roomID=$roomID$inquiry"
    . "&userNo=$userNo&companyUsername=$companyUsername&_ts=$timestamp&_t=$md5&_v=$version";
}

Construct the full link
$room_link = $base_omnovia_link . $room_link;
You can now use $room_link anywhere in your PHP script as the URL to one of your rooms. If you have multiple rooms, you will need to loop through the $room_link, $enc_room_link generation code for each $roomID you have
if ($openInSeparateWindow == 1 )
{
print "<script>var isIE = (navigator.appVersion.indexOf('MSIE') != -1) ? true : false;
var scrollbars = (isIE ? 'no' : 'yes');";
print "function openRoom(){ window.open('".$room_link."', 'w" . $roomID . "', 'height=700,
width=850, toolbar=no, menubar=no, scrollbars=' + scrollbars + ', location=no,
directories=no,status=yes, resizable=1');}</script>"; }
you can add your own code here and then add a link.
if ($openInSeparateWindow == 1 )
{
print &quot;<a href='javascript:void(0)' onclick='openRoom()'>Access the room Here</a>&quot;;
}
else
{
print &quot;<a href="\&quot;$room_link\&quot;">Access the room Here</a>&quot;;
}
Close the PHP code
?>

THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESSED OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@category Web Services
@copyright omNovia Technologies
@version 1.3

Back to List

View Original Layout