Пример #1
0
 public function getMeeting()
 {
     $input = JFactory::getApplication()->input;
     $id = $input->get('meetingID');
     $tempId = (int) $input->get('meetingID');
     $id = $id;
     $password = $input->get('password');
     $user = JFactory::getUser();
     $username = $user->id ? $user->name : 'Anonymous';
     $data = array();
     if ($id) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query = "SELECT * FROM `#__bigbluebutton_meetings` WHERE `id`=" . (int) $id;
         $db->setQuery($query);
         $bbbdata = $db->loadObject();
         $isUserModerator = false;
         $moderators_ids = json_decode($bbbdata->event_moderators);
         foreach ($moderators_ids as $moderatorid) {
             if ($moderatorid == $user->id) {
                 $isUserModerator = true;
                 break;
             }
         }
         //add a field for moderator users. so if a user is a moderator the password that will be used will be the moderator password, else will be the attendee password.
         $password = $bbbdata->all_moderator == 1 && $user->id || $isUserModerator ? $bbbdata->moderatorPW : $bbbdata->attendeePW;
         $bbb = new BBBHelper();
         //here the function is called here.
         $get = $bbb->meeting($id, $username, $password);
         if (preg_match("/meetingID/", $get)) {
             $data['status'] = "yes";
             $data['url'] = $get;
             $data['message'] = 'Success';
         } else {
             $data['status'] = "no";
             $data['url'] = '';
             $data['message'] = $get;
         }
     }
     return $data;
 }
Пример #2
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $extensions = BBBHelper::getExtensions();
     $options = array();
     foreach ($extensions as $extension) {
         $option = new stdClass();
         $option->text = JText::_(ucfirst((string) $extension->name));
         $option->value = (string) $extension->name;
         $options[] = $option;
     }
     return JHTML::_('select.genericlist', $options, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value, $control_name . $name);
 }
Пример #3
0
 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  */
 protected function getOptions()
 {
     $class = ($v = $this->element['class']) ? 'class="' . $v . '"' : 'class="inputbox"';
     $extensions = BBBHelper::getExtensions();
     $options = array();
     foreach ($extensions as $extension) {
         $listview = is_object($extension->listview) ? $extension->listview->__toString() : $extension->listview;
         $name = is_object($extension->name) ? $extension->name->__toString() : $extension->name;
         $option = new stdClass();
         $option->text = JText::_(ucfirst($listview));
         $option->value = 'com_bbb.' . $name;
         $options[] = $option;
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
Пример #4
0
 /**
  * Returns the options for extensions list
  * 
  * @param string $ext - the extension
  */
 public static function extensions($ext)
 {
     $extensions = BBBHelper::getExtensions();
     $options = array();
     foreach ($extensions as $extension) {
         $option = new stdClass();
         $option->text = JText::_(ucfirst($extension->name));
         $option->value = 'com_bbb.' . $extension->name;
         $options[] = $option;
     }
     return JHtml::_('select.options', $options, 'value', 'text', $ext, true);
 }
Пример #5
0
<?php

/**
* @version		$Id:default_25.php 1 2015-03-05 16:31:34Z Jibon $
* @copyright	Copyright (C) 2015, Jibon Lawrence Costa. All rights reserved.
* @license 		http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
JFactory::getDocument()->addStyleSheet(JURI::base() . '/components/com_bbb/assets/lists-j25.css');
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
require_once JPATH_ROOT . '/administrator/components/com_bbb/helpers/bbb.php';
$bbb = new BBBHelper();
$params = JComponentHelper::getParams('com_bbb');
if ($params->get('salt') == "" || $params->get('url') == "") {
    echo '<div class="alert alert-danger"><p class="bg-danger" style="color: red;">Please add server url & salt. You can add those information by click on "Options" button.</p></div>';
}
?>
<form action="index.php?option=com_bbb&amp;view=meeting" method="post" name="adminForm" id="adminForm">
	<table>
		<tr>
			<td align="left" width="100%">
				<div id="filter-bar" class="btn-toolbar">
					<div class="filter-search btn-group pull-left">
						<label class="element-invisible" for="filter_search"><?php 
echo JText::_('Filter');
?>
:</label>
Пример #6
0
 public function getBbbDbRecordings($meetingId, $categoryId)
 {
     $db = JFactory::getDBO();
     $input = JFactory::getApplication()->input;
     $user = JFactory::getUser();
     $bbbRecordingsTemp = array();
     $bbbRecordingsArr = array();
     $bbb = new BBBHelper();
     $meetingId = $meetingId ? $meetingId : 0;
     $bbbRecordingsTemp = $bbb->getBbbRecordings($meetingId);
     $query = $db->getQuery(true)->select('id, group_id, group_name')->from($db->quoteName('#__bigbluebutton_excludedgroups'));
     $db->setQuery($query);
     $excludedGroups = $db->loadObjectList();
     $exGroupArr = array();
     foreach ($excludedGroups as $exGroup) {
         $exGroupArr[$exGroup->group_id] = $exGroup->group_id;
     }
     $userInExcludedGroup = false;
     //if there are no groups assigned
     foreach ($excludedGroups as $exGroup) {
         if (in_array($exGroup->group_id, JAccess::getGroupsByUser($user->id))) {
             $userInExcludedGroup = true;
             break;
         }
     }
     $meetingIds = array();
     foreach ($bbbRecordingsTemp as $bbbRecording) {
         if ($bbbRecording["recordId"]) {
             $mid = $bbbRecording["meetingId"];
             $query = $db->getQuery(true)->select('id, meeting_id, cat_id, meetingName, meeting_description, voiceBridge, maxParticipants, record, event_moderators, allowed_users, allowed_groups, display_time, start_time, end_time, all_moderator, event_isopen, duration, created')->from($db->quoteName('#__bigbluebutton_meetings'))->where('meeting_id = ' . $db->quote($mid));
             $query->order('display_time ASC');
             $db->setQuery($query);
             $meetingD = $db->loadObject();
             $eventSkip = 0;
             $eventModeratorsArr = json_decode($meetingD->event_moderators);
             $allowedGroupsArr = json_decode($meetingD->allowed_groups);
             $allowedUsersArr = json_decode($meetingD->allowed_users);
             $countEventModeratorsArr = count(array_filter($eventModeratorsArr));
             $countAllowedGroupsArr = count(array_filter($allowedGroupsArr));
             $countAllowedUsersArr = count(array_filter($allowedUsersArr));
             $groups = $user->get('groups');
             $userAllowed = false;
             $userIsTeacher = false;
             $eventGroupIsInExGroup = false;
             //if there are no groups assigned
             if ($countAllowedUsersArr > 0) {
                 foreach ($allowedUsersArr as $userId) {
                     if ($user->id == $userId) {
                         $userAllowed = true;
                         break;
                     }
                 }
             }
             //if there are no groups assigned
             if ($countAllowedGroupsArr > 0) {
                 foreach ($allowedGroupsArr as $groupId) {
                     if (in_array($groupId, $exGroupArr)) {
                         $eventGroupIsInExGroup = true;
                     }
                     if (in_array($groupId, JAccess::getGroupsByUser($user->id))) {
                         $userAllowed = true;
                         break;
                     }
                 }
             }
             //if there are no Moderators assigned
             if ($countEventModeratorsArr > 0) {
                 foreach ($eventModeratorsArr as $teacherId) {
                     if ($user->id == $teacherId) {
                         $userIsTeacher = true;
                     }
                     break;
                 }
             }
             //No Restrictions. neutralize
             if ($countAllowedUsersArr == 0 && $countAllowedGroupsArr == 0 || $userIsTeacher) {
                 $userAllowed = true;
             }
             //If a category is selected, filter by category
             if ($categoryId) {
                 if ($categoryId != $meetingD->cat_id) {
                     $eventSkip = 1;
                 }
             }
             //If the user belongs to the excluded group, do not display public events, and if not a teacher.
             //Display event if the event only if the excluded group is assigned in the event.
             if ($userInExcludedGroup && $eventGroupIsInExGroup != true && $userIsTeacher != true) {
                 continue;
             } else {
             }
             if ($eventSkip || !$userAllowed) {
                 continue;
             }
             $bbbRecording["meetingid"] = $meetingD->meeting_id;
             $bbbRecording["meetingdbid"] = $meetingD->id;
             $bbbRecording["categoryid"] = $meetingD->cat_id;
             $bbbRecording["title"] = $meetingD->meetingName;
             $bbbRecording["description"] = $meetingD->meeting_description;
             $bbbRecording["display_time"] = $meetingD->display_time;
             $bbbRecordingsArr[] = $bbbRecording;
         }
     }
     //Sort By Date
     if ($bbbRecordingsArr) {
         $recordingsCount = count($bbbRecordingsArr) - 1;
         for ($counter = $recordingsCount; $counter >= 0; $counter--) {
             $meetingIds[] = $bbbRecordingsArr[$counter][meetingid];
         }
     }
     //Last Stop Here
     $implodedMeetingIds = implode('","', $meetingIds);
     $query = $db->getQuery(true)->select('id, meeting_id, recording_id, recording_title, recording_description, recording_url, start_time, end_time')->from($db->quoteName('#__bigbluebutton_recordings'))->where('meeting_id IN ("' . $implodedMeetingIds . '")');
     $query->order('start_time DESC');
     $db->setQuery($query);
     $bbbRecordingsResult = $db->loadObjectList();
     $recResult = array();
     foreach ($bbbRecordingsResult as $bbbRecs) {
         $query = $db->getQuery(true)->select('id, meeting_id, cat_id, meetingName, meeting_description, voiceBridge, maxParticipants, record, event_moderators, allowed_users, allowed_groups, display_time, start_time, end_time, all_moderator, event_isopen, duration, created')->from($db->quoteName('#__bigbluebutton_meetings'))->where('meeting_id = "' . $bbbRecs->meeting_id . '"');
         $db->setQuery($query);
         $res = $db->loadObject();
         $bbbRecs->display_time = $res->display_time;
         $bbbRecs->event_moderators = json_decode($res->event_moderators);
         $recResult[] = $bbbRecs;
     }
     return $recResult;
 }
Пример #7
0
 <?php 
/**
* @version		$Id:default.php 1 2015-03-05 16:31:34Z Jibon $
* @copyright	Copyright (C) 2015, Jibon Lawrence Costa. All rights reserved.
* @license 		http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', 'select');
require_once JPATH_ROOT . '/administrator/components/com_bbb/helpers/bbb.php';
$bbb = new BBBHelper();
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$archived = $this->state->get('filter.published') == 2 ? true : false;
$trashed = $this->state->get('filter.published') == -2 ? true : false;
$params = isset($this->state->params) ? $this->state->params : new JObject();
$saveOrder = $listOrder == 'ordering';
if ($saveOrder) {
    $saveOrderingUrl = 'index.php?option=com_bbb&task=meetings.saveOrderAjax&tmpl=component';
    JHtml::_('sortablelist.sortable', 'articleList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
}
$sortFields = $this->getSortFields();
?>

<script type="text/javascript">
	Joomla.orderTable = function()