$account_link = (object) null;
        $account_link->external_id = $moodleid;
        $account_link->internal_id = $mbuser;
        $account_link->system = "moodle";
        insert_record("studynotes_account_links", $account_link, false);
    } else {
        error(get_string('error_linking', 'studynotes'));
    }
}
$auth = new MediabirdMoodleAuth($mbuser);
//set up config
MediabirdConfig::$latex_path = $CFG->studynotes_latex_path;
MediabirdConfig::$convert_path = $CFG->studynotes_dvipng_path;
//set up proxy
if (isset($CFG->proxyhost) && strlen($CFG->proxyhost) > 0 && (!isset($CFG->proxytype) || $CFG->proxytype == 'HTTP')) {
    MediabirdConfig::$proxy_address = $CFG->proxyhost;
    MediabirdConfig::$proxy_port = $CFG->proxyport;
}
MediabirdConfig::$uploads_folder = $CFG->dataroot . DIRECTORY_SEPARATOR . "1" . DIRECTORY_SEPARATOR . "moddata" . DIRECTORY_SEPARATOR . "studynotes" . DIRECTORY_SEPARATOR . "uploads" . DIRECTORY_SEPARATOR;
if (!file_exists(MediabirdConfig::$uploads_folder . $auth->userId)) {
    make_mod_upload_directory(1);
    make_upload_directory("1/moddata/studynotes/uploads/" . $auth->userId);
    // we store our images in a subfolder in here
}
MediabirdConfig::$cache_folder = $CFG->dataroot . DIRECTORY_SEPARATOR . "temp" . DIRECTORY_SEPARATOR . "studynotes" . DIRECTORY_SEPARATOR;
if (!file_exists(MediabirdConfig::$cache_folder)) {
    make_upload_directory("temp/studynotes");
}
if (isset($action)) {
    if ($action == "changePass" || $action == "deleteAccount") {
        exit;
Exemplo n.º 2
0
if ( isset($environment) ) {
   $c_send_email = $environment->getConfiguration('c_send_email');
   if (isset ($c_send_email)) {
      if ($c_send_email) {
         MediabirdConfig :: $disable_mail = false;
      } else {
         MediabirdConfig :: $disable_mail = true;
      }
   } else {
      MediabirdConfig :: $disable_mail = false;
   }
} else {
   MediabirdConfig :: $disable_mail = false;
}

// proxy: address and port
if ( isset($environment) ) {
   $c_proxy_ip = $environment->getConfiguration('c_proxy_ip');
   $c_proxy_port = $environment->getConfiguration('c_proxy_port');
   if ( isset($c_proxy_ip)
        and !empty($c_proxy_ip)
      ) {
      MediabirdConfig :: $proxy_address = $c_proxy_ip;
      if ( isset($c_proxy_port)
           and !empty($c_proxy_port)
         ) {
         MediabirdConfig :: $proxy_port = $c_proxy_port;
      }
   }
}
?>