Skip to content
Snippets Groups Projects
Select Git revision
  • 4ecd78f42b2dcc66f37b78142be7cb3ac08dddbe
  • master default protected
  • hsh_3.10
3 results

conntest.php

Blame
  • conntest.php 3.46 KiB
    <?php
    /**
     * @package mod
     * @subpackage adobeconnect
     * @author Akinsaya Delamarre (adelamarre@remote-learner.net)
     * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
     */
        //defined('MOODLE_INTERNAL') || die;
    
        require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
        require_once(dirname(__FILE__) . '/locallib.php');
        require_once(dirname(dirname(dirname(__FILE__))) . '/lib/accesslib.php');
    
        require_login(SITEID, false);
    
        global $USER, $CFG, $DB, $OUTPUT;
    
        $checkifempty = true; // Check for uninitialized variable
    
        $url = new moodle_url('/mod/adobeconnect/conntest.php');
        $PAGE->set_url($url);
    
        $admins = explode(',', $CFG->siteadmins);
    
        if (false === array_search($USER->id, $admins)) {
            print_error('error1', 'adobeconnect', $CFG->wwwroot);
        }
    
        $ac = new stdClass();
    
        $param = array('name' => 'adobeconnect_admin_login');
        $ac->login      = $DB->get_field('config', 'value', $param);
    
        $param = array('name' => 'adobeconnect_host');
        $ac->host       = $DB->get_field('config', 'value', $param);
    
        $param = array('name' => 'adobeconnect_port');
        $ac->port       = $DB->get_field('config', 'value', $param);
    
        $param = array('name' => 'adobeconnect_admin_password');
        $ac->pass       = $DB->get_field('config', 'value', $param);
    
        /* DFNVC */
        /* $param = array('name' => 'adobeconnect_admin_httpauth');
        $ac->httpauth   = $DB->get_field('config', 'value', $param);
        */
    
        $param = array('name' => 'adobeconnect_email_login');
        $ac->emaillogin = $DB->get_field('config', 'value', $param);
    
        $param = array('name' => 'adobeconnect_https');
        $ac->https = $DB->get_field('config', 'value', $param);
    
        foreach ($ac as $propertyname => $propertyvalue) {
    
            // Check if the property is equal to email login or https check boxes
            // These are the only values allowed to be empty
            $isnotemaillogin   = strcmp($propertyname, 'emaillogin');
            $isnothttps        = strcmp($propertyname, 'https');
    
            $checkifempty = $isnotemaillogin && $isnothttps;
    
            // If this property is empty
            if ($checkifempty and empty($propertyvalue)) {
                print_error('error2', 'adobeconnect', '', $propertyname);
                die();
            }
    
        }