- Checksystem: neue Tabelle tbl_paabgabe

- Moodle Globale Gast Accounts
This commit is contained in:
Andreas Österreicher
2009-01-09 07:56:16 +00:00
parent 6ed09e1d39
commit f3ef50b1b1
6 changed files with 115 additions and 6 deletions
+4 -4
View File
@@ -376,9 +376,9 @@ class moodle_course
$this->getContext(40, $id_sem);
//Eintrag in tbl_mdl_course
$qry = "INSERT INTO public.mdl_course(category, sortorder, fullname, shortname, format, showgrades, newsitems, enrollable)
$qry = "INSERT INTO public.mdl_course(category, sortorder, fullname, shortname, format, showgrades, newsitems, enrollable, guest)
VALUES (".$this->addslashes($id_sem).", (SELECT max(sortorder)+1 FROM public.mdl_course), ".$this->addslashes($this->mdl_fullname).", ".
$this->addslashes($this->mdl_shortname).",'topics', 1, 5, 0);";
$this->addslashes($this->mdl_shortname).",'topics', 1, 5, 0, 1);";
if($result = pg_query($this->conn_moodle, $qry))
{
@@ -812,9 +812,9 @@ class moodle_course
$this->getContext(40, $id_stsem);
//Eintrag in tbl_mdl_course
$qry = "INSERT INTO public.mdl_course(category, sortorder, fullname, shortname, format, showgrades, newsitems, enrollable)
$qry = "INSERT INTO public.mdl_course(category, sortorder, fullname, shortname, format, showgrades, newsitems, enrollable, guest)
VALUES (".$this->addslashes($id_stsem).", (SELECT max(sortorder)+1 FROM public.mdl_course), ".$this->addslashes($this->mdl_fullname).", ".
$this->addslashes($this->mdl_shortname).",'topics', 1, 5, 0);";
$this->addslashes($this->mdl_shortname).",'topics', 1, 5, 0, 1);";
if($result = pg_query($this->conn_moodle, $qry))
{
+41
View File
@@ -208,6 +208,7 @@ class moodle_user
return false;
}
$this->createGlobaleGastrolle($this->mdl_user_id);
}
//Lektoren loeschen die nicht mehr zugeordnet sind
@@ -364,6 +365,9 @@ class moodle_user
$this->errormsg = 'Fehler beim Auslesen der Rollen';
return false;
}
//globale Gastrolle anlegen
$this->createGlobaleGastrolle($this->mdl_user_id);
//Gruppenzuteilung
if($gruppensync)
@@ -669,6 +673,43 @@ class moodle_user
}
}
// *********************************************
// * Fuegt dem User die globale Gastrolle hinzu
// * @param $mdl_user_id Moodle ID des Users der
// * die GastRolle bekommt
// * @return true wenn ok, false wenn Fehler
// *********************************************
function createGlobaleGastrolle($mdl_user_id)
{
//Nachschauen ob diese Person bereits eine globale Gastrolle hat
$qry = "SELECT 1 FROM public.mdl_role_assignments
WHERE
userid='".addslashes($mdl_user_id)."' AND
contextid='1' AND
roleid='6'";
if($result = pg_query($this->conn_moodle, $qry))
{
if(pg_num_rows($result)==0)
{
//noch nicht zugeteilt
if($this->createZuteilung($mdl_user_id, 1, 6))
{
$this->log.="\n$this->mdl_user_firstname $this->mdl_user_lastname wurde die globale Gastrolle zugeteilt";
$this->log_public.="\n$this->mdl_user_firstname $this->mdl_user_lastname wurde die globale Gastrolle zugeteilt";
}
else
$this->log.="\nFehler beim Anlegen der Gast-Zuteilung: $this->errormsg";
}
}
else
{
$this->errormsg = 'Fehler beim Auslesen der Rollen';
return false;
}
}
// *************************************************
// * Loescht die Zuteilung eines Users zu einem Kurs
// * @param $mdl_user_id MoodleID des Users
+5
View File
@@ -386,6 +386,11 @@
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap"><a class="Item" href="public/info/verordnungen/EDV_Richtlinien.doc" target="content"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;EDV Richtlinien</a></td>
</tr>
<tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap"><a class="Item" href="public/info/verordnungen/Datensicherung_und_Archivierung.doc" target="content"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;Datensicherung und Archivierung</a></td>
</tr>
<tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap"><a href="?Verordnungen" class="MenuItem" onClick="return(js_toggle_container('Laborordnung'));"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;Laborordnung</a>