if (isset($datum) && !is_numeric($datum)) { die('Datum ist ungueltig'); } if (!check_ort($ort_kurzbz)) { die('Ort ist ungueltig'); } $berechtigung = new benutzerberechtigung(); $berechtigung->getBerechtigungen($uid); if ($berechtigung->isBerechtigt('lehre/reservierung:begrenzt', null, 'sui')) { $raumres = true; } else { $raumres = false; } unset($berechtigung); // Authentifizierung if (check_student($uid)) { $user = '******'; } elseif (check_lektor($uid)) { $user = '******'; } else { die($p->t('global/userNichtGefunden')); //GastAccountHack //$user='******'; } // User bestimmen if (!isset($type)) { $type = $user; } if (!isset($pers_uid)) { $pers_uid = $uid; }
* * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * Authors: Karl Burkhart <*****@*****.**>. */ /** * Testclient für Lehrveranstaltung Webservice */ require_once '../config/vilesci.config.inc.php'; require_once '../include/functions.inc.php'; require_once '../include/basis_db.class.php'; $method = isset($_GET['method']) ? $_GET['method'] : 'studiengang'; $getuid = get_uid(); if (!check_lektor($getuid) && !check_student($getuid)) { die('Sie haben keine Berechtigung für diese Seite'); } $db = new basis_db(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script type="text/javascript" src="../include/js/jqSOAPClient.js"></script> <script type="text/javascript" src="../include/js/jquery.js"></script> <script type="text/javascript" src="../include/js/jqXMLUtils.js"></script> <title>SOAP TestClient für Lehrveranstaltungen</title> </head> <body> <h1>Lehrveranstaltung Webservice</h1> Liefert Informationen über Lehrveranstaltungen
} } if ($outgoing->save()) { $message = '<span class="ok">Erfolgreich gespeichert</span>'; } else { $message = '<span class="error">Es ist ein Fehler beim Speichern aufgetreten</span>'; } } if (isset($_POST['StatusSetzen'])) { $status = $_POST['status']; $preoutgoing = new preoutgoing(); $preoutgoing->load($preoutgoing_id); // mail an assistenz senden if ($status == 'genehmigt') { // wenn Student dann Email an zuständige Assistenz if (check_student($preoutgoing->uid)) { sendMailAssistenz($preoutgoing->uid); } } $outgoing = new preoutgoing(); if ($outgoing->setStatus($preoutgoing_id, $status)) { $message = '<span class="ok">Erfolgreich gespeichert</span>'; } else { $message = '<span class="error">Es ist ein Fehler beim Speichern aufgetreten</span>'; } } if (isset($_POST['submit_anmerkung'])) { $outgoing = new preoutgoing(); $outgoing->load($preoutgoing_id); $outgoing->anmerkung_admin = $_POST['anmerkungAdmin']; if ($outgoing->save()) {
/** * Adds students to the mumiemodule * * @param integer $userid - the ID of the user * @param integer $mumiemodule - the ID of the mumiemodule * @param bool $morethanone - true if there is at least one more mumiemodule-instance within this course * @param object $mumie_group - the group in which to subscribe */ function mumiemodule_students_subscribe($userid, $mumiemoduleid, $mumie_group, $morethanone = false) { global $CFG; global $COURSE; if (record_exists("mumiemodule_students", "mumiemodule", $mumiemoduleid, "userid", $userid, "group", $mumie_group->id)) { return true; } $ins = new object(); $ins->mumiemodule = $mumiemoduleid; $ins->userid = $userid; $ins->groupid = $mumie_group->id; $ins->timemodified = time(); //does the MUMIE already know the user? $studenttocheck = new object(); $studenttocheck->syncid = 'moodle-' . $CFG->prefix . 'user-' . $userid; $userexists = check_student($studenttocheck); //now we can insert the user into DB $newid = insert_record("mumiemodule_students", $ins); if ($newid) { if (!$morethanone && !$userexists) { //MUMIE does not know this user yet $newuser = get_record('user', 'id', $userid); send_single_user_to_mumie($newuser); } $group_sync_id = 'moodle-' . $CFG->prefix . 'groups-' . $mumie_group->id; $user_sync_id = 'moodle-' . $CFG->prefix . 'user-' . $newuser->id; add_user_to_mumie_tutorial($user_sync_id, $group_sync_id); } return $newid; }
$fkt->getAll($user); $stg_obj = new studiengang(); if ($stg_obj->getAll('kurzbzlang', false)) { $stg = array(); foreach ($stg_obj->result as $row) { $stg[$row->studiengang_kz] = $row->kurzbzlang; } } else { die('Fehler beim Auslesen der Studiengaenge'); } if (check_lektor($user)) { $is_lector = true; } else { $is_lector = false; } if (check_student($user)) { $is_student = true; } else { $is_student = false; } function CutString($strVal, $limit) { if (strlen($strVal) > $limit + 3) { return substr($strVal, 0, $limit) . "..."; } else { return $strVal; } } $aktiv = false; $qry = "SELECT aktiv FROM campus.vw_benutzer WHERE uid='{$user}'"; if ($result = $db->db_query($qry)) {
/** * Function to insert all neccesarry information out of a new MUMIE-module into MUMIE * * @param object $insert - big object with all information */ function insert_all_for_mumie($insert) { global $CFG; global $COURSE; $js = new JapsSynchronise(); //first we insert the new semester if MUMIE does not know it yet $semesterexists = check_semester($insert->semester); if (!$semesterexists) { insert_semester_for_mumie($insert->semester, $js); } //now we insert the new class $newclass = new object(); $newclass->syncid = $insert->syncid; $newclass->name = $insert->name; $newclass->description = $insert->description; $newclass->semester = $insert->semester->syncid; $newclass->lecturers = ''; //let's be sure to have all lecturers as users in the MUMIE DB if ($insert->lecturers) { foreach ($insert->lecturers as $lecturer) { //perhaps the lecturer is already in the MUMIE $lecturerexists = check_lecturer($lecturer); if (!$lecturerexists) { insert_user_for_mumie($lecturer, $js); } $newclass->lecturers .= $lecturer->syncid . ' '; } } $newclass->mumie_course_id = $insert->mumie_course_id; insert_class_for_mumie($newclass, $js); //next is the tutorials if ($insert->tutorials) { foreach ($insert->tutorials as $tutorial) { //we should make sure that the tutor is a user in the Mumie DB if ($tutorial->tutor) { //perhaps the tutor is already in the MUMIE $tutorexists = check_tutor($tutorial->tutor); $tutor_is_lecturer = check_lecturer($tutorial->tutor); if (!$tutorexists && !$tutor_is_lecturer) { insert_user_for_mumie($tutorial->tutor, $js); } $tutorial->tutor = $tutorial->tutor->syncid; } else { //no tutor => insert dummy $tutorial->tutor = 'moodle-dummy_tutor'; } $tutorial->classid = $insert->syncid; insert_tutorial_for_mumie($tutorial, $js); if ($tutorial->students) { foreach ($tutorial->students as $student) { //perhaps MUMIE already knows this student so we first check $studentexists = check_student($student); if (!$studentexists) { insert_user_for_mumie($student, $js); } add_user_to_mumie_tutorial($student->syncid, $tutorial->syncid, $js); } } } } }
} if ($ende - $begin > 31536000) { die($p->t('lvplan/datumsbereichZuGross') . "!"); } if (!isset($type)) { if ($pers_uid = check_student($uid)) { $type = 'student'; } elseif ($pers_uid = check_lektor($uid)) { $type = 'lektor'; } else { die("Cannot set type!"); } } if (!isset($pers_uid)) { if ($type == 'student') { $pers_uid = check_student($uid); } elseif ($type == 'lektor') { $pers_uid = check_lektor($uid); } else { $pers_uid = ''; } } // Stundenplanobjekt erzeugen $stdplan = new wochenplan($type); $stdplan->crlf = $crlf; // Zusaetzliche Daten laden if (!$stdplan->load_data($type, $pers_uid, $ort_kurzbz, $stg_kz, $sem, $ver, $grp, $gruppe_kurzbz, null, $lva)) { die($stdplan->errormsg); } //Ueberschriften in HTML if ($format == 'HTML') {