Beispiel #1
0
 * @package     block_helpmenow
 * @copyright   2012 VLACS
 * @author      David Zaharee <*****@*****.**>
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/config.php';
require_once dirname(__FILE__) . '/lib.php';
require_login(0, false);
$test = optional_param('test', 0, PARAM_INT);
# make sure user is instructor or helper
$user = $DB->get_record('block_helpmenow_user', array('userid' => $USER->id));
$helper = $DB->get_records('block_helpmenow_helper', array('userid' => $USER->id));
if (!$user and !$helper) {
    helpmenow_fatal_error('You do not have permission to view this page.');
}
if (!($user2plugin = helpmenow_user2plugin_wiziq::get_user2plugin())) {
    helpmenow_fatal_error('No user2plugin');
}
if ($test) {
    if (!$user2plugin->verify_active_meeting(true)) {
        $user2plugin->create_meeting();
        # create meeting only if we don't have one
    }
    redirect($user2plugin->presenter_url);
}
$session_id = required_param('sessionid', PARAM_INT);
$reopen = optional_param('reopen', 0, PARAM_INT);
# verify sesion
if (!helpmenow_verify_session($session_id)) {
    helpmenow_fatal_error('You do not have permission to view this page.');
}
Beispiel #2
0
 public static function display($sessionid, $privileged = false)
 {
     global $CFG, $USER, $OUTPUT;
     if ($privileged) {
         $connect = new moodle_url("{$CFG->wwwroot}/blocks/helpmenow/plugins/wiziq/connect.php");
         $connect->param('sessionid', $sessionid);
         $action = new popup_action('click', $connect->out(), "wiziq", array('height' => 400, 'width' => 500));
         $output = $OUTPUT->action_link($connect->out(), 'Invite to WizIQ', $action);
         $user2plugin = helpmenow_user2plugin_wiziq::get_user2plugin();
         if ($user2plugin->verify_active_meeting(true)) {
             $connect->param('reopen', 1);
             $action = new popup_action('click', $connect->out(), "wiziq_session", array('height' => 400, 'width' => 500));
             $output .= ' | ' . $OUTPUT->action_link($connect->out(), 'Re-open WizIQ Window', $action);
         }
         return $output;
     }
     return '';
 }