Beispiel #1
0
 function moodle_annotation_service($userid)
 {
     global $CFG;
     // Note: Cross-site request forgery protection requires cookies, so it will not be
     // activated if $CFG->usesid=true
     $csrfprotect = !empty($CFG->usesid) && $CFG->usesid;
     AnnotationService::AnnotationService(annotation_globals::get_host(), annotation_globals::get_service_path(), annotation_globals::get_install_date(), $userid, array('baseUrl' => $CFG->wwwroot, 'csrfCookie' => $csrfprotect ? null : 'MoodleSessionTest' . $CFG->sessioncookie, 'csrfCookieValue' => $csrfprotect ? null : $_SESSION['SESSION']->session_test));
     $this->tablePrefix = $CFG->prefix;
 }
 function OjsAnnotationService()
 {
     $servicePath = Request::getRequestUrl();
     $host = Request::getServerHost();
     // Get install date.  Seems to produce 1969-12-31
     $versionDao =& DAORegistry::getDAO('VersionDAO');
     $versions =& $versionDao->getVersionHistory();
     $firstVersion = array_pop($versions);
     $installDate = $firstVersion->getDateInstalled();
     $installDate = strtotime($installDate);
     $username = Request::getUser();
     if ($username) {
         $username = $username->getUsername();
     }
     $sessionManager =& SessionManager::getManager();
     $session = $sessionManager->getUserSession();
     AnnotationService::AnnotationService($host, $servicePath, $installDate, $username, array('csrfCookie' => Config::getVar('general', 'session_cookie_name'), 'csrfCookieValue' => $session->getId()));
 }
Beispiel #3
0
 function moodle_annotation_service($userid, $extService = null)
 {
     global $CFG;
     $this->extService = $extService;
     // Note: Cross-site request forgery protection requires cookies, so it will not be
     // activated if $CFG->usesid=true
     $csrfprotect = !empty($CFG->usesid) && $CFG->usesid;
     $cookiename = 'MoodleSession' . $CFG->sessioncookie;
     // was MoodleSessionTest.
     $cookievalue = $_COOKIE[$cookiename];
     //$_SESSION['SESSION']->session_test;
     $moodlemia = moodle_marginalia::get_instance();
     AnnotationService::AnnotationService($moodlemia->get_host(), $moodlemia->get_service_path(), $moodlemia->get_install_date(), $userid, array('baseUrl' => $CFG->wwwroot, 'csrfCookie' => $csrfprotect ? null : $cookiename, 'csrfCookieValue' => $csrfprotect ? null : $cookievalue, 'noPutDelete' => true));
 }
Beispiel #4
0
 function DemoAnnotationService()
 {
     global $CFG;
     $curuser = array_key_exists('curuser', $_GET) ? $_GET['curuser'] : '******';
     AnnotationService::AnnotationService($CFG->host, $CFG->annotate_servicePath, $CFG->installDate, $curuser);
 }
Beispiel #5
0
 function MoodleAnnotationService($username)
 {
     global $CFG;
     AnnotationService::AnnotationService(AnnotationGlobals::getHost(), AnnotationGlobals::getServicePath(), AnnotationGlobals::getInstallDate(), $username, $CFG->wwwroot);
     $this->tablePrefix = $CFG->prefix;
 }