diff --git a/README.md b/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..31634a5ee7efa603a45eda574eec2ab334d64f50
--- /dev/null
+++ b/README.md
@@ -0,0 +1,41 @@
+#DFNVC Moodle-Plugin (AdobeConnect FORK of Remote-Learner.net)
+$Id: README.txt,v 1.7 2011/01/03 16:54:40 adelamarre Exp $
+
+## ABOUT THIS ACTIVITY MODULE
+=========================================
+Adobe Systems Inc. and Remote-Learner.net have partnered together to create the first publicly available
+and officially sponsored, integration method between Moodle and Adobe Acrobat Connect Pro. This new
+integration is designed to simplify the use of synchronous events within Moodle. It provides a
+single-sign-on between the two systems with easy creation and management of Adobe Connect Pro
+meetings.
+
+About Remote-Learner
+Remote-Learner has been providing educational technologies services since 1982 to its business,
+educational and governmental clients. Today, these services include support for best-of-breed
+open source programs. Remote-Learner is an official Moodle partner, JasperSoft partner and
+Alfresco partner. The company offers SaaS hosting services, IT support contracts, custom
+programming, workforce development training, instructional design and strategic consulting
+services for organizations planning online learning programs.
+
+Visit https://moodle.org/plugins/view.php?plugin=mod_adobeconnect for information on Enterprise support.
+
+
+## INSTALL INSTRUCTIONS
+=========================================
+Please see the documentation on Moodle Docs http://docs.moodle.org/en/Remote_Learner_Adobe_Connect_Pro_Module.
+
+Create a directory called "adobeconnect" in your "mod" directory and copy all the files for this module into the "adobeconnect"
+directory.  Log in to your Moodle site as an administrator and click on the "notifications" link in the Adminsitration block and
+ensure all tables were setup correctly.
+
+You will then be prompted to enter details about Adobe Connect Pro server.  You may not see the 'Test Connection' button at first.  In the
+administrator block click on Modules -> Activities -> Adobe Connect and you should now see the 'Test Connection' button.
+Be sure to test your connection. 
+
+Once that is complete you can begin to create and administer meetings.
+
+
+Maintainer Contact information
+Company: Remote Learner
+Author: Akinsaya Delamarre
+Email: adelamarre@remote-learner.net
\ No newline at end of file
diff --git a/classes/event/adobeconnect_assign_role.php b/classes/event/adobeconnect_assign_role.php
new file mode 100644
index 0000000000000000000000000000000000000000..85b7072979d63b5b4da4a00de594af9d255e5225
--- /dev/null
+++ b/classes/event/adobeconnect_assign_role.php
@@ -0,0 +1,58 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package    mod_adobeconnect
+ * @author     Akinsaya Delamarre (adelamarre@remote-learner.net)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @copyright  (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
+ */
+
+namespace mod_adobeconnect\event;
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * The adobeconnect_assign_role event class.
+ *
+ * @property-read array $other {
+ *
+ *      User assigns a role.
+ * }
+ */
+class adobeconnect_assign_role extends \core\event\base {
+    /**
+     * This function initializes class properties.
+     */
+    protected function init() {
+        $this->data['crud'] = 'r';
+        $this->data['edulevel'] = self::LEVEL_PARTICIPATING;
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public static function get_name() {
+        return get_string('event_assign_role', 'mod_adobeconnect');
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public function get_description() {
+        return "User assigned the {$this->other['rolename']} role to a user.";
+    }
+}
\ No newline at end of file
diff --git a/classes/event/adobeconnect_join_meeting.php b/classes/event/adobeconnect_join_meeting.php
new file mode 100644
index 0000000000000000000000000000000000000000..0d809e5ce0ed0dc021712e80b7d8f998cad4f936
--- /dev/null
+++ b/classes/event/adobeconnect_join_meeting.php
@@ -0,0 +1,58 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package    mod_adobeconnect
+ * @author     Akinsaya Delamarre (adelamarre@remote-learner.net)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @copyright  (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
+ */
+
+namespace mod_adobeconnect\event;
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * The adobeconnect_join_meeting event class.
+ *
+ * @property-read array $other {
+ *
+ *      User joins meeting
+ * }
+ */
+class adobeconnect_join_meeting extends \core\event\base {
+    /**
+     * This function initializes class properties.
+     */
+    protected function init() {
+        $this->data['crud'] = 'r';
+        $this->data['edulevel'] = self::LEVEL_PARTICIPATING;
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public static function get_name() {
+        return get_string('event_join_meeting', 'mod_adobeconnect');
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public function get_description() {
+        return "User joined the meeting";
+    }
+}
\ No newline at end of file
diff --git a/classes/event/adobeconnect_unassign_role.php b/classes/event/adobeconnect_unassign_role.php
new file mode 100644
index 0000000000000000000000000000000000000000..80b5cfa1e82aced7dda92f5da9e4848fbcb37a11
--- /dev/null
+++ b/classes/event/adobeconnect_unassign_role.php
@@ -0,0 +1,58 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package    mod_adobeconnect
+ * @author     Akinsaya Delamarre (adelamarre@remote-learner.net)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @copyright  (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
+ */
+
+namespace mod_adobeconnect\event;
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * The adobeconnect_unassign_role event class.
+ *
+ * @property-read array $other {
+ *
+ *      User unassigns a role.
+ * }
+ */
+class adobeconnect_unassign_role extends \core\event\base {
+    /**
+     * This function initializes class properties.
+     */
+    protected function init() {
+        $this->data['crud'] = 'r';
+        $this->data['edulevel'] = self::LEVEL_PARTICIPATING;
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public static function get_name() {
+        return get_string('event_unassign_role', 'mod_adobeconnect');
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public function get_description() {
+        return "User unassigned the {$this->other['rolename']} meeting role.";
+    }
+}
\ No newline at end of file
diff --git a/classes/event/adobeconnect_view.php b/classes/event/adobeconnect_view.php
new file mode 100644
index 0000000000000000000000000000000000000000..7906c37848b811bf8ea772fccc9c7c9c1b981572
--- /dev/null
+++ b/classes/event/adobeconnect_view.php
@@ -0,0 +1,58 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package    mod_adobeconnect
+ * @author     Akinsaya Delamarre (adelamarre@remote-learner.net)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @copyright  (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
+ */
+
+namespace mod_adobeconnect\event;
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * The adobeconnect_view event class.
+ *
+ * @property-read array $other {
+ *
+ *      User views the activity.
+ * }
+ */
+class adobeconnect_view extends \core\event\base {
+    /**
+     * This function initializes class properties.
+     */
+    protected function init() {
+        $this->data['crud'] = 'r';
+        $this->data['edulevel'] = self::LEVEL_PARTICIPATING;
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public static function get_name() {
+        return get_string('event_view', 'mod_adobeconnect');
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public function get_description() {
+        return "Activity was viewed.";
+    }
+}
\ No newline at end of file
diff --git a/classes/event/adobeconnect_view_all.php b/classes/event/adobeconnect_view_all.php
new file mode 100644
index 0000000000000000000000000000000000000000..aa701beccae306467fb93cb44bbe92eb8ad8bde7
--- /dev/null
+++ b/classes/event/adobeconnect_view_all.php
@@ -0,0 +1,58 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package    mod_adobeconnect
+ * @author     Akinsaya Delamarre (adelamarre@remote-learner.net)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @copyright  (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
+ */
+
+namespace mod_adobeconnect\event;
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * The adobeconnect_view_all event class.
+ *
+ * @property-read array $other {
+ *
+ *      User views all activity instances.
+ * }
+ */
+class adobeconnect_view_all extends \core\event\base {
+    /**
+     * This function initializes class properties.
+     */
+    protected function init() {
+        $this->data['crud'] = 'r';
+        $this->data['edulevel'] = self::LEVEL_PARTICIPATING;
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public static function get_name() {
+        return get_string('event_view_all', 'mod_adobeconnect');
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public function get_description() {
+        return "All activity instances were viewed.";
+    }
+}
\ No newline at end of file
diff --git a/classes/event/adobeconnect_view_recording.php b/classes/event/adobeconnect_view_recording.php
new file mode 100644
index 0000000000000000000000000000000000000000..ce234d8dc4fa76c2e8bcfe9c6dd1ee0d346212dd
--- /dev/null
+++ b/classes/event/adobeconnect_view_recording.php
@@ -0,0 +1,58 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package    mod_adobeconnect
+ * @author     Akinsaya Delamarre (adelamarre@remote-learner.net)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @copyright  (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
+ */
+
+namespace mod_adobeconnect\event;
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * The adobeconnect_view_recording event class.
+ *
+ * @property-read array $other {
+ *
+ *      User views recording
+ * }
+ */
+class adobeconnect_view_recording extends \core\event\base {
+    /**
+     * This function initializes class properties.
+     */
+    protected function init() {
+        $this->data['crud'] = 'r';
+        $this->data['edulevel'] = self::LEVEL_PARTICIPATING;
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public static function get_name() {
+        return get_string('event_view_recording', 'mod_adobeconnect');
+    }
+
+    /**
+     * This function is overridden from the parent class.
+     */
+    public function get_description() {
+        return "User viewed recording.";
+    }
+}
\ No newline at end of file
diff --git a/db/access.php b/db/access.php
index febe859c8ecf1cdbbc6244767cab9cdabd943538..56ccf9d0e0c1b1fe84a7a7dfcba4e9532b355622 100644
--- a/db/access.php
+++ b/db/access.php
@@ -1,38 +1,55 @@
 <?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 /**
- * @package mod
- * @subpackage adobeconnect
- * @author Akinsaya Delamarre (adelamarre@remote-learner.net)
- * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package    mod_adobeconnect
+ * @author     Akinsaya Delamarre (adelamarre@remote-learner.net)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @copyright  (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
  */
-
-
 $capabilities = array(
-    'mod/adobeconnect:meetingpresenter' => array(
+    'mod/adobeconnect:addinstance' => array(
+        'riskbitmask' => RISK_XSS,
 
+        'captype' => 'write',
+        'contextlevel' => CONTEXT_COURSE,
+        'archetypes' => array(
+            'editingteacher' => CAP_ALLOW,
+            'manager' => CAP_ALLOW
+        ),
+        'clonepermissionsfrom' => 'moodle/course:manageactivities'
+    ),
+    'mod/adobeconnect:meetingpresenter' => array(
         'captype' => 'read',
         'contextlevel' => CONTEXT_MODULE,
         'archetypes' => array(
             'manager' => CAP_ALLOW
         )
     ),
-
     'mod/adobeconnect:meetingparticipant' => array(
-
         'captype' => 'read',
         'contextlevel' => CONTEXT_MODULE,
         'archetypes' => array(
             'manager' => CAP_ALLOW
         )
     ),
-
     'mod/adobeconnect:meetinghost' => array(
-
         'captype' => 'read',
         'contextlevel' => CONTEXT_MODULE,
         'archetypes' => array(
             'manager' => CAP_ALLOW
         )
     ),
-
 );
\ No newline at end of file
diff --git a/db/install.php b/db/install.php
index eb9830e7ee9a3fc9d0daf1f3605d6e63fa9e9b5c..f421fc80f91558d2e6d4bf14d1609ae759bc2961 100644
--- a/db/install.php
+++ b/db/install.php
@@ -1,211 +1,224 @@
-<?php
-// This file replaces:
-//   * STATEMENTS section in db/install.xml
-//   * lib.php/modulename_install() post installation hook
-//   * partially defaults.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
- */
-
-//
-// DFNconf - Workaround wegen Bug MDL-65668
-//
-function ac_assign_capability($capability, $permission, $roleid, $contextid, $overwrite = false) {
-    global $USER, $DB;
-
-    if ($contextid instanceof context) {
-        $context = $contextid;
-    } else {
-        $context = context::instance_by_id($contextid);
-    }
-
-    // Capability must exist.
-    //if (!$capinfo = get_capability_info($capability)) {
-    //    throw new coding_exception("Capability '{$capability}' was not found! This has to be fixed in code.");
-    //}
-
-    if (empty($permission) || $permission == CAP_INHERIT) { // if permission is not set
-        unassign_capability($capability, $roleid, $context->id);
-        return true;
-    }
-
-    $existing = $DB->get_record('role_capabilities', array('contextid'=>$context->id, 'roleid'=>$roleid, 'capability'=>$capability));
-
-    if ($existing and !$overwrite) {   // We want to keep whatever is there already
-        return true;
-    }
-
-    $cap = new stdClass();
-    $cap->contextid    = $context->id;
-    $cap->roleid       = $roleid;
-    $cap->capability   = $capability;
-    $cap->permission   = $permission;
-    $cap->timemodified = time();
-    $cap->modifierid   = empty($USER->id) ? 0 : $USER->id;
-
-    if ($existing) {
-        $cap->id = $existing->id;
-        $DB->update_record('role_capabilities', $cap);
-    } else {
-        if ($DB->record_exists('context', array('id'=>$context->id))) {
-            $DB->insert_record('role_capabilities', $cap);
-        }
-    }
-
-    // Reset any cache of this role, including MUC.
-    accesslib_clear_role_cache($roleid);
-
-    return true;
-}
-
-function xmldb_adobeconnect_install() {
-    global $DB;
-    
-    $result = true;
-    $timenow = time();
-    $sysctx  = context_system::instance();
-    $mrole = new stdClass();
-    $levels = array(CONTEXT_COURSECAT, CONTEXT_COURSE, CONTEXT_MODULE);
-
-    $param = array('shortname' => 'coursecreator');
-    $coursecreator = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
-    if (empty($coursecreator)) {
-        $param = array('archetype' => 'coursecreator');
-        $coursecreator = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
-    }
-    $coursecreatorrid = array_shift($coursecreator);
-
-    $param = array('shortname' =>'editingteacher');
-    $editingteacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
-    if (empty($editingteacher)) {
-        $param = array('archetype' => 'editingteacher');
-        $editingteacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
-    }
-    $editingteacherrid = array_shift($editingteacher);
-
-    $param = array('shortname' =>'teacher');
-    $teacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
-    if (empty($teacher)) {
-        $param = array('archetype' => 'teacher');
-        $teacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
-    }
-    $teacherrid = array_shift($teacher);
-
-    // Fully setup the Adobe Connect Presenter role.
-    $param = array('shortname' => 'adobeconnectpresenter');
-    if (!$mrole = $DB->get_record('role', $param)) {
-
-        if ($rid = create_role(get_string('adobeconnectpresenter', 'adobeconnect'), 'adobeconnectpresenter',
-                               get_string('adobeconnectpresenterdescription', 'adobeconnect'), 'adobeconnectpresenter')) {
-            $mrole = new stdClass();
-            $mrole->id = $rid;
-            $result = $result && ac_assign_capability('mod/adobeconnect:meetingpresenter', CAP_ALLOW, $mrole->id, $sysctx->id);
-            set_role_contextlevels($mrole->id, $levels);
-        } else {
-            $result = false;
-        }
-    }
-
-    if (isset($coursecreatorrid->id)) {
-        $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id);
-        if (!$DB->get_record('role_allow_assign', $param)) {
-            allow_assign($coursecreatorrid->id, $mrole->id);
-        }
-    }
-
-    if (isset($editingteacherrid->id)) {
-        $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id);
-        if (!$DB->get_record('role_allow_assign', $param)) {
-            allow_assign($editingteacherrid->id, $mrole->id);
-        }
-    }
-
-    if (isset($teacherrid->id)) {
-        $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id);
-        if (!$DB->get_record('role_allow_assign', $param)) {
-            allow_assign($teacherrid->id, $mrole->id);
-        }
-    }
-
-    // Fully setup the Adobe Connect Participant role.
-    $param = array('shortname' => 'adobeconnectparticipant');
-
-    if ($result && !($mrole = $DB->get_record('role', $param))) {
-
-        if ($rid = create_role(get_string('adobeconnectparticipant', 'adobeconnect'), 'adobeconnectparticipant',
-                               get_string('adobeconnectparticipantdescription', 'adobeconnect'), 'adobeconnectparticipant')) {
-
-            $mrole = new stdClass();
-            $mrole->id  = $rid;
-            $result = $result && ac_assign_capability('mod/adobeconnect:meetingparticipant', CAP_ALLOW, $mrole->id, $sysctx->id);
-            set_role_contextlevels($mrole->id, $levels);
-        } else {
-            $result = false;
-        }
-    }
-
-    if (isset($coursecreatorrid->id)) {
-        $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id);
-        if (!$DB->get_record('role_allow_assign', $param)) {
-            allow_assign($coursecreatorrid->id, $mrole->id);
-        }
-    }
-
-    if (isset($editingteacherrid->id)) {
-        $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id);
-        if (!$DB->get_record('role_allow_assign', $param)) {
-            allow_assign($editingteacherrid->id, $mrole->id);
-        }
-    }
-
-    if (isset($teacherrid->id)) {
-        $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id);
-        if (!$DB->get_record('role_allow_assign', $param)) {
-            allow_assign($teacherrid->id, $mrole->id);
-        }
-    }
-
-
-    // Fully setup the Adobe Connect Host role.
-    $param = array('shortname' => 'adobeconnecthost');
-    if ($result && !$mrole = $DB->get_record('role', $param)) {
-        if ($rid = create_role(get_string('adobeconnecthost', 'adobeconnect'), 'adobeconnecthost',
-                               get_string('adobeconnecthostdescription', 'adobeconnect'), 'adobeconnecthost')) {
-
-            $mrole = new stdClass();
-            $mrole->id  = $rid;
-            $result = $result && ac_assign_capability('mod/adobeconnect:meetinghost', CAP_ALLOW, $mrole->id, $sysctx->id);
-            set_role_contextlevels($mrole->id, $levels);
-        } else {
-            $result = false;
-        }
-    }
-
-    if (isset($coursecreatorrid->id)) {
-        $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id);
-        if (!$DB->get_record('role_allow_assign', $param)) {
-            allow_assign($coursecreatorrid->id, $mrole->id);
-        }
-    }
-
-    if (isset($editingteacherrid->id)) {
-        $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id);
-        if (!$DB->get_record('role_allow_assign', $param)) {
-            allow_assign($editingteacherrid->id, $mrole->id);
-        }
-    }
-
-    if (isset($teacherrid->id)) {
-        $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id);
-        if (!$DB->get_record('role_allow_assign', $param)) {
-            allow_assign($teacherrid->id, $mrole->id);
-        }
-    }
-
-    return $result;
-
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package    mod_adobeconnect
+ * @author     Akinsaya Delamarre (adelamarre@remote-learner.net)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @copyright  (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
+ */
+
+//
+// DFNconf - Workaround wegen Bug MDL-65668
+//
+function ac_assign_capability($capability, $permission, $roleid, $contextid, $overwrite = false) {
+    global $USER, $DB;
+
+    if ($contextid instanceof context) {
+        $context = $contextid;
+    } else {
+        $context = context::instance_by_id($contextid);
+    }
+
+    // Capability must exist.
+    //if (!$capinfo = get_capability_info($capability)) {
+    //    throw new coding_exception("Capability '{$capability}' was not found! This has to be fixed in code.");
+    //}
+
+    if (empty($permission) || $permission == CAP_INHERIT) { // if permission is not set
+        unassign_capability($capability, $roleid, $context->id);
+        return true;
+    }
+
+    $existing = $DB->get_record('role_capabilities', array('contextid'=>$context->id, 'roleid'=>$roleid, 'capability'=>$capability));
+
+    if ($existing and !$overwrite) {   // We want to keep whatever is there already
+        return true;
+    }
+
+    $cap = new stdClass();
+    $cap->contextid    = $context->id;
+    $cap->roleid       = $roleid;
+    $cap->capability   = $capability;
+    $cap->permission   = $permission;
+    $cap->timemodified = time();
+    $cap->modifierid   = empty($USER->id) ? 0 : $USER->id;
+
+    if ($existing) {
+        $cap->id = $existing->id;
+        $DB->update_record('role_capabilities', $cap);
+    } else {
+        if ($DB->record_exists('context', array('id'=>$context->id))) {
+            $DB->insert_record('role_capabilities', $cap);
+        }
+    }
+
+    // Reset any cache of this role, including MUC.
+    accesslib_clear_role_cache($roleid);
+
+    return true;
+}
+
+function xmldb_adobeconnect_install() {
+    global $DB;
+
+    // The commented out code is waiting for a fix for MDL-25709
+    $result = true;
+    $timenow = time();
+    $sysctx = context_system::instance();
+    $mrole = new stdClass();
+    $levels = array(CONTEXT_COURSECAT, CONTEXT_COURSE, CONTEXT_MODULE);
+
+    $param = array('shortname' => 'coursecreator');
+    $coursecreator = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
+    if (empty($coursecreator)) {
+        $param = array('archetype' => 'coursecreator');
+        $coursecreator = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
+    }
+    $coursecreatorrid = array_shift($coursecreator);
+
+    $param = array('shortname' =>'editingteacher');
+    $editingteacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
+    if (empty($editingteacher)) {
+        $param = array('archetype' => 'editingteacher');
+        $editingteacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
+    }
+    $editingteacherrid = array_shift($editingteacher);
+
+    $param = array('shortname' =>'teacher');
+    $teacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
+    if (empty($teacher)) {
+        $param = array('archetype' => 'teacher');
+        $teacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1);
+    }
+    $teacherrid = array_shift($teacher);
+
+    // Fully setup the Adobe Connect Presenter role.
+    $param = array('shortname' => 'adobeconnectpresenter');
+    if (!$mrole = $DB->get_record('role', $param)) {
+
+        if ($rid = create_role(get_string('adobeconnectpresenter', 'adobeconnect'), 'adobeconnectpresenter',
+                               get_string('adobeconnectpresenterdescription', 'adobeconnect'), 'adobeconnectpresenter')) {
+
+            $mrole = new stdClass();
+            $mrole->id = $rid;
+            $result = $result && ac_assign_capability('mod/adobeconnect:meetingpresenter', CAP_ALLOW, $mrole->id, $sysctx->id);
+
+            set_role_contextlevels($mrole->id, $levels);
+        } else {
+            $result = false;
+        }
+    }
+
+    if (isset($coursecreatorrid->id)) {
+        $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id);
+        if (!$DB->get_record('role_allow_assign', $param)) {            
+            core_role_set_assign_allowed($coursecreatorrid->id, $mrole->id);
+        }
+    }
+
+    if (isset($editingteacherrid->id)) {
+        $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id);
+        if (!$DB->get_record('role_allow_assign', $param)) {
+            core_role_set_assign_allowed($editingteacherrid->id, $mrole->id);
+        }
+    }
+
+    if (isset($teacherrid->id)) {
+        $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id);
+        if (!$DB->get_record('role_allow_assign', $param)) {
+            core_role_set_assign_allowed($teacherrid->id, $mrole->id);
+        }
+    }
+
+    // Fully setup the Adobe Connect Participant role.
+    $param = array('shortname' => 'adobeconnectparticipant');
+
+    if ($result && !($mrole = $DB->get_record('role', $param))) {
+
+        if ($rid = create_role(get_string('adobeconnectparticipant', 'adobeconnect'), 'adobeconnectparticipant',
+                               get_string('adobeconnectparticipantdescription', 'adobeconnect'), 'adobeconnectparticipant')) {
+
+            $mrole = new stdClass();
+            $mrole->id  = $rid;
+            $result = $result && ac_assign_capability('mod/adobeconnect:meetingparticipant', CAP_ALLOW, $mrole->id, $sysctx->id);
+            set_role_contextlevels($mrole->id, $levels);
+        } else {
+            $result = false;
+        }
+    }
+
+    if (isset($coursecreatorrid->id)) {
+        $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id);
+        if (!$DB->get_record('role_allow_assign', $param)) {
+            core_role_set_assign_allowed($coursecreatorrid->id, $mrole->id);
+        }
+    }
+
+    if (isset($editingteacherrid->id)) {
+        $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id);
+        if (!$DB->get_record('role_allow_assign', $param)) {
+            core_role_set_assign_allowed($editingteacherrid->id, $mrole->id);
+        }
+    }
+
+    if (isset($teacherrid->id)) {
+        $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id);
+        if (!$DB->get_record('role_allow_assign', $param)) {
+            core_role_set_assign_allowed($teacherrid->id, $mrole->id);
+        }
+    }
+
+
+    // Fully setup the Adobe Connect Host role.
+    $param = array('shortname' => 'adobeconnecthost');
+    if ($result && !$mrole = $DB->get_record('role', $param)) {
+        if ($rid = create_role(get_string('adobeconnecthost', 'adobeconnect'), 'adobeconnecthost',
+                               get_string('adobeconnecthostdescription', 'adobeconnect'), 'adobeconnecthost')) {
+
+            $mrole = new stdClass();
+            $mrole->id  = $rid;
+            $result = $result && ac_assign_capability('mod/adobeconnect:meetinghost', CAP_ALLOW, $mrole->id, $sysctx->id);
+            set_role_contextlevels($mrole->id, $levels);
+        } else {
+            $result = false;
+        }
+    }
+
+    if (isset($coursecreatorrid->id)) {
+        $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id);
+        if (!$DB->get_record('role_allow_assign', $param)) {
+            core_role_set_assign_allowed($coursecreatorrid->id, $mrole->id);
+        }
+    }
+
+    if (isset($editingteacherrid->id)) {
+        $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id);
+        if (!$DB->get_record('role_allow_assign', $param)) {
+            core_role_set_assign_allowed($editingteacherrid->id, $mrole->id);
+        }
+    }
+
+    if (isset($teacherrid->id)) {
+        $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id);
+        if (!$DB->get_record('role_allow_assign', $param)) {
+            core_role_set_assign_allowed($teacherrid->id, $mrole->id);
+        }
+    }
+
+    return $result;
+
 }
\ No newline at end of file
diff --git a/db/uninstall.php b/db/uninstall.php
index c24f3b231a68e1aad164642c6e87f12f1061ffce..76bbe16729d8b10d0833dec96f656f14ad6df69a 100644
--- a/db/uninstall.php
+++ b/db/uninstall.php
@@ -1,9 +1,24 @@
 <?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
 /**
- * @package mod
- * @subpackage adobeconnect
- * @author Akinsaya Delamarre (adelamarre@remote-learner.net)
- * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package    mod_adobeconnect
+ * @author     Akinsaya Delamarre (adelamarre@remote-learner.net)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @copyright  (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
  */
 
 function xmldb_adobeconnect_uninstall() {
diff --git a/db/upgrade.php b/db/upgrade.php
index e00b64ded30bc2d2f97dc1975aeda89ba1bec6ef..275a47118d3d51f774fd2ffd1391c75099a442b6 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -1,27 +1,24 @@
-<?php  //$Id: upgrade.php,v 1.7.2.1 2011/07/21 22:46:29 adelamarre Exp $
-
-// This file keeps track of upgrades to
-// the adobeconnect module
-//
-// Sometimes, changes between versions involve
-// alterations to database structures and other
-// major things that may break installations.
+<?php
+// This file is part of Moodle - http://moodle.org/
 //
-// The upgrade function in this file will attempt
-// to perform all the necessary actions to upgrade
-// your older installtion to the current version.
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
 //
-// If there's something it cannot do itself, it
-// will tell you what you need to do.
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
 //
-// The commands in here will all be database-neutral,
-// using the functions defined in lib/ddllib.php
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * @package mod
- * @subpackage adobeconnect
- * @author Akinsaya Delamarre (adelamarre@remote-learner.net)
- * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package    mod_adobeconnect
+ * @author     Akinsaya Delamarre (adelamarre@remote-learner.net)
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @copyright  (C) 2015 Remote Learner.net Inc http://www.remote-learner.net
  */
 
 function xmldb_adobeconnect_upgrade($oldversion=0) {
@@ -70,6 +67,19 @@ function xmldb_adobeconnect_upgrade($oldversion=0) {
         // adobeconnect savepoint reached
         upgrade_mod_savepoint(true, 2011041400, 'adobeconnect');
     }
+    
+    if ($oldversion < 2012012250) {
+        $table = new xmldb_table('adobeconnect');
+        $field = new xmldb_field('userid', XMLDB_TYPE_INTEGER, '10', true, true, null, 0, 'introformat');
+    
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+    
+        // adobeconnect savepoint reached
+        upgrade_mod_savepoint(true, 2012012500, 'adobeconnect');
+
+    }
 
     return true;
 
diff --git a/delrecording.php b/delrecording.php
index 0c7173d6f727bf77d21d7a0827bba30cd4952f91..be1408cd4579730edbe444da905dbbfe5df520a1 100644
--- a/delrecording.php
+++ b/delrecording.php
@@ -1,36 +1,36 @@
-<?php
-
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
-require_once(dirname(__FILE__).'/locallib.php');
-require_once(dirname(__FILE__).'/connect_class.php');
-require_once(dirname(__FILE__).'/connect_class_dom.php');
-
-$id         = required_param('id', PARAM_INT);
-$recordingscoid = required_param('recording', PARAM_INT);
-
-global $CFG, $USER, $DB, $PAGE, $OUTPUT;
-
-// Do the usual Moodle setup
-if (! $cm = get_coursemodule_from_id('adobeconnect', $id)) {
-    error('Course Module ID was incorrect');
-}
-$cond = array('id' => $cm->course);
-if (! $course = $DB->get_record('course', $cond)) {
-    error('Course is misconfigured');
-}
-
-$cond = array('id' => $cm->instance);
-if (! $adobeconnect = $DB->get_record('adobeconnect', $cond)) {
-    error('Course module is incorrect');
-}
-require_login($course, true, $cm);
-
-$context = context_module::instance($id);
-$user_is_host = has_capability('mod/adobeconnect:meetinghost', $context);
-
-if ($user_is_host) {
-    $aconnect = aconnect_login();
-    aconnect_remove_meeting($aconnect, $recordingscoid);
-}
-
+<?php
+
+require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
+require_once(dirname(__FILE__).'/locallib.php');
+require_once(dirname(__FILE__).'/connect_class.php');
+require_once(dirname(__FILE__).'/connect_class_dom.php');
+
+$id         = required_param('id', PARAM_INT);
+$recordingscoid = required_param('recording', PARAM_INT);
+
+global $CFG, $USER, $DB, $PAGE, $OUTPUT;
+
+// Do the usual Moodle setup
+if (! $cm = get_coursemodule_from_id('adobeconnect', $id)) {
+    error('Course Module ID was incorrect');
+}
+$cond = array('id' => $cm->course);
+if (! $course = $DB->get_record('course', $cond)) {
+    error('Course is misconfigured');
+}
+
+$cond = array('id' => $cm->instance);
+if (! $adobeconnect = $DB->get_record('adobeconnect', $cond)) {
+    error('Course module is incorrect');
+}
+require_login($course, true, $cm);
+
+$context = context_module::instance($id);
+$user_is_host = has_capability('mod/adobeconnect:meetinghost', $context);
+
+if ($user_is_host) {
+    $aconnect = aconnect_login();
+    aconnect_remove_meeting($aconnect, $recordingscoid);
+}
+
 redirect($CFG->wwwroot . '/mod/adobeconnect/view.php?id=' . $id);
\ No newline at end of file
diff --git a/index.php b/index.php
index 5f5587c4e2afb00f924699f2710c9a118f97ec6a..525465e849fb0023669aa4823aadc4936acd9588 100644
--- a/index.php
+++ b/index.php
@@ -25,7 +25,13 @@ if (! $course = $DB->get_record('course', $params)) {
 
 $PAGE->set_pagelayout('incourse');
 
-add_to_log($course->id, 'adobeconnect', 'view all', "index.php?id=$course->id", '');
+$params = array(
+    'relateduserid' => $USER->id,
+    'courseid' => $id,
+    'context' => context_course::instance($id),
+);
+$event = \mod_adobeconnect\event\adobeconnect_view_all::create($params);
+$event->trigger();
 
 
 /// Get all required strings
diff --git a/join.php b/join.php
index d164759a22ff8951dbfe3b64b2781c79c7109382..a6a72f190a18d5c060c9ba210a1eb95c5906e706 100644
--- a/join.php
+++ b/join.php
@@ -220,9 +220,14 @@ if ($usrcanjoin and confirm_sesskey($sesskey)) {
             $port = ':' . $CFG->adobeconnect_port;
         }
 
-        add_to_log($course->id, 'adobeconnect', 'join meeting',
-                   "join.php?id=$cm->id&groupid=$groupid&sesskey=$sesskey",
-                   "Joined $adobeconnect->name meeting", $cm->id);
+ // Trigger an event for joining a meeting.
+        $params = array(
+            'relateduserid' => $USER->id,
+            'courseid' => $course->id,
+            'context' => context_module::instance($id),
+        );
+        $event = \mod_adobeconnect\event\adobeconnect_join_meeting::create($params);
+        $event->trigger();
 	aconnect_logout($aconnect);
 
         redirect($protocol . $CFG->adobeconnect_meethost . $port
diff --git a/joinrecording.php b/joinrecording.php
index fcfec7794ca5f71c9555a029d5b2c22465425120..a682a43bd0f0172e2ddf48a52651b0d36c925b6d 100644
--- a/joinrecording.php
+++ b/joinrecording.php
@@ -1,219 +1,225 @@
-<?php // $Id: joinrecording.php,v 1.1.4.3 2011/08/09 14:01:50 adelamarre Exp $
-
-/**
- * The purpose of this file is to add a log entry when the user views a
- * recording
- *
- * @author  Your Name <adelamarre@remote-learner.net>
- * @version $Id: joinrecording.php,v 1.1.4.3 2011/08/09 14:01:50 adelamarre Exp $
- * @package mod/adobeconnect
- */
-
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
-require_once(dirname(__FILE__).'/locallib.php');
-require_once(dirname(__FILE__).'/connect_class.php');
-require_once(dirname(__FILE__).'/connect_class_dom.php');
-
-$id         = required_param('id', PARAM_INT);
-$groupid    = required_param('groupid', PARAM_INT);
-// DFNVC
-$recordingscoid = required_param('recording', PARAM_INT);
-$convert = optional_param('convert', null, PARAM_INT);
-$edit = optional_param('edit', null, PARAM_INT);
-
-global $CFG, $USER, $DB, $OUTPUT;
-
-// Do the usual Moodle setup
-if (! $cm = get_coursemodule_from_id('adobeconnect', $id)) {
-    error('Course Module ID was incorrect');
-}
-$cond = array('id' => $cm->course);
-if (! $course = $DB->get_record('course', $cond)) {
-    error('Course is misconfigured');
-}
-
-$cond = array('id' => $cm->instance);
-if (! $adobeconnect = $DB->get_record('adobeconnect', $cond)) {
-    error('Course module is incorrect');
-}
-
-require_login($course, true, $cm);
-
-// ---------- //
-
-
-// Get HTTPS setting
-$https      = false;
-$protocol   = 'http://';
-if (isset($CFG->adobeconnect_https) and (!empty($CFG->adobeconnect_https))) {
-    $https      = true;
-    $protocol   = 'https://';
-}
-
-// Create a Connect Pro login session for this user
-$usrobj = new stdClass();
-$usrobj = clone($USER);
-
-if (isset($CFG->adobeconnect_email_login) and !empty($CFG->adobeconnect_email_login)) {
-    $usrobj->username = $usrobj->email;
-}
-$login  = $usrobj->username;
-
-
-//$aconnect = new connect_class_dom($CFG->adobeconnect_host, $CFG->adobeconnect_port,
-//                                  '', '', '', $https);
-$aconnect   = aconnect_login();
-//$aconnect->request_http_header_login(1, $login);
-//$adobesession = $aconnect->get_cookie();
-$user_session_cookie = $aconnect->user_session_cookie($login);
-aconnect_logout($aconnect);
-
-
-$params = array('instanceid' => $cm->instance, 'groupid' => $groupid);
-$sql = "SELECT meetingscoid FROM {adobeconnect_meeting_groups} amg WHERE ".
-       "amg.instanceid = :instanceid AND amg.groupid = :groupid";
-
-
-//$meetscoids = $DB->get_record_sql($sql, $params);
-$meetscoid = $DB->get_record_sql($sql, $params);
-
-//
-// DFNVC
-// In order to access recordings, users have to be affiliated to the meetings
-// participant list even if they have not attended the meeting before.
-//
-$usrprincipal = 0;
-$validuser = true;
-$groupobj = groups_get_group($groupid);
-
-// Get the meeting sco-id
-$param = array('instanceid' => $cm->instance, 'groupid' => $groupid);
-$meetingscoid = $DB->get_field('adobeconnect_meeting_groups', 'meetingscoid', $param);
-
-$aconnect = aconnect_login();
-
-// Check if the meeting still exists on the Adobe server
-$meetfldscoid = aconnect_get_meeting_folder($aconnect);
-
-$filter = array('filter-sco-id' => $meetingscoid);
-$meeting = aconnect_meeting_exists($aconnect, $meetfldscoid, $filter);
-
-if (!empty($meeting)) {
-    $meeting = current($meeting);
-}
-
-if (!($usrprincipal = lms_user_exists($aconnect, $usrobj))) {
-    if (!($usrprincipal = aconnect_create_user($aconnect, $usrobj))) {
-        print_object("error creating user");
-        print_object($aconnect->_xmlresponse);
-        $validuser = false;
-    }
-}
-
-$context = get_context_instance(CONTEXT_MODULE, $id);
-
-if (!empty($meetscoid) and !empty($usrprincipal) and !empty($meeting)) {
-    if (has_capability('mod/adobeconnect:meetinghost', $context, $usrobj->id, false)) {
-        if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_HOST, true)) {
-        } else {
-            print_object('error assign user adobe host role');
-            print_object($usrprincipal);
-            print_object($meetingscoid);
-            print_object($aconnect->_xmlrequest);
-            print_object($aconnect->_xmlresponse);
-            $validuser = false;
-        }
-    } elseif (has_capability('mod/adobeconnect:meetingpresenter', $context, $usrobj->id, false)) {
-        if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PRESENTER, true)) {
-        } else {
-            print_object('error assign user adobe presenter role');
-            print_object($aconnect->_xmlrequest);
-                print_object($aconnect->_xmlresponse);
-                $validuser = false;
-        }
-    } elseif (has_capability('mod/adobeconnect:meetingparticipant', $context, $usrobj->id, false)) {
-        if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PARTICIPANT, true)) {
-        } else {
-            print_object('error assign user adobe particpant role');
-            print_object($aconnect->_xmlrequest);
-            print_object($aconnect->_xmlresponse);
-                $validuser = false;
-        }
-    } else {
-        // Check if meeting is public and allow them to join
-        if ($adobeconnect->meetingpublic) {
-            // if for a public meeting the user does not not have either of presenter or participant capabilities then give
-            // the user the participant role for the meeting
-            aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PARTICIPANT, true);
-            $validuser = true;
-        } else {
-            $validuser = false;
-        }
-    }
-} else {
-    $validuser = false;
-    notice(get_string('unableretrdetails', 'adobeconnect'));
-}
-
-//
-// DFNVC END
-//
-
-
-// Get the Meeting recording details
-$aconnect   = aconnect_login();
-$recording  = array();
-$fldid      = aconnect_get_folder($aconnect, 'content');
-
-//$data = aconnect_get_recordings($aconnect, $fldid, $meetscoid->meetingscoid);
-$data = '';
-
-if (!empty($data)) {
-    $recording = $data;
-}
-
-// If at first you don't succeed ...
-$data2 = aconnect_get_recordings($aconnect, $meetscoid->meetingscoid, $meetscoid->meetingscoid);
-
-if (!empty($data2)) {
-     $recording[] = $data2;
-}
-
-//
-// DFNconf
-//
-$meetfldscoid = aconnect_get_meeting_folder($aconnect);
-
-$recordingurlpath = aconnect_get_recording_urlpath($aconnect, $meetscoid->meetingscoid, $recordingscoid);
-
-if (empty($recordingurlpath) and confirm_sesskey()) {
-    echo $OUTPUT->header();
-    echo '<p>&nbsp;<p>';
-    echo $OUTPUT->notification('Aufzeichnung wurde auf dem DFNconf Meeting-Server <b>' . $CFG->adobeconnect_meethost . '</b> nicht gefunden !');
-    echo $OUTPUT->footer();
-    return;
-}
-aconnect_logout($aconnect);
-
-add_to_log($course->id, 'adobeconnect', 'view',
-           "view.php?id=$cm->id", "View recording {$adobeconnect->name} details", $cm->id);
-
-// Include the port number only if it is a port other than 80
-$port = '';
-
-if (!empty($CFG->adobeconnect_port) and (80 != $CFG->adobeconnect_port)) {
-    $port = ':' . $CFG->adobeconnect_port;
-}
-
-//
-// DFNconf
-//
-if ($convert == 'true') {
-    redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?pbMode=offline&session=' . $user_session_cookie);
-}
-elseif ($edit == 'true') {
-    redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?pbMode=edit&session=' . $user_session_cookie);
-}
-else {
-    redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?session=' . $user_session_cookie);
-}
+<?php // $Id: joinrecording.php,v 1.1.4.3 2011/08/09 14:01:50 adelamarre Exp $
+
+/**
+ * The purpose of this file is to add a log entry when the user views a
+ * recording
+ *
+ * @author  Your Name <adelamarre@remote-learner.net>
+ * @version $Id: joinrecording.php,v 1.1.4.3 2011/08/09 14:01:50 adelamarre Exp $
+ * @package mod/adobeconnect
+ */
+
+require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
+require_once(dirname(__FILE__).'/locallib.php');
+require_once(dirname(__FILE__).'/connect_class.php');
+require_once(dirname(__FILE__).'/connect_class_dom.php');
+
+$id         = required_param('id', PARAM_INT);
+$groupid    = required_param('groupid', PARAM_INT);
+// DFNVC
+$recordingscoid = required_param('recording', PARAM_INT);
+$convert = optional_param('convert', null, PARAM_INT);
+$edit = optional_param('edit', null, PARAM_INT);
+
+global $CFG, $USER, $DB, $OUTPUT;
+
+// Do the usual Moodle setup
+if (! $cm = get_coursemodule_from_id('adobeconnect', $id)) {
+    error('Course Module ID was incorrect');
+}
+$cond = array('id' => $cm->course);
+if (! $course = $DB->get_record('course', $cond)) {
+    error('Course is misconfigured');
+}
+
+$cond = array('id' => $cm->instance);
+if (! $adobeconnect = $DB->get_record('adobeconnect', $cond)) {
+    error('Course module is incorrect');
+}
+
+require_login($course, true, $cm);
+
+// ---------- //
+
+
+// Get HTTPS setting
+$https      = false;
+$protocol   = 'http://';
+if (isset($CFG->adobeconnect_https) and (!empty($CFG->adobeconnect_https))) {
+    $https      = true;
+    $protocol   = 'https://';
+}
+
+// Create a Connect Pro login session for this user
+$usrobj = new stdClass();
+$usrobj = clone($USER);
+
+if (isset($CFG->adobeconnect_email_login) and !empty($CFG->adobeconnect_email_login)) {
+    $usrobj->username = $usrobj->email;
+}
+$login  = $usrobj->username;
+
+
+//$aconnect = new connect_class_dom($CFG->adobeconnect_host, $CFG->adobeconnect_port,
+//                                  '', '', '', $https);
+$aconnect   = aconnect_login();
+//$aconnect->request_http_header_login(1, $login);
+//$adobesession = $aconnect->get_cookie();
+$user_session_cookie = $aconnect->user_session_cookie($login);
+aconnect_logout($aconnect);
+
+
+$params = array('instanceid' => $cm->instance, 'groupid' => $groupid);
+$sql = "SELECT meetingscoid FROM {adobeconnect_meeting_groups} amg WHERE ".
+       "amg.instanceid = :instanceid AND amg.groupid = :groupid";
+
+
+//$meetscoids = $DB->get_record_sql($sql, $params);
+$meetscoid = $DB->get_record_sql($sql, $params);
+
+//
+// DFNVC
+// In order to access recordings, users have to be affiliated to the meetings
+// participant list even if they have not attended the meeting before.
+//
+$usrprincipal = 0;
+$validuser = true;
+$groupobj = groups_get_group($groupid);
+
+// Get the meeting sco-id
+$param = array('instanceid' => $cm->instance, 'groupid' => $groupid);
+$meetingscoid = $DB->get_field('adobeconnect_meeting_groups', 'meetingscoid', $param);
+
+$aconnect = aconnect_login();
+
+// Check if the meeting still exists on the Adobe server
+$meetfldscoid = aconnect_get_meeting_folder($aconnect);
+
+$filter = array('filter-sco-id' => $meetingscoid);
+$meeting = aconnect_meeting_exists($aconnect, $meetfldscoid, $filter);
+
+if (!empty($meeting)) {
+    $meeting = current($meeting);
+}
+
+if (!($usrprincipal = lms_user_exists($aconnect, $usrobj))) {
+    if (!($usrprincipal = aconnect_create_user($aconnect, $usrobj))) {
+        print_object("error creating user");
+        print_object($aconnect->_xmlresponse);
+        $validuser = false;
+    }
+}
+
+$context = get_context_instance(CONTEXT_MODULE, $id);
+
+if (!empty($meetscoid) and !empty($usrprincipal) and !empty($meeting)) {
+    if (has_capability('mod/adobeconnect:meetinghost', $context, $usrobj->id, false)) {
+        if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_HOST, true)) {
+        } else {
+            print_object('error assign user adobe host role');
+            print_object($usrprincipal);
+            print_object($meetingscoid);
+            print_object($aconnect->_xmlrequest);
+            print_object($aconnect->_xmlresponse);
+            $validuser = false;
+        }
+    } elseif (has_capability('mod/adobeconnect:meetingpresenter', $context, $usrobj->id, false)) {
+        if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PRESENTER, true)) {
+        } else {
+            print_object('error assign user adobe presenter role');
+            print_object($aconnect->_xmlrequest);
+                print_object($aconnect->_xmlresponse);
+                $validuser = false;
+        }
+    } elseif (has_capability('mod/adobeconnect:meetingparticipant', $context, $usrobj->id, false)) {
+        if (aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PARTICIPANT, true)) {
+        } else {
+            print_object('error assign user adobe particpant role');
+            print_object($aconnect->_xmlrequest);
+            print_object($aconnect->_xmlresponse);
+                $validuser = false;
+        }
+    } else {
+        // Check if meeting is public and allow them to join
+        if ($adobeconnect->meetingpublic) {
+            // if for a public meeting the user does not not have either of presenter or participant capabilities then give
+            // the user the participant role for the meeting
+            aconnect_check_user_perm($aconnect, $usrprincipal, $meetingscoid, ADOBE_PARTICIPANT, true);
+            $validuser = true;
+        } else {
+            $validuser = false;
+        }
+    }
+} else {
+    $validuser = false;
+    notice(get_string('unableretrdetails', 'adobeconnect'));
+}
+
+//
+// DFNVC END
+//
+
+
+// Get the Meeting recording details
+$aconnect   = aconnect_login();
+$recording  = array();
+$fldid      = aconnect_get_folder($aconnect, 'content');
+
+//$data = aconnect_get_recordings($aconnect, $fldid, $meetscoid->meetingscoid);
+$data = '';
+
+if (!empty($data)) {
+    $recording = $data;
+}
+
+// If at first you don't succeed ...
+$data2 = aconnect_get_recordings($aconnect, $meetscoid->meetingscoid, $meetscoid->meetingscoid);
+
+if (!empty($data2)) {
+     $recording[] = $data2;
+}
+
+//
+// DFNconf
+//
+$meetfldscoid = aconnect_get_meeting_folder($aconnect);
+
+$recordingurlpath = aconnect_get_recording_urlpath($aconnect, $meetscoid->meetingscoid, $recordingscoid);
+
+if (empty($recordingurlpath) and confirm_sesskey()) {
+    echo $OUTPUT->header();
+    echo '<p>&nbsp;<p>';
+    echo $OUTPUT->notification('Aufzeichnung wurde auf dem DFNconf Meeting-Server <b>' . $CFG->adobeconnect_meethost . '</b> nicht gefunden !');
+    echo $OUTPUT->footer();
+    return;
+}
+aconnect_logout($aconnect);
+
+// Trigger an event for viewing a recording.
+$params = array(
+    'relateduserid' => $USER->id,
+    'courseid' => $course->id,
+    'context' => context_module::instance($id),
+);
+$event = \mod_adobeconnect\event\adobeconnect_view_recording::create($params);
+$event->trigger();
+
+// Include the port number only if it is a port other than 80
+$port = '';
+
+if (!empty($CFG->adobeconnect_port) and (80 != $CFG->adobeconnect_port)) {
+    $port = ':' . $CFG->adobeconnect_port;
+}
+
+//
+// DFNconf
+//
+if ($convert == 'true') {
+    redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?pbMode=offline&session=' . $user_session_cookie);
+}
+elseif ($edit == 'true') {
+    redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?pbMode=edit&session=' . $user_session_cookie);
+}
+else {
+    redirect($protocol . $CFG->adobeconnect_meethost . $port . $recordingurlpath . '?session=' . $user_session_cookie);
+}
diff --git a/lang/de/help/adobeconnect/meeturl.html b/lang/de/help/adobeconnect/meeturl.html
index 08e18eaa116e9b289ad1d3ca2d56c33c18bd4de0..f54339582881c01a8a6808a6f465f70b9c17d27c 100644
--- a/lang/de/help/adobeconnect/meeturl.html
+++ b/lang/de/help/adobeconnect/meeturl.html
@@ -1,6 +1,6 @@
-<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp;<b>Meeting URL</b></p>
-<div class="indent">
-<p>Sie können die URL anpassen, die für das Adobe Connect Meeting verwendet werden soll.
-Die Server-Domain bleibt immer die gleiche. Der letzte Teil der URL kann angepasst werden.
-</p>
-</div>
+<p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/adobeconnect/pix/icon.svg" />&nbsp;<b>Meeting URL</b></p>
+<div class="indent">
+<p>Sie können die URL anpassen, die für das Adobe Connect Meeting verwendet werden soll.
+Die Server-Domain bleibt immer die gleiche. Der letzte Teil der URL kann angepasst werden.
+</p>
+</div>
diff --git a/lib.php b/lib.php
index 5e6a05a6436fc180965376a9a5fdde29a485d1d2..2e6d7451672bacaeae4785ad1cb0e7ef45c42f4d 100644
--- a/lib.php
+++ b/lib.php
@@ -426,12 +426,12 @@ function adobeconnect_delete_instance($id) {
     $meetingscoid = $DB->get_field('adobeconnect_meeting_groups', 'meetingscoid',$param);
 
     $aconnect = aconnect_login();
-    if (aconnect_get_recordings($aconnect, $meetingscoid, $meetingscoid)) {
+   /* if (aconnect_get_recordings($aconnect, $meetingscoid, $meetingscoid)) {
         $delerror = get_string('recording_error','adobeconnect');
         print_error($delerror,' ');
         aconnect_logout($aconnect);        
         return false;        
-    }
+    }*/
 
     $result = true;
     if (!empty($adbmeetings)) {
diff --git a/mod_form.php b/mod_form.php
index 1d24e5db9ce26fac12663503b6eec8d81de601be..f37e2992611ccc01eb20bcacca10f51fd6453926 100644
--- a/mod_form.php
+++ b/mod_form.php
@@ -35,7 +35,8 @@ class mod_adobeconnect_mod_form extends moodleform_mod {
         $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
 
         /// Adding the required "intro" field to hold the description of the instance
-        $this->add_intro_editor(false, get_string('adobeconnectintro', 'adobeconnect'));
+        $this->standard_intro_elements(get_string('adobeconnectintro', 'adobeconnect'));
+
 
 //        $mform->addElement('htmleditor', 'intro', get_string('adobeconnectintro', 'adobeconnect'));
 //        $mform->setType('intro', PARAM_RAW);
diff --git a/participants.php b/participants.php
index efb8626212ea17da7db9a39329d2ebaf5040d5dc..f2c4c1b0ac32745052741b9a22314649fe7a21d8 100644
--- a/participants.php
+++ b/participants.php
@@ -101,20 +101,30 @@ if ($roleid) {
     if (optional_param('add', false, PARAM_BOOL) && confirm_sesskey()) {
         $userstoassign = $potentialuserselector->get_selected_users();
         if (!empty($userstoassign)) {
-
+			$rolename = $assignableroles[$roleid];
+            // Trigger an event for joining a meeting.
+            $params = array(
+                'courseid' => $course->id,
+                'context' => context_module::instance($cm->id),
+                'other' => array(
+                    'rolename' => $rolename
+                )
+            );
             foreach ($userstoassign as $adduser) {
                 $allow = true;
 
                 if ($allow) {
                     role_assign($roleid, $adduser->id, $context->id);
+					
+					$params['relateduserid'] = $adduser->id;
+                    $event = \mod_adobeconnect\event\adobeconnect_assign_role::create($params);
+                    $event->trigger();
                 }
             }
 
             $potentialuserselector->invalidate_selected_users();
             $currentuserselector->invalidate_selected_users();
 
-            $rolename = $assignableroles[$roleid];
-            add_to_log($course->id, 'role', 'assign', 'mod/adobeconnect/participant.php?contextid='.$context->id.'&roleid='.$roleid, $rolename, '', $USER->id);
             // Counts have changed, so reload.
             list($assignableroles, $assigncounts, $nameswithcounts) = get_assignable_roles($context, ROLENAME_BOTH, true);
         }
@@ -124,17 +134,29 @@ if ($roleid) {
     if (optional_param('remove', false, PARAM_BOOL) && confirm_sesskey()) {
         $userstounassign = $currentuserselector->get_selected_users();
         if (!empty($userstounassign)) {
-
+			
+			$rolename = $assignableroles[$roleid];
+            // Trigger an event for joining a meeting.
+            $params = array(
+                'courseid' => $course->id,
+                'context' => context_module::instance($cm->id),
+                'other' => array(
+                    'rolename' => $rolename
+                )
+            );
+			
             foreach ($userstounassign as $removeuser) {
                 //unassign only roles that are added manually, no messing with other components!!!
                 role_unassign($roleid, $removeuser->id, $context->id, '');
+				
+				$params['relateduserid'] = $removeuser->id;
+                $event = \mod_adobeconnect\event\adobeconnect_unassign_role::create($params);
+                $event->trigger();
             }
 
             $potentialuserselector->invalidate_selected_users();
             $currentuserselector->invalidate_selected_users();
 
-            $rolename = $assignableroles[$roleid];
-            add_to_log($course->id, 'role', 'unassign', 'mod/adobeconnect/participant.php?contextid='.$context->id.'&roleid='.$roleid, $rolename, '', $USER->id);
             // Counts have changed, so reload.
             list($assignableroles, $assigncounts, $nameswithcounts) = get_assignable_roles($context, ROLENAME_BOTH, true);
         }
diff --git a/pix/icon.gif b/pix/icon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..81f87aea9b06280ef5a970e8cc3bbebd276f38fb
Binary files /dev/null and b/pix/icon.gif differ
diff --git a/view.php b/view.php
index c5f9d4de2ee3e33278aaa1f1754206c70f1c4138..de3baaed7881f9a50edc7b505137b2c6fbd9af32 100644
--- a/view.php
+++ b/view.php
@@ -440,9 +440,13 @@ if ($showrecordings and !empty($recordings)) {
 
     echo $OUTPUT->box_end();
 }
-
-add_to_log($course->id, 'adobeconnect', 'view',
-           "view.php?id=$cm->id", "View {$adobeconnect->name} details", $cm->id);
-
+// Trigger an event for joining a meeting.
+$params = array(
+    'relateduserid' => $USER->id,
+    'courseid' => $course->id,
+    'context' => context_module::instance($cm->id)
+);
+$event = \mod_adobeconnect\event\adobeconnect_view::create($params);
+$event->trigger();
 /// Finish the page
 echo $OUTPUT->footer();