From lon-capa-cvs-allow@mail.lon-capa.org Mon Feb 18 04:46:53 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (lon-capa-cvs-allow@mail.lon-capa.org) Date: Sun, 17 Feb 2008 23:46:53 -0500 Subject: [LON-CAPA-cvs] February 72% OFF Message-ID: <20080217064652.8118.qmail@pool-138-88-1-106.res.east.verizon.net> Windows Live Hotmail Print Message
From lon-capa-cvs-allow@mail.lon-capa.org Mon Feb 18 14:44:10 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (lon-capa-cvs-allow@mail.lon-capa.org) Date: Mon, 18 Feb 2008 09:44:10 -0500 Subject: [LON-CAPA-cvs] February 76% OFF Message-ID: <20080213101123.14254.qmail@pe-celina.donpac.ru> Windows Live Hotmail Print Message
From lon-capa-cvs-allow@mail.lon-capa.org Mon Feb 18 23:05:42 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (www) Date: Mon, 18 Feb 2008 23:05:42 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / production_dns_domain.tab production_dns_hosts.tab Message-ID: www Mon Feb 18 18:05:42 2008 EDT Modified files: /loncom production_dns_domain.tab production_dns_hosts.tab Log: DNS change, Frankfurt Elk Rapids Index: loncom/production_dns_domain.tab diff -u loncom/production_dns_domain.tab:1.30 loncom/production_dns_domain.tab:1.31 --- loncom/production_dns_domain.tab:1.30 Thu Jan 31 10:10:10 2008 +++ loncom/production_dns_domain.tab Mon Feb 18 18:05:41 2008 @@ -95,6 +95,7 @@ ohiouk12:Ohio University - K12:::en-US:Athens, OH:-82.1:39.329:ohiouk12l1 #Hosted +elkrapids:Elk Rapids Schools:::en-US::::elkrapidsl1 mcneese:McNeese State University:::en-US::::mcneesel1 case:Case Western Reserve University:::en-US::::casel1 ou:The University of Oklahoma:::en-US::::oul1 Index: loncom/production_dns_hosts.tab diff -u loncom/production_dns_hosts.tab:1.30 loncom/production_dns_hosts.tab:1.31 --- loncom/production_dns_hosts.tab:1.30 Thu Jan 31 10:10:10 2008 +++ loncom/production_dns_hosts.tab Mon Feb 18 18:05:41 2008 @@ -90,7 +90,7 @@ umassdl1:umassd:library:maxixe.phy.umassd.edu omi-fhoow1:omi-fhoow:library:capa.et-inf.fho-emden.de cosl1:oregonstate:library:lon-capa.science.oregonstate.edu -ufml1:ufm:library:konfuzius.rz.uni-frankfurt.de +ufml1:ufm:library:lon-capa-base1.server.uni-frankfurt.de binghamtonl1:binghamton:library:loncapa.chem.binghamton.edu itul1:itu:library:www.fizikodev.itu.edu.tr uprml1:uprm:library:loncapa.hep.uprm.edu @@ -122,6 +122,7 @@ #Hosted - educogs library server +elkrapidsl1:elkrapids:library:educog.com mcneesel1:mcneese:library:educog.com southfieldl1:southfield:library:educog.com longwoodl1:longwood:library:educog.com From lon-capa-cvs-allow@mail.lon-capa.org Tue Feb 19 12:09:03 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (foxr) Date: Tue, 19 Feb 2008 12:09:03 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface entities.pm Message-ID: foxr Tue Feb 19 07:09:03 2008 EDT Modified files: /loncom/interface entities.pm Log: many many more entities. Index: loncom/interface/entities.pm diff -u loncom/interface/entities.pm:1.1 loncom/interface/entities.pm:1.2 --- loncom/interface/entities.pm:1.1 Mon Feb 11 06:35:46 2008 +++ loncom/interface/entities.pm Tue Feb 19 07:09:02 2008 @@ -53,6 +53,12 @@ # the original massive regular expression replacements originally by # A. Sakharuk in lonprintout.pm # +# I also want to acknowledge +# ISO Character entities and their LaTeX equivalents by +# Vidar Bronken Gundersen, and Rune Mathisen +# http://www.bitjungle.com/isoent-ref.pdf +# + # Note numerical entities are essentially unicode character codes. # my %entities = { @@ -499,6 +505,159 @@ 'zeta' => '\\ensuremath\{\\zeta\}', 951 => '\\ensuremath\{\\eta\}', 'eta' => '\\ensuremath\{\\eta\}', + 952 => '\\ensuremath\{\\theta\}', + 'theta' => '\\ensuremath\{\\theta\}', + 953 => '\\ensuremath\{\\iota\}', + 'iota' => '\\ensuremath\{\\iota\}', + 954 => '\\ensuremath\{\\kappa\}', + 'kappa' => '\\ensuremath\{\\kappa\}', + 955 => '\\ensuremath\{\\lambda\}', + 'lambda' => '\\ensuremath\{\\lambda\}', + 956 => '\\ensuremath\{\\mu\}', + 'mu' => '\\ensuremath\{\\mu\}', + 957 => '\\ensuremath\{\\nu\}', + 'nu' => '\\ensuremath\{\\nu\}', + 958 => '\\ensuremath\{\\xi\}', + 'xi' => '\\ensuremath\{\\xi\}', + 959 => '\\ensuremath\{o\}', + 'omicron'=> '\\ensuremath\{o\}', + 960 => '\\ensuremath\{\\pi\}', + 'pi' => '\\ensuremath\{\\pi\}', + 961 => '\\ensuremath\{\\rho\}', + 'rho' => '\\ensuremath\{\\rho\}', + 962 => '\\ensuremath\{\\varsigma\}', + 'sigmaf' => '\\ensuremath\{\\varsigma\}', + 963 => '\\ensuremath\{\\sigma\}', + 'sigma' => '\\ensuremath\{\\sigma\}', + 964 => '\\ensuremath\{\\tau\}', + 'tau' => '\\ensuremath\{\\tau\}', + 965 => '\\ensuremath\{\\upsilon\}', + 'upsilon'=> '\\ensuremath\{\\upsilon\}', + 966 => '\\ensuremath\{\\phi\}', + 'phi' => '\\ensuremath\{\\phi\}', + 967 => '\\ensuremath\{\\chi\}', + 'chi' => '\\ensuremath\{\\chi\}', + 968 => '\\ensuremath\{\\psi\}', + 'psi' => '\\ensuremath\{\\psi\}', + 969 => '\\ensuremath\{\\omega\}', + 'omega' => '\\ensuremath\{\\omega\}', + 977 => '\\ensuremath\{\\vartheta\}', + 'thetasym'=>'\\ensuremath\{\\vartheta\}', + 978 => '\\ensuremath\{\\varUpsilon\}', + 'upsih' => '\\ensuremath\{\\varUpsilon\}', + 982 => '\\ensuremath\{\\varpi\}', + 'piv' => '\\ensuremath\{\\varpi\}', + + + # The general punctuation set: + + 8194, => '\\hspace{.5em}', + 'enspc' => '\\hspace{.5em}', + 8195 => '\\hspace{1.0em}', + 'emspc' => '\\hspace{1.0em}', + 8201 => '\\hspace{0.167em}', + 'thinsp' => '\\hspace{0.167em}', + 8204 => '\{\}', + 'zwnj' => '\{\}', + 8205 => '', + 'zwj' => '', + 8206 => '', + 'lrm' => '', + 8207 => '', + 'rlm' => '', + 8211 => '--', + 'ndash' => '--', + 8212 => '---', + 'mdash' => '---', + 8216 => '`', + 'lsquo' => '`', + 8217 => "'", + 'rsquo' => "'", + 8218 => '\\quotesinglebase', + 'sbquo' => '\\quotesinglebase', + 8220 => '``', + 'ldquo' => '``', + 8221 => "''", + 'rdquo' => "''", + 8222 => '\\quotedblbase', + 'bdquo' => '\\quotedblbase', + 8224 => '\\dagger', + 'dagger' => '\\dagger', + '8225' => '\\ddag', + 'Dagger' => '\\ddag', + 8226 => '\\textbullet', + 'bull' => '\\textbullet', + 8230 => '\\textellipsis', + 'hellep' => '\\textellipsis', + 8240 => '\\textperthousand', + permil => '\\textperthousand', + 8242 => '\\textquotesingle', + 'prime' => '\\textquotesingle', + 8243 => '\\textquotedbl', + 'Prime' => '\\textquotedbl', + 8249 => '\\guilsingleleft', + 'lsaquo' => '\\guilsingleleft', + 8250 => '\\guilsingleright', + 'rsaquo' => '\\guilsingleright', + 8254 => '\\textasciimacron', + oline => '\\textasciimacron', + 8260 => '\\textfractionsolidus', + 'frasl' => '\\textfractionsolidus', + 8364 => '\\texteuro', + 'euro' => '\\texteuro', + + # Letter like symbols + + + 8472 => '\\ensuremath\{\\wp\}', + 'weierp' => '\\ensuremath\{\\wp\}', + 8465 => '\\ensuremath\{\\Im\}', + 'image' => '\\ensuremath\{\\Im\}', + 8476 => '\\ensuremath{\\Re\}', + 'real' => '\\ensuremath{\\Re\}', + 8482 => '\\texttrademark', + 'trade' => '\\texttrademark', + 8501 => '\\ensuremath{\\aleph\}', + 'alefsym'=> '\\ensuremath{\\aleph\}', + + # Arrows and then some (harpoons from Hon Kie). + + 8592 => '\\textleftarrow', + 'larr' => '\\textleftarrow', + 8593 => '\\textuparrow', + 'uarr' => '\\textuparrow', + 8594 => '\\textrightarrow', + 'rarr' => '\\textrightarrow', + 8595 => '\\textdownarrow', + 'darr' => '\\textdownarrow', + 8596 => '\\ensuremath\{\\leftrightarrow\}', + 'harr' => '\\ensuremath\{\\leftrightarrow\}', + 8598 => '\\ensuremath\{\\nwarrow\}', + 8599 => '\\ensuremath\{\\nearrow\}', + 8600 => '\\ensuremath\{\\searrow\}', + 8601 => '\\ensuremath\{\\swarrow\}', + 8605 => '\\ensuremath\{\\leadsto\}', + 8614 => '\\ensuremath\{\\mapsto\}', + 8617 => '\\ensuremath\{\\hookleftarrow\}', + 8618 => '\\ensuremath\{\\hookrightarrow\}', + 8629 => '\\ensuremath\{\\hookleftarrow\}', # not an exact match but best I know. + 'crarr' => '\\ensuremath\{\\hookleftarrow\}', # not an exact match but best I know. + 8636 => '\\ensuremath\{\\leftharpoonup\}', + 8637 => '\\ensuremath\{\\leftharpoondown\}', + 8640 => '\\ensuremath\{\\rightharpoonup\}', + 8641 => '\\ensuremath\{\\rightharpoondown\}', + 8652 => '\\ensuremath\{\\rightleftharpoons\}', + 8656 => '\\ensuremath\{\\Leftarrow\}', + 'lArr' => '\\ensuremath\{\\Leftarrow\}', + 8657 => '\\ensuremath\{\\Uparrow\}', + 'uArr' => '\\ensuremath\{\\Uparrow\}', + 8658 => '\\ensuremath\{\\Rightarrow\}', + 'rArr' => '\\ensuremath\{\\Rightarrow\}', + 8659 => '\\ensuremath\{\\Downarrow\}', + 'dArr' => '\\ensuremath\{\\Downarrow\}', + 8660 => '\\ensuremath\{\\Leftrightarrow\}', + # Mathematical operators. + }; From lon-capa-cvs-allow@mail.lon-capa.org Thu Feb 21 10:04:36 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (foxr) Date: Thu, 21 Feb 2008 10:04:36 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm Message-ID: foxr Thu Feb 21 05:04:36 2008 EDT Modified files: /loncom/lonnet/perl lonnet.pm Log: BZ5631: Make lonnet::ssi capable of returning the entire request object. The idea is to allow the caller to analyze it to do error detection, error recovery, implement retry policies. Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.941 loncom/lonnet/perl/lonnet.pm:1.942 --- loncom/lonnet/perl/lonnet.pm:1.941 Sun Feb 3 00:08:05 2008 +++ loncom/lonnet/perl/lonnet.pm Thu Feb 21 05:04:35 2008 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.941 2008/02/03 05:08:05 raeburn Exp $ +# $Id: lonnet.pm,v 1.942 2008/02/21 10:04:35 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1650,9 +1650,21 @@ return $protocol.$host_name; } +# +# Server side include. +# Parameters: +# fn Possibly encrypted resource name/id. +# form Hash that describes how the rendering should be done +# and other things. +# r Optional reference that will be given the response. +# This is mostly provided so that the caller can implement +# error detection, recovery and retry policies. +# +# Returns: +# The content of the response. sub ssi { - my ($fn,%form)=@_; + my ($fn,%form, $r)=@_; my $ua=new LWP::UserAgent; @@ -1670,6 +1682,10 @@ $request->header(Cookie => $ENV{'HTTP_COOKIE'}); my $response=$ua->request($request); + if ($r) { + $$r = $response; + } + return $response->content; } From lon-capa-cvs-allow@mail.lon-capa.org Thu Feb 21 16:04:20 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn) Date: Thu, 21 Feb 2008 16:04:20 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / lond Message-ID: raeburn Thu Feb 21 11:04:20 2008 EDT Modified files: /loncom lond Log: If a domain is using institutional authentication (i.e., kerberos or localauth), and a user does not currently have a LON-CAPA account, try to authenticate using default authtype and autharg, if these were passed as arguments. Index: loncom/lond diff -u loncom/lond:1.394 loncom/lond:1.395 --- loncom/lond:1.394 Mon Feb 11 13:51:41 2008 +++ loncom/lond Thu Feb 21 11:04:19 2008 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.394 2008/02/11 18:51:41 raeburn Exp $ +# $Id: lond,v 1.395 2008/02/21 16:04:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,7 +59,7 @@ my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.394 $'; #' stupid emacs +my $VERSION='$Revision: 1.395 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -1514,13 +1514,16 @@ # udom - User's domain. # uname - Username. # upass - User's password. + # defauthtype - Default authentication types for the domain + # defautharg - Default authentication arg for the domain - my ($udom,$uname,$upass)=split(/:/,$tail); + my ($udom,$uname,$upass,$defauthtype,$defautharg)=split(/:/,$tail); &Debug(" Authenticate domain = $udom, user = $uname, password = $upass"); chomp($upass); $upass=&unescape($upass); - my $pwdcorrect = &validate_user($udom, $uname, $upass); + my $pwdcorrect = &validate_user($udom,$uname,$upass,$defauthtype, + $defautharg); if($pwdcorrect) { &Reply( $client, "authorized\n", $userinput); # @@ -5970,8 +5973,7 @@ # 0 - The domain,user,password triplet is not a valid user. # sub validate_user { - my ($domain, $user, $password) = @_; - + my ($domain, $user, $password, $defauthtype, $defautharg) = @_; # Why negative ~pi you may well ask? Well this function is about # authentication, and therefore very important to get right. @@ -5994,8 +5996,17 @@ my $null = pack("C",0); # Used by kerberos auth types. + if ($howpwd eq 'nouser') { + if ($defauthtype eq 'localauth') { + $howpwd = $defauthtype; + $contentpwd = $defautharg; + } elsif ((($defauthtype eq 'krb4') || ($defauthtype eq 'krb5')) && + ($defautharg ne '')) { + $howpwd = $defauthtype; + $contentpwd = $defautharg; + } + } if ($howpwd ne 'nouser') { - if($howpwd eq "internal") { # Encrypted is in local password file. $validated = (crypt($password, $contentpwd) eq $contentpwd); } From lon-capa-cvs-allow@mail.lon-capa.org Thu Feb 21 18:48:07 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (bisitz) Date: Thu, 21 Feb 2008 18:48:07 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /html/adm/help/tex/de Contextual_Help.tex Message-ID: bisitz Thu Feb 21 13:48:07 2008 EDT Added files: /loncom/html/adm/help/tex/de Contextual_Help.tex Log: First German translation of this help file Index: loncom/html/adm/help/tex/de/Contextual_Help.tex +++ loncom/html/adm/help/tex/de/Contextual_Help.tex \label{Contextual_Help} LON-CAPA bietet an vielen Stellen kontextabhängige Hilfe zur Funktionalität. Klicken Sie einfach auf das blaue Fragezeichen, das neben den Buttons, Menüeinträgen oder am Seitenkopf erscheint, um Hilfe zu den Elementen oder Funktionen auf dem jeweiligen Bildschirm zu erhalten. Klicken Sie auf das orangene Fragezeichen, um zusätzliche Hilfe von den Online-FAQ oder vom Helpdesk zu erhalten oder um einen Softwarefehler oder Verbesserungsvorschlag im Bugzilla-Fehlerverwaltungssystem zu melden. From lon-capa-cvs-allow@mail.lon-capa.org Thu Feb 21 18:48:42 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (bisitz) Date: Thu, 21 Feb 2008 18:48:42 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /html/adm/help/tex/de General_Intro.tex Message-ID: bisitz Thu Feb 21 13:48:42 2008 EDT Added files: /loncom/html/adm/help/tex/de General_Intro.tex Log: First German translation of this help file Index: loncom/html/adm/help/tex/de/General_Intro.tex +++ loncom/html/adm/help/tex/de/General_Intro.tex \label{General_Intro} \section*{Einführung} Hilfebildschirme wie dieser hier werden an bestimmten Stellen im System angeboten. Sie erkennen diese an dem blauen Fragezeichen. Nachdem Sie sich in LON-CAPA eingeloggt haben, sehen Sie eine Liste von Rollen, die Sie momentan im System haben. Weiterhin sehen Sie ein kleines Fenster, das sich Fernbedienung nennt. Eine gute Fensteranordnung ist die Positionierung der Fernbedienung neben das Fenster mit dem Inhalt. Um eine Beschreibung der Buttons auf der Fernbedienung zu erhalten, klicken Sie auf den blauen \textbf{ERWEITERTE ANSICHT}-Button. Wählen Sie aus der Liste Ihrer Rollen eine bestimmte Rolle aus, z.B. eine studentische Rolle für einen bestimmten Kurs. (Klicken Sie auf den \textbf{Auswählen}-Button neben dem Kurs, den Sie betreten möchten). \section*{Navigation im Kurs} Sie können mit den zugehörigen Tasten der Fernbedienung im Inhalt des Kurses vor- und zurückgehen. Sie können auf \textbf{NAV} (``Inhaltsverzeichnis'') klicken, um schnell zu einer Seite im Kurs zu gelangen. \section*{Übungsaufgaben} Ihr Kurs bietet Ihnen möglicherweise Übungsaufgaben. Sie erkennen die Übungen im Inhaltsverzeichnis an den bunten Symbolen (gelb: verfügbar, grün: gelöst, rot: Fälligkeit vorbei). Sie haben u.U. mehr als einen Versuch, um die Aufgabe zu lösen. Das System speichert all Ihre Versuche. Wenn Sie eine Aufgabe erfolgreich gelöst haben, erhalten Sie vom System eine Nachweisnummer. Bitte notieren Sie sich diese Nummer, um einen Nachweis über das erfolgreiche Lösen zu haben. \section*{Kommunikation} LON-CAPA hat ein eingebettetes Kommunikationssystem. Sie können Nachrichten mit Bezug auf den Kursinhalt senden, indem Sie auf den Feedback-Button (\textbf{FDBK}) auf der Fernbedienung klicken. Sie können aus mehreren Arten von Feedback wählen, u.a. auch ein Beitrag an der Kursdiskussion. Normales Feedback wird an Tutoren und das Kurspersonal geleitet. Kursdiskussionen sind seitenbezogene Schwarze Bretter und erscheinen direkt unterhalb der Seite, auf der Sie sich gerade befinden. Sie können Ihren Beitrag anonym absenden. In diesem Fall sieht nur das Kurspersonal Ihren echten Namen. Um interne Nachrichten zu senden oder um Antworten auf Ihr Feedback zu sehen, nutzen Sie den Kommunikations-Button (\textbf{COM}). Bitte verwenden Sie die eingebauten Kommunikationsmöglichkeiten, anstatt normale E-Mails zu versenden, da so automatisch der passende Kontext zu Ihren Fragen und sonstigen Beiträgen geschaffen wird. From lon-capa-cvs-allow@mail.lon-capa.org Thu Feb 21 18:49:15 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (bisitz) Date: Thu, 21 Feb 2008 18:49:15 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /html/adm/help/tex/de Navigation_Screen.tex Message-ID: bisitz Thu Feb 21 13:49:15 2008 EDT Added files: /loncom/html/adm/help/tex/de Navigation_Screen.tex Log: First German translation of this help file Index: loncom/html/adm/help/tex/de/Navigation_Screen.tex +++ loncom/html/adm/help/tex/de/Navigation_Screen.tex \label{Navigation_Screen} Klicken Sie \textbf{NAV} auf der Fernbedienung oder im Hauptmenü, um einen Überblick über den Inhalt Ihres Kurses zu erhalten. Das \textbf{Inhaltsverzeichnis} bietet Ihnen eine tabellarische Struktur Ihres Kurses, in dem Ihnen auch die Fälligkeitsdaten, der Aufgabenstatus (z.B. gelöst oder noch nicht gelöst), Hinweise auf neue Diskussionsbeiträge und Hinweise auf neue Nachrichten gezeigt werden. Neue Diskussionsbeiträge werden durch eine kleine Sprechblase (so wie sie in Comics verwendet werden) neben der zugehörigen Ressource angezeigt. Neue Nachrichten von bestimmten Studenten erscheinen als kleine Briefumschläge neben der zugehörigen Ressource. Ein Klick auf dieses Symbol zeigt die Nachricht an. Ein Klick auf die Ressource bringt Sie direkt zu dieser Ressource. Ein Klick auf ein Verzeichnis öffnet es und zeigt eine Liste aller Ressourcen in diesem Verzeichnis. From lon-capa-cvs-allow@mail.lon-capa.org Thu Feb 21 18:49:55 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (bisitz) Date: Thu, 21 Feb 2008 18:49:55 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /html/adm/help/tex/de Student_Intro.tex Message-ID: bisitz Thu Feb 21 13:49:55 2008 EDT Added files: /loncom/html/adm/help/tex/de Student_Intro.tex Log: First German translation of this help file Index: loncom/html/adm/help/tex/de/Student_Intro.tex +++ loncom/html/adm/help/tex/de/Student_Intro.tex \label{Student_Intro} \textbf{Willkommen zum LON-CAPA-Hilfesystem} Bitte beachten Sie: Innerhalb der Anwendung werden Ihnen blaue Fragenzeichen (\ref{Contextual_Help}) angeboten, die kontextabhängige Hilfe zu speziellen Teilbereichen bietet. \begin{itemize} \ref{General_Intro} Allgemeine Einführung \end{itemize} Abhängig von Ihrer derzeit gewählten Benutzerrolle werden Ihnen ggf. zusätzliche Informationen auf dieser Seite angeboten. From lon-capa-cvs-allow@mail.lon-capa.org Fri Feb 22 05:05:58 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn) Date: Fri, 22 Feb 2008 05:05:58 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm Message-ID: raeburn Fri Feb 22 00:05:58 2008 EDT Modified files: /loncom/interface loncreateuser.pm Log: Bug 5640. auth_check() javascript function was reporting a javascript error when a DC was adding a user role for a user in a different domain because the login form element was absent. Index: loncom/interface/loncreateuser.pm diff -u loncom/interface/loncreateuser.pm:1.234 loncom/interface/loncreateuser.pm:1.235 --- loncom/interface/loncreateuser.pm:1.234 Sun Jan 20 20:45:04 2008 +++ loncom/interface/loncreateuser.pm Fri Feb 22 00:05:57 2008 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.234 2008/01/21 01:45:04 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.235 2008/02/22 05:05:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1321,6 +1321,7 @@ $outcome .= <$lt{'ccld'} $lt{'yodo'} $lt{'ifch'}: $ccdomain + ENDNOPRIV } } From lon-capa-cvs-allow@mail.lon-capa.org Fri Feb 22 13:32:50 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (bisitz) Date: Fri, 22 Feb 2008 13:32:50 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonmsgdisplay.pm Message-ID: bisitz Fri Feb 22 08:32:50 2008 EDT Modified files: /loncom/interface lonmsgdisplay.pm Log: Message which informs about how to handle critcal messages was too small. Many students don't recognize this important information. -> Added CSS class Index: loncom/interface/lonmsgdisplay.pm diff -u loncom/interface/lonmsgdisplay.pm:1.83 loncom/interface/lonmsgdisplay.pm:1.84 --- loncom/interface/lonmsgdisplay.pm:1.83 Fri Dec 7 19:25:14 2007 +++ loncom/interface/lonmsgdisplay.pm Fri Feb 22 08:32:49 2008 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.83 2007/12/08 00:25:14 raeburn Exp $ +# $Id: lonmsgdisplay.pm,v 1.84 2008/02/22 13:32:49 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -737,7 +737,7 @@ '
'.&mt('Subject').': '.$content{'subject'}. '
'.
               &Apache::lontexconvert::msgtexconverted($content{'message'}).
-            '
'; + '
'; my ($rec_button,$reprec_button); $rec_button = &mt('Move to Inbox'); if (!$content{'noreplies'}) { @@ -752,7 +752,7 @@ } else { $result .= &mt('Access to other pages will be prevented until you have moved the message to your inbox.'); } - $result .= '
'. + $result .= '

'. ''; if (!$content{'noreplies'}) { $result .= ' bisitz Fri Feb 22 13:08:35 2008 EDT Modified files: /loncom/interface lonmsgdisplay.pm Log: Localization: Optimized some &mt() calls Index: loncom/interface/lonmsgdisplay.pm diff -u loncom/interface/lonmsgdisplay.pm:1.84 loncom/interface/lonmsgdisplay.pm:1.85 --- loncom/interface/lonmsgdisplay.pm:1.84 Fri Feb 22 08:32:49 2008 +++ loncom/interface/lonmsgdisplay.pm Fri Feb 22 13:08:35 2008 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging display # -# $Id: lonmsgdisplay.pm,v 1.84 2008/02/22 13:32:49 bisitz Exp $ +# $Id: lonmsgdisplay.pm,v 1.85 2008/02/22 18:08:35 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -555,7 +555,7 @@ 'recipients to select.'); return $result; } else { - $result = &mt('Select message recipients from the group members listed below.
'); + $result = &mt('Select message recipients from the group members listed below.').'
'; my %Sortby = ( active => {}, previous => {}, @@ -1194,8 +1194,9 @@ &printheader($r,'/adm/email?compose=multiforward', 'Forwarding Multiple Messages'); if ($multiforward > 1) { - $r->print(&mt('Each of the [quant,_1,message] you checked -will be forwarded to the recipient(s) you select below.',$multiforward).'
'); + $r->print(&mt('Each of the [quant,_1,message] you checked' + .' will be forwarded to the recipient(s) you select below.',$multiforward) + .'
'); } else { $r->print(&mt('The message you checked will be forwarded to the recipient(s) you select below.').'
'); } @@ -1504,9 +1505,10 @@ sub additional_rec_row { my ($lt) = @_; my $cc = &mt('Cc:'); - my $bcc = &mt('Bcc:'); + my $bcc = &mt('Bcc:'); + my $exmpl = &mt('username:domain,username:domain,...'); my $output = <<"ENDADD"; -$lt->{'ad'} :
username:domain,username:domain, ... +$lt->{'ad'} :
($exmpl)  $cc
$bcc @@ -2627,7 +2629,7 @@ } } else { $r->print('

'.&mt('Could not deliver message').' '. - &mt('Please use the browser "Back" button and correct the recipient addresses '."($sendstatus)").'

'); + &mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus).'

'); } } } From lon-capa-cvs-allow@mail.lon-capa.org Fri Feb 22 18:19:39 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn) Date: Fri, 22 Feb 2008 18:19:39 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonstatistics.pm Message-ID: raeburn Fri Feb 22 13:19:39 2008 EDT Modified files: /loncom/interface lonstatistics.pm Log: - Top level sequence was being included twice. Index: loncom/interface/lonstatistics.pm diff -u loncom/interface/lonstatistics.pm:1.138 loncom/interface/lonstatistics.pm:1.139 --- loncom/interface/lonstatistics.pm:1.138 Wed Jun 6 13:30:40 2007 +++ loncom/interface/lonstatistics.pm Fri Feb 22 13:19:38 2008 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.138 2007/06/06 17:30:40 albertel Exp $ +# $Id: lonstatistics.pm,v 1.139 2008/02/22 18:19:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -707,8 +707,13 @@ # my @sequences = $navmap->retrieveResources(undef, sub { shift->is_map(); },1,0,1); + my $toplevelseq = $navmap->getById('0.0'); + if (!grep(/^\Q$toplevelseq\E$/,@sequences)) { + unshift(@sequences,$toplevelseq); + } + my @sequences_with_assessments; - for my $sequence ($navmap->getById('0.0'), @sequences) { + foreach my $sequence (@sequences) { if ($navmap->hasResource($sequence,sub { shift->is_problem(); },0,1)){ push(@sequences_with_assessments,$sequence); } From lon-capa-cvs-allow@mail.lon-capa.org Fri Feb 22 18:23:52 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (bisitz) Date: Fri, 22 Feb 2008 18:23:52 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /localize/localize de.pm Message-ID: This is a MIME encoded message --bisitz1203704632 Content-Type: text/plain bisitz Fri Feb 22 13:23:52 2008 EDT Modified files: /loncom/localize/localize de.pm Log: Added several missing translations and also optimized or corrected some of them: - Course parameter setting (lonparmset.pm, code changes still in progress) - User prefs - DC interface - User account management - Course groups - Portfolio files - Messaging (lonmsgdisplay.pm) - ... --bisitz1203704632 Content-Type: text/plain Content-Disposition: attachment; filename="bisitz-20080222132352.txt" Index: loncom/localize/localize/de.pm diff -u loncom/localize/localize/de.pm:1.117 loncom/localize/localize/de.pm:1.118 --- loncom/localize/localize/de.pm:1.117 Wed Feb 13 12:51:45 2008 +++ loncom/localize/localize/de.pm Fri Feb 22 13:23:51 2008 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # German Localization Lexicon # -# $Id: de.pm,v 1.117 2008/02/13 17:51:45 bisitz Exp $ +# $Id: de.pm,v 1.118 2008/02/22 18:23:51 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1692,6 +1692,9 @@ 'No notes, face-to-face discussion records, critical messages, or broadcast messages in this [_1].' => 'Für diesen [_1] existieren keine Benutzer-Anmerkungen, Aufzeichnungen von Face-to-face-Diskussionsbeiträgen, kritische Nachrichten oder Broadcast-Nachrichten.', + 'No notes, face-to-face discussion records, critical messages or broadcast messages in this [_1].' +=> 'Für diesen [_1] existieren keine Benutzer-Anmerkungen, Aufzeichnungen von Face-to-face-Diskussionsbeiträgen, kritische Nachrichten oder Broadcast-Nachrichten.', + 'Version Number' => 'Versionsnummer', @@ -2073,20 +2076,17 @@ 'Quick Completed Problems Display' => 'Schnelle Ansicht der abgeschlossenen Aufgaben', #??? [SB 18.10.2006] - 'Resource Level' -=> 'Ressourcen-Niveau', - 'Section' => 'Sektion', 'Select Date' -=> 'Wähle Datum', +=> 'Datum auswählen', 'Select Enclosing Map or Folder' => 'Eingeschlossene(s) Inhaltszusammenstellung oder Verzeichnis', 'Select Parameter Level' -=> 'Parameterlevel', +=> 'Parameter-Ebene', 'Send internal email' => 'Verschicke interne Nachrichten', @@ -2335,7 +2335,7 @@ => 'Scantron-Operator', 'Select All' -=> 'Wähle alle', +=> 'Alle auswählen', 'Select All Students' => 'Wähle alle Studierenden', @@ -2417,7 +2417,7 @@ => 'Eingereichte Antworten werden nicht gespeichert.', 'By' -=> 'Durch', +=> 'Von', 'Check All' => 'Alle auswählen', @@ -2444,7 +2444,7 @@ => 'Löschen', 'Delete Checked' -=> 'Lösche markierte', +=> 'Ausgewählte löschen', 'Display All Messages' => 'Alle Nachrichten anzeigen', @@ -2462,7 +2462,7 @@ => 'Weitergeleitete Nachricht von', 'Forwarding' -=> 'Weiterleiten', +=> 'Weiterleitung', 'From' => 'Von', @@ -2543,7 +2543,7 @@ => 'An', 'Uncheck All' -=> 'Alle deselektieren', +=> 'Gesamte Auswahl aufheben', 'Unsuccessful Login' => 'Login fehlgeschlagen', @@ -3015,6 +3015,9 @@ 'Metadata' => 'Metadaten', + 'metadata' +=> 'Metadaten', + 'Metadata Version' => 'Metadaten-Version', @@ -3501,8 +3504,14 @@ 'Course Information' => 'Kursinformationen', + 'Resource Level' +=> 'Ressource', # 'Ressourcen-Ebene', + + 'Map/Folder Level' +=> 'Inhaltszus./Verzeichnis', # 'Inhaltszus.-/Verzeichnis-Ebene', + 'Course Level' -=> 'Kursebene', +=> 'Kurs', # 'Kurs-Ebene', 'Course Search' => 'Suche im Kurs', @@ -3624,6 +3633,9 @@ 'Ending Date' => 'Endedatum', + 'Ending date' +=> 'Endedatum', + 'English - ISO' => 'Englisch - ISO', @@ -4179,6 +4191,9 @@ 'Starting Date' => 'Anfangsdatum', + 'Starting date' +=> 'Anfangsdatum', + 'Student ID' => 'Matrikelnummer', @@ -4255,7 +4270,7 @@ => 'Es trat ein Fehler auf bei der Bestimmung der Umgebungswerte für', 'Top Level Map' -=> 'Top-Level-Inhaltszusammenstellung', +=> 'Hauptebenen-Inhaltszusammenstellung', 'Turkish - ISO' => 'Türkisch - ISO', @@ -4354,7 +4369,7 @@ => 'Eine komma-separierte Liste von Kurs-Sektionen zusammen mit dem derzeitigen Kurs, wobei jeder Eintrag den institutionellen Kurssektionsnamen beinhaltet, gefolgt von einem Doppelpunkt und dann der (optionalen) Sektions-ID zur Verwendung in LON-CAPA, z.B. fs03ent231001:ent1,fs03bot231001:bot1,fs03zol231002:zol2', 'a comma separated list of institutional section numbers, each separated by a colon from the (optional) corresponding section ID to be used in LON-CAPA e.g., 001:1,002:2' -=> 'Eine komma-separierte Liste institutioneller Sektionsnummern, jeweils getrennt durch einen Doppelpunkt von der in LON-CAPA verwendeten entsprechenden (optionalen) Sektions--ID, z.B. 001:1,002:2', +=> 'Eine komma-separierte Liste institutioneller Sektionsnummern, jeweils getrennt durch einen Doppelpunkt von der in LON-CAPA verwendeten entsprechenden (optionalen) Sektions-ID, z.B. 001:1,002:2', 'after selected' => 'nach erfolgter Auswahl', @@ -5439,14 +5454,14 @@ => 'Nachrichtenweiterleitung und Benachrichtigung', 'Change Password' -=> 'Passwort', +=> 'Passwort ändern', 'Change Preferences' # => 'Präferenzen ändern', => 'Benutzereinstellungen', 'Change Roles Page Preferences' -=> 'Benutzerrollen-Schnellzugriffsliste', +=> 'Schnellzugriffsliste für Benutzerrollen', 'Change Screen Name' => 'Nicknamen', @@ -5470,7 +5485,7 @@ => 'Jeder Diskussionsbeitrag kann zwischen als gelesen und als ungelesen umgeschaltet werden', "Edit the 'About Me' Personal Information Screen" -=> "Persönliche-Informationen-Seite ('Über mich')", +=> "Über-mich-Seite", # "Persönliche-Informationen-Seite ('Über mich')", 'Enable WYSIWYG Editor' => 'WYSIWYG-Editor verwenden', @@ -5667,7 +5682,7 @@ => 'LON-CAPA-interne Dokumente', 'Make New Folder' -=> 'Erstelle neues Verzeichnis', +=> 'Neues Verzeichnis erstellen', 'New Composite Page' => 'Neue zusammengesetzte Seite', @@ -5709,7 +5724,7 @@ => 'Datei in aktuelles Verzeichnis laden:', 'View Folder' -=> 'Betrachte Verzeichnis', +=> 'Verzeichnis betrachten', 'fulltext search (time consuming)' => 'Volltextsuche (zeitaufwändig)', @@ -6563,9 +6578,6 @@ 'Author Space' => 'Autorenbereich', - 'Course Restricting Metadata' -=> 'Course Restricting Metadata', - 'Degree of discrimination' => 'Grad der Abgrenzung', @@ -7032,6 +7044,9 @@ 'Close Window' => 'Fenster schließen', + 'Close window' +=> 'Fenster schließen', + 'Portfolio Search' => 'Portfolio-Suche', @@ -7123,7 +7138,7 @@ => 'Was sind kritische Nachrichten?', 'Change Roles Page Pref' -=> 'Benutzerrollen-Schnellzugriffsliste', +=> 'Schnellzugriffsliste für Benutzerrollen', 'Number of Roles in Hotlist:' => 'Anzahl Rollen in Schnellzugriffsliste:', @@ -7468,8 +7483,8 @@ 'Feedback Mode:' => 'Feedback-Modus:', - 'Answer for Part:' -=> 'Antwort für Teil:', # n.t. + 'Answer for Part: [_1]' +=> 'Antwort für Teil [_1]', 'Script Vars' => 'Skript-Variablen', @@ -7582,20 +7597,32 @@ 'New LON-CAPA course ID:' => 'Neue LON-CAPA-Kurs-ID:', - 'Created on:' -=> 'Erstellt in Domäne:', + 'Created on' +=> 'Erstellt in Domäne', 'Cloning course from' => 'Kurs geclont aus Domäne', - 'Setting environment:' -=> 'Einstellung der Kursumgebung:', + 'Setting environment' +=> 'Einstellung der Kursumgebung', + + 'Opening all assignments' +=> 'Start aller Übungen', + + 'Setting first resource' +=> 'Einstellung der ersten Ressource', + +# 'Assigning role of Course Coordinator to' +#=> 'Zuweisung der Rolle Kurs-Koordinator an', + + 'Assigning role of [_1] Coordinator to [_2] at [_3]: ' +=> 'Zuweisung der Rolle des [_1]-Koordinators an [_2] in [_3]: ', - 'Assigning role of Course Coordinator to' -=> 'Zuweisung der Rolle Kurs-Koordinator an', + 'Roles will be active at next login' +=> 'Rollen werden ab dem nächsten Login aktiv sein', - 'Roles will be active at next login.' -=> 'Rollen werden ab dem nächsten Login aktiv sein.', + 'Active at next login. ' +=> 'Beim nächsten Login aktiv. ', 'Create Another [_1]' => 'Einen weiteren [_1] anlegen', @@ -7670,7 +7697,10 @@ => 'Heimatserver', 'Modifying Roles' -=> 'Passe Benutzerrollen an', +=> 'Anpassung der Benutzerrollen', + + 'No roles to modify' +=> 'Es erfolgte keine Änderung der Benutzerrollen.', 'starting' => 'Start am', @@ -7700,7 +7730,7 @@ => 'Keine neuen dynamischen Daten gefunden.', 'Selected Resources from selected folder in course' -=> 'Ausgewählte Ressourcen im ausgewählten Ordner im Kurs', +=> 'Ausgewählte Ressourcen im ausgewählten Verzeichnis im Kurs', 'Current value is' => 'Aktuelle Einstellung ist', @@ -8624,6 +8654,9 @@ 'Locating your clicker ID' => 'Die Clicker-ID ausfindig machen', # n.t. + 'Register Clicker' +=> 'Clicker registrieren', + 'Register' => 'Registrieren', @@ -9396,7 +9429,7 @@ => '[_2]. [_1] [_3], [_4]:[_5]:[_6] ', # "dd. mm yyyy, hh:mi:ss" '[_1]Select Date[_2]' -=> '[_1]Wähle Datum[_2]', +=> '[_1]Datum auswählen[_2]', '("all":students can view all sections,"section":students can only view their own section.blank or "disabled" prevents student view.' => ' ("all": Studenten können alle Sektionen sehen. "section": Studenten können nur ihre eigene Sektion sehen. Leer oder "disabled": Kein Student kann Sektionen sehen.)', @@ -9769,7 +9802,7 @@ => 'Anzeigen', 'Reply' -=> 'Antworten', +=> 'Antwort', 'Mark unread' => 'Als ungelesen kennzeichnen', @@ -9979,7 +10012,7 @@ => 'Nachricht anzeigen', 'Back to Folder Display' -=> 'Zurück zur Ordnerliste', +=> 'Zurück zur Verzeichnisliste', 'Currently available actions (will open extra window)' => 'Verfügbare Aktionen (öffnet neues Fenster)', @@ -9990,7 +10023,7 @@ 'There are no gelesen messages in this folder' # ! => 'In diesem Verzeichnis befinden sich keine gelesenen Nachrichten.', - 'There are no weitergeleitet messages in this folder.' + 'There are no weitergeleitet messages in this folder.' # ! => 'In diesem Verzeichnis befinden sich keine weitergeleiteten Nachrichten.', 'You have not replied to any messages in this folder.' @@ -10431,9 +10464,6 @@ 'No group functionality (e.g., e-mail, discussion, chat or file upload) is currently available to you in this group: [_1].' => 'Derzeit ist in der Gruppe [_1] keine Gruppenfunktion (z.B. E-Mail, Diskussion, Chat oder Dateien-Hochladen) verfügbar.', - 'Group page - [_1]' -=> 'Gruppenseite - [_1]', - 'Group Page' => 'Gruppenseite', @@ -10552,7 +10582,7 @@ => 'Es existieren Auswahlmöglichkeiten ohne Namen. Das könnte eine fehlerhafte Funktionalität verursachen.', # n.t. "The message itself will begin with a first line: 'Forwarded message from' followed by the original sender's name." -=> "Die Nachricht wird in der ersten Zeile mit Weitergeleitete Nachricht von' starten gefolgt vom Orignalnamen des Senders.", +=> "Die Nachricht wird in der ersten Zeile mit Weitergeleitete Nachricht von' starten, gefolgt vom Originalnamen des Absenders.", 'Forwarded message from ' => 'Weitergeleitete Nachricht von ', @@ -10573,13 +10603,13 @@ => 'Bezieht sich auf', 'Previous attempts of student (if applicable)' -=> 'Bisherige Versuche des Studenten (falls möglich)', +=> 'Bisherige Versuche des Studenten (falls verfügbar)', 'Original screen output (if applicable)' -=> 'Orignal-Bildschirmausgabe (falls möglich)', +=> 'Original-Bildschirmausgabe (falls verfügbar)', 'Correct Answer(s) (if applicable)' -=> 'Korrekte Antwort(en) (falls möglich)', +=> 'Korrekte Antwort(en) (falls verfügbar)', 'LON-CAPA messages sent to you between [_1] and [_2] will be inaccessible until the end of this time period, because you are a student in a course with an active communications block.' => 'Sie haben auf Ihnen zwischen [_1] und [_2] zugesandte LON-CAPA-Nachrichten bis zum Ende dieser Zeitperiode keinen Zugriff, da Sie Student in einem Kurs mit aktivierter Kommunikationsblockade sind.', @@ -10636,6 +10666,9 @@ 'Forwarding a Message' => 'Nachricht weiterleiten', + 'Forwarding Multiple Messages' +=> 'Mehrere Nachrichten weiterleiten', + 'At end of file some tags were still left unclosed, ' => 'Am Ende der Datei sind noch nicht geschlossene Tags übrig: ', @@ -11136,7 +11169,7 @@ => 'Die Daten der zusätzlichen Felder wurden in das "Bemerkungen"-Feld transferiert', 'Home' -=> 'Home', # ?!? +=> 'Heimatverzeichnis', 'Usage Statistics' => 'Nutzungsstatistiken', @@ -12981,6 +13014,370 @@ 'Click on the button below to return to the grading menu.' => 'Klicken Sie auf den Button, um zum Bewertungsmenü zurückzugelangen.', + 'Group files' +=> 'Gruppendateien', + + 'One group portfolio file is available.' +=> 'Eine Gruppen-Portfolio-Datei ist verfügbar.', + + 'One portfolio file owned by [_1] is available.' +=> 'Eine Gruppen-Portfolio-Datei von [_1] ist verfügbar.', + + 'A total of [_1] group portfolio files are available.' +=> 'Insgesamt sind [_1] Gruppen-Portfolio-Dateien verfügbar.', + + 'A total of [_1] portfolio files owned by [_2] are available' +=> 'Insgesamt sind [_1] Gruppen-Portfolio-Dateien von [_2] verfügbar.', + + '[quant,_1,file is,files are] publicly accessible.' +=> 'Auf [quant,_1,Datei,Dateien] kann öffentlich zugegriffen werden.', + + '[quant,_1,file requires,files require] a passphrase for access.' +=> '[quant,_1,Datei benötigt,Dateien benötigen] für den Zugriff ein Passwort.', + + 'Group Portfolio files' +=> 'Gruppen-Portfolio-Dateien', + + 'Viewable portfolio files.' +=> 'Einsehbare Portfolio-Dateien', + + 'Viewable portfolio files' +=> 'Einsehbare Portfolio-Dateien', + + 'Viewable group portfolio files' +=> 'Einsehbare Gruppen-Portfolio-Dateien', + + 'Display file listing' +=> 'Dateienliste anzeigen', + + 'Portfolio files for [_1]' +=> 'Portfolio-Dateien von [_1]', + + 'File access type: ' +=> 'Dateizugriffs-Typ: ', + + 'Update display' +=> 'Anzeige aktualisieren', + + 'Course Information page' +=> 'Kursinformations-Seite', + + 'Information about [_1]' +=> 'Über-mich-Seite von [_1]', + + 'There are no available files of the specified access type: [_1]' +=> 'Es sind keine Dateien des angegebenen Zugriffstyps [_1] verfügbar.', + + 'File Type Displayed: [_1]' +=> 'Anzuzeigende Dateitypen: [_1]', + + 'All file types' +=> 'Alle Dateitypen', + + 'The resource depends on another resource with variable filename, i.e., [_1]. You likely need to explicitly allow access to all possible dependencies using the [_2]-tag' +=> 'Die Ressource hängt von einer anderen Ressource ab, die einen variablen Dateinamen hat, z.B. [_1]. Sie müssen explizit Zugriff auf alle möglichen Abhängigkeiten erlauben, indem Sie das [_2]-Tag verwenden.', + + + 'Select All' +=> 'Alle auswählen', + + 'Select Common Only' +=> 'Nur Gebräuchliche auswählen', + + 'Add Selection for:' +=> 'Auswahl hinzufügen für:', + + 'Problem Dates' +=> 'Aufgaben-Zeitfenster', + + 'Content Dates' +=> 'Inhalts-Zeitfenster', + + 'Discussion Settings' +=> 'Diskussionen', + + 'Visibilities' +=> 'Sichtbarkeit', + + 'Part Parameters' +=> 'Aufgabenteile', + + 'Unselect All' +=> 'Auswahl komplett aufheben', + + 'Problem Opening Date' +=> 'Aufgaben-Startzeit', + + 'New LON-CAPA [_1] ID: [_2]' +=> 'Neue LON-CAPA-[_1]-ID: [_2]', + + 'Not available' +=> 'Nicht verfügbar', + + 'Post Announcement' +=> 'Bekanntmachung absenden', + + 'The folder name: "[_1]" is already in use for an existing folder.' +=> 'Der Verzeichnisname "[_1]" ist bereits in einem bestehendem Verzeichnis in Verwendung.', + + 'The folder name: "[_1]" is already used for one of the folders automatically generated by the system.' +=> 'Der Verzeichnisname "[_1]" ist bereits in einem systemgenerierten Verzeichnis in Verwendung.', + + 'Error - could not obtain lock on email folders record.' +=> 'Fehler: Sperrung des Nachrichtenverzeichnis-Datensatzes war nicht möglich.', + + 'The folder "[_1]" may not be deleted' +=> 'Das Verzeichnis "[_1]" kann nicht gelöscht werden', + + 'The folder "[_1]" does not exist so deletion is not required.' +=> 'Das Verzeichnis "[_1]" existiert nicht und braucht daher nicht gelöscht zu werden.', + + 'The folder "[_1]" contains messages so it may not be deleted.' +=> 'Das Verzeichnis "[_1]" enthält Nachrichten und kann daher nicht gelöscht werden.', + + 'Delete or move the messages to a different folder first.' +=> 'Löschen oder verschieben Sie die Nachrichten zunächst in ein anderes Verzeichnis.', + + 'The folder "[_1]" may not be renamed to "[_2]" as the new name you requested is an invalid name.' +=> 'Das Verzeichnis "[_1]" kann nicht in "[_2]" umbenannt werden, da der neue Name ungültig ist.', + + 'The folder "[_1]" may not be renamed to "[_2]" as the new name you requested is reserved for folders provided automatically by the system.' +=> 'Das Verzeichnis "[_1]" kann nicht in "[_2]" umbenannt werden, da der neue Name für Verzeichnisse reserviert ist, die automatisch vom System angeboten werden.', + + 'The folder "[_1]" may not be renamed to "[_2]" because the new name you requested is already being used for an existing folder.' +=> 'Das Verzeichnis "[_1]" kann nicht in "[_2]" umbenannt werden, da der neue Name bereits für ein bestehendes Verzeichnis verwendet wird.', + + 'The folder "[_1]" could not be renamed to "[_2]" because the folder does not exist.' +=> 'Das Verzeichnis "[_1]" kann nicht in "[_2]" umbenannt werden, da das Verzeichnis "[_1]" nicht existiert.', + + 'Warning: failed to release lock for counter' +=> 'Warnung: Die Sperre für den Zähler konnte nicht freigegeben werden.', + + 'Message not moved, Attempted to move message to the same folder as it already is in.' +=> 'Die Nachricht wurde nicht verschoben, da sie in das gleiche Verzeichnis verschoben werden sollte, in dem sie sich bereits befindet.', + + 'Message not moved, A network error occurred.' +=> 'Die Nachricht wurde nicht verschoben, da ein Netzwerkfehler aufgetreten ist.', + + 'Message not moved as the message is no longer in the source folder.' +=> 'Die Nachricht wurde nicht verschoben, da sie sich nicht mehr im Quellverzeichnis befindet.', + + 'Message copied to new folder but status was not, A network error occurred.' +=> 'Die Nachricht wurde in das neue Verzeichnis kopiert, deren Status allerdings nicht, da ein Netzwerkproblem aufgetreten ist.', + + 'Message copied, but unable to delete the original from the source folder.' +=> 'Die Nachricht wurde kopiert, allerdings konnte das Original im Quellverzeichnis nicht entfernt werden.', + + 'Message copied, but unable to delete the original status from the source folder.' +=> 'Die Nachricht wurde kopiert, allerdings konnte der Originalstatus im Quellverzeichnis nicht entfernt werden.', + + 'Error: you must have a course role selected to be able to send a broadcast message to a group in the course.' +=> 'Fehler: Sie müssen zunächst eine Kursrolle auswählen, um Broadcast-Nachrichten an eine Kursgruppe senden zu können.', + + 'Error: could not determine domain or number of course' +=> 'Fehler: Weder die Domäne noch die Nummer des Kurses konnte ermittelt werden', + + 'Select message recipients from the group members listed below.' +=> 'Wählen Sie Nachrichtenempfänger von der unten angegebenen Gruppenmitgliederliste.', + + 'Send another group email' +=> 'Eine weitere Gruppen-Nachricht schicken', + + 'Return to group page' +=> 'Zurück zur Gruppenseite', + + 'Confirm Receipt and Reply' +=> 'Empfang bestätigen und antworten', + + 'You have to confirm that you have received this message before you can view other pages. After confirmation, this message will be moved to your regular inbox' +=> 'Sie müssen bestätigen, dass Sie diese Nachricht empfangen haben, bevor Sie Zugriff auf andere Seiten erhalten. Nach der Bestätigung wird diese Nachricht in Ihren Posteingang verschoben.', + + '[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages sent to you by other students between [_2] and [_3] is currently being blocked because of online exams.' +=> '[quant,_1,Nachricht ist, Nachrichten sind] nicht sichtbar, da die Anzeige von an Sie von anderen Studenten gesendeten LON-CAPA-Nachrichten zwischen [_2] und [_3] derzeit aufgrund von Online-Prüfungen gesperrt ist.', + + 'Each of the [quant,_1,message] you checked will be forwarded to the recipient(s) you select below.' +=> 'Jede der [quant,_1,Nachricht,Nachrichten], die Sie ausgewählt haben, wird an die Empfänger weitergeleitet, die Sie unten auswählen.', + + 'The message you checked will be forwarded to the recipient(s) you select below.' +=> 'Die Nachricht, die Sie ausgewählt haben, wird an die Empfänger weitergeleitet, die Sie unten auswählen.', + + 'Send Reply to' +=> 'Antworten senden an', + + 'Save message for re-use' +=> 'Nachricht zur Wiederverwendung speichern', + + 'Show re-usable messages' +=> 'Wiederverwendbare Nachrichten anzeigen', + + 'This message was designated by the sender not to allow replies.' +=> 'Der Absender dieser Nachricht hat festgelegt, dass auf diese Nachricht nicht geantwortet werden kann.', + + 'The sender did not designate a reply to address for this message.' +=> 'Der Absender hat keine Antwortadresse für diese Nachricht festgelegt.', + + 'Reply to other recipients' +=> 'Antwort an weitere Empfänger', + + 'Unless you choose otherwise:' +=> 'Sofern Sie nichts anderes auswählen, werden folgende Einstellungen verwendet:', + + "The subject in each forwarded message will be 'Forwarding:' followed by the original subject." +=> "Der Betreff in jeder weitergeleiteten Nachricht wird 'Weiterleitung:' sein, gefolgt vom ursprünglichen Betreff.", + + 'original subject' +=> 'ursprünglicher Betreff', + + "sender's name" +=> "Name des Absenders", + + 'Message begins with:' +=> 'Nachricht beginnt mit:', + + 'Any new text to display before the text of the original messages:' +=> 'Beliebiger neuer Text, der vor dem Text der Originalnachricht angezeigt werden soll:', + + 'username1:domain1: text' +=> 'Benutzername1:Domäne1: Text', + + 'username2:domain2: text' +=> 'Benutzername2:Domäne2: Text', + + 'username3:domain3: text' +=> 'Benutzername3:Domäne3: Text', + + "The messages will be assembled from all lines with the respective\nusername:domain, and appended to the general message text." +=> "Die Nachrichten werden aus allen Zeilen des jeweiligen Benutzers Benuterzname:Domäne zusammengestellt\nund zum allgemeinen Nachrichtentext hinzugefügt.", # ??? + + 'Not allowed' +=> 'Nicht zulässig', + + 'Archived Message' +=> 'Archivierte Nachrichten', + + '[quant,_1,communication blocking period was,communication blocking periods were] removed.' +=> '[quant,_1,Kommunikationsblockierungs-Zeitraum wurde,Kommunikationsblockierungs-Zeiträume wurden] entfernt.', + + '[quant,_1,communication blocking period was,communication blocking periods were] modified.' +=> '[quant,_1,Kommunikationsblockierungs-Zeitraum wurde,Kommunikationsblockierungs-Zeiträume wurden] geändert.', + + '[quant,_1,communication blocking period was,communication blocking periods were] added.' +=> '[quant,_1,Kommunikationsblockierungs-Zeitraum wurde,Kommunikationsblockierungs-Zeiträume wurden] hinzugefügt.', + + 'You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.' +=> 'Sie haben versucht eine Nachricht anzuzeigen, die momentan blockiert ist, da Sie einen oder mehre Kurse belegen, in denen eine Online-Prüfung stattfindet.', + + 'Reply To' +=> 'Antwort an', + + 'Current attempts of student (if applicable)' +=> 'Derzeitige Versuche des Studenten (falls verfügbar)', + + 'Current screen output (if applicable)' +=> 'Derzeitige Bildschirmausgabe (falls verfügbar)', + + 'No saved comments yet.' +=> 'Bisher keine gespeicherten Kommentare.', + + 'No saved comments yet for this resource.' +=> 'Bisher keine gespeicherten Kommentare für diese Ressource.', + + 'Could not deliver message' +=> 'Nachricht konnte nicht zugestellt werden.', + + 'Please use the browser "Back" button and correct the recipient addresses ([_1]).' +=> 'Bitte verwenden Sie den Zurück-Button des Webbrowsers und korrigieren Sie die Empfängeradressen ([_1]).', + + 'Failed to delete the message.' +=> 'Löschen der Nachricht ist fehlgeschlagen.', + + 'Marked [_1] message(s) read' +=> '[_1] Nachricht(en) als gelesen markiert', + + 'Marked [_1] message(s) Unread' +=> '[_1] Nachricht(en) als ungelesen markiert', + + 'Destination folder [_1] is not a valid folder' +=> 'Bei dem Zielverzeichnis [_1] handelt es sich um kein gültiges Verzeichnis.', + + 'Failed to move [_1] message(s)' +=> '[_1] Nachricht(en) konnte(n) nicht verschoben werden.', + + 'Moved [_1] message(s)' +=> '[_1] Nachricht(en) wurde(n) verschoben.', + + 'Failed to delete [_1] message(s)' +=> '[_1] Nachricht(en) konnte(n) nicht gelöscht werden.', + + 'Deleted [_1] message(s)' +=> '[_1] Nachricht(en) wurde(n) gelöscht.', + + '[quant,_1,message] forwarded.' +=> '[quant,_1,Nachricht] weitergeleitet.', + + 'Could not forward [quant,_1,message].' +=> '[quant,_1,Nachricht] konnte nicht nicht weitergeleitet werden.', + + 'Could not deliver forwarded message.' +=> 'Weitergeleitetet Nachricht konnte nicht zugestellt werden.', + + 'The recipient addresses may need to be corrected' +=> 'Die Empfängeradressesn mussen korrigiert werden', + + 'Mail folder "[_1]" created.' +=> 'Das Nachrichtenverzeichnis "[_1]" wurde angelegt.', + + 'Creation failed.' +=> 'Anlegen fehlgeschlagen.', + + 'Mail folder "[_1]" deleted.' +=> 'Das Nachrichtenverzeichnis "[_1]" wurde gelöscht.', + + 'Deletion failed.' +=> 'Löschen fehlgeschlagen.', + + 'Mail folder "[_1]" renamed "[_2]".' +=> 'Das Nachrichtenverzeichnis "[_1]" wurde umbenannt in "[_2]".', + + 'Renaming failed.' +=> 'Umbenennen fehlgeschlagen.', + + 'Messages' +=> 'Nachrichten', + + 'Distribute from Uploaded File' +=> 'Hochgeladene Datei verteilen', # ??? + + 'Communication Blocking' +=> 'Kommunikations-Blockierung', + + 'Deleted Message' +=> 'Gelöschte Nachrichten', + + 'Marked Messages Read' +=> 'Nachrichten als gelesen gekennzeichnet', + + 'Marked Messages Unread' +=> 'Nachrichten als ungelesen gekennzeichnet', + + 'Moved Messages' +=> 'Nachrichten verschoben', + + 'Deleted Messages' +=> 'Nachrichten gelöscht', + + 'Marked Message as Unread' +=> 'Nachrichten als ungelesen gekennzeichnet', + + 'Deleted Folder' +=> 'Verzeichnis gelöscht', + + 'Renamed Folder' +=> 'Verzeichnis umbenannt', + + 'username:domain,username:domain,...' +=> 'Benutzername:Domäne,Benutzername:Domäne,...', + '' => '', --bisitz1203704632-- From lon-capa-cvs-allow@mail.lon-capa.org Fri Feb 22 19:22:22 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (riegler) Date: Fri, 22 Feb 2008 19:22:22 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /html/adm/help/tex Statistics_Overall_Key.tex Message-ID: riegler Fri Feb 22 14:22:22 2008 EDT Modified files: /loncom/html/adm/help/tex Statistics_Overall_Key.tex Log: wrong KR-21 formula Index: loncom/html/adm/help/tex/Statistics_Overall_Key.tex diff -u loncom/html/adm/help/tex/Statistics_Overall_Key.tex:1.9 loncom/html/adm/help/tex/Statistics_Overall_Key.tex:1.10 --- loncom/html/adm/help/tex/Statistics_Overall_Key.tex:1.9 Tue Aug 7 17:29:16 2007 +++ loncom/html/adm/help/tex/Statistics_Overall_Key.tex Fri Feb 22 14:22:21 2008 @@ -77,7 +77,7 @@ To compute the KR-21 reliability statistic the following formula is used: -\[KR-21 = \frac{K}{K-1} \cdot \frac{1-(M \cdot (K-M))}{K \cdot s^{2}}\] +\[KR-21 = \frac{K}{K-1} \cdot \left(1- \frac{M \cdot (K-M)}{K \cdot s^{2}} \right)\] Where \begin{description} From lon-capa-cvs-allow@mail.lon-capa.org Sun Feb 24 22:59:21 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn) Date: Sun, 24 Feb 2008 22:59:21 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / lond /enrollment localenroll.pm /interface loncommon.pm /lonnet/perl lonnet.pm Message-ID: This is a MIME encoded message --raeburn1203893961 Content-Type: text/plain raeburn Sun Feb 24 17:59:21 2008 EDT Modified files: /loncom lond /loncom/interface loncommon.pm /loncom/lonnet/perl lonnet.pm /loncom/enrollment localenroll.pm Log: lond::validate_user() - optional fourth and fifth arguments added in lond 1.395, replaced with a single optional argument ($checkdefauth). If true, default auth type and args retrieved using lonnet::get_domain_defaults(). - Default authentication type and argument, and language in a domain can be retrieved from lonnet::get_domain_defaults(). - lonnet::inst_rulecheck() can check format rules for e-mail addresses proposed as usernames for self-enrollment - lonnet::inst_userrules() can retrieve rule definitions for e-mail addresses used as usernames - loncommon::get_auth_defaults() eliminated. lonnet::get_domain_defaults() used instead - loncommon::preferred_languages() streamlined. - localenroll::selfenroll_rules() and localenroll::selfenroll_check() added to define rules for e-mail addresses which may not be used as usernames, and to check a proposed self-enrollment username (i.e., e-mail address) against the rules in force. --raeburn1203893961 Content-Type: text/plain Content-Disposition: attachment; filename="raeburn-20080224175921.txt" Index: loncom/lond diff -u loncom/lond:1.395 loncom/lond:1.396 --- loncom/lond:1.395 Thu Feb 21 11:04:19 2008 +++ loncom/lond Sun Feb 24 17:59:06 2008 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.395 2008/02/21 16:04:19 raeburn Exp $ +# $Id: lond,v 1.396 2008/02/24 22:59:06 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,7 +59,7 @@ my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.395 $'; #' stupid emacs +my $VERSION='$Revision: 1.396 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -1514,16 +1514,15 @@ # udom - User's domain. # uname - Username. # upass - User's password. - # defauthtype - Default authentication types for the domain - # defautharg - Default authentication arg for the domain + # checkdefauth - Pass to validate_user() to try authentication + # with default auth type(s) if no user account. - my ($udom,$uname,$upass,$defauthtype,$defautharg)=split(/:/,$tail); + my ($udom, $uname, $upass, $checkdefauth)=split(/:/,$tail); &Debug(" Authenticate domain = $udom, user = $uname, password = $upass"); chomp($upass); $upass=&unescape($upass); - my $pwdcorrect = &validate_user($udom,$uname,$upass,$defauthtype, - $defautharg); + my $pwdcorrect = &validate_user($udom,$uname,$upass,$checkdefauth); if($pwdcorrect) { &Reply( $client, "authorized\n", $userinput); # @@ -4704,6 +4703,40 @@ } ®ister_handler("instidrules",\&get_institutional_id_rules,0,1,0); +sub get_institutional_selfenroll_rules { + my ($cmd, $tail, $client) = @_; + my $userinput = "$cmd:$tail"; + my $dom = &unescape($tail); + my (%rules_hash,@rules_order); + my $outcome; + eval { + local($SIG{__DIE__})='DEFAULT'; + $outcome = &localenroll::selfenroll_rules($dom,\%rules_hash,\@rules_order); + }; + if (!$@) { + if ($outcome eq 'ok') { + my $result; + foreach my $key (keys(%rules_hash)) { + $result .= &escape($key).'='.&Apache::lonnet::freeze_escape($rules_hash{$key}).'&'; + } + $result =~ s/\&$//; + $result .= ':'; + if (@rules_order > 0) { + foreach my $item (@rules_order) { + $result .= &escape($item).'&'; + } + } + $result =~ s/\&$//; + &Reply($client,\$result,$userinput); + } else { + &Reply($client,"error\n", $userinput); + } + } else { + &Failure($client,"unknown_cmd\n",$userinput); + } +} +®ister_handler("instemailrules",\&get_institutional_selfenroll_rules,0,1,0); + sub institutional_username_check { my ($cmd, $tail, $client) = @_; @@ -4763,6 +4796,35 @@ } ®ister_handler("instidrulecheck",\&institutional_id_check,0,1,0); +sub institutional_selfenroll_check { + my ($cmd, $tail, $client) = @_; + my $userinput = "$cmd:$tail"; + my %rulecheck; + my $outcome; + my ($udom,$email,@rules) = split(/:/,$tail); + $udom = &unescape($udom); + $email = &unescape($email); + @rules = map {&unescape($_);} (@rules); + eval { + local($SIG{__DIE__})='DEFAULT'; + $outcome = &localenroll::selfenroll_check($udom,$email,\@rules,\%rulecheck); + }; + if (!$@) { + if ($outcome eq 'ok') { + my $result=''; + foreach my $key (keys(%rulecheck)) { + $result.=&escape($key).'='.&Apache::lonnet::freeze_escape($rulecheck{$key}).'&'; + } + &Reply($client,\$result,$userinput); + } else { + &Reply($client,"error\n", $userinput); + } + } else { + &Failure($client,"unknown_cmd\n",$userinput); + } +} +®ister_handler("instselfenrollcheck",\&institutional_selfenroll_check,0,1,0); + # Get domain specific conditions for import of student photographs to a course # # Retrieves information from photo_permission subroutine in localenroll. @@ -5973,7 +6035,7 @@ # 0 - The domain,user,password triplet is not a valid user. # sub validate_user { - my ($domain, $user, $password, $defauthtype, $defautharg) = @_; + my ($domain, $user, $password, $checkdefauth) = @_; # Why negative ~pi you may well ask? Well this function is about # authentication, and therefore very important to get right. @@ -5997,13 +6059,17 @@ my $null = pack("C",0); # Used by kerberos auth types. if ($howpwd eq 'nouser') { - if ($defauthtype eq 'localauth') { - $howpwd = $defauthtype; - $contentpwd = $defautharg; - } elsif ((($defauthtype eq 'krb4') || ($defauthtype eq 'krb5')) && - ($defautharg ne '')) { - $howpwd = $defauthtype; - $contentpwd = $defautharg; + if ($checkdefauth) { + my %domdefaults = &Apache::lonnet::get_domain_defaults($domain); + if ($domdefaults{'auth_def'} eq 'localauth') { + $howpwd = $domdefaults{'auth_def'}; + $contentpwd = $domdefaults{'auth_arg_def'}; + } elsif ((($domdefaults{'auth_def'} eq 'krb4') || + ($domdefaults{'auth_def'} eq 'krb5')) && + ($domdefaults{'auth_arg_def'} ne '')) { + $howpwd = $domdefaults{'auth_def'}; + $contentpwd = $domdefaults{'auth_arg_def'}; + } } } if ($howpwd ne 'nouser') { Index: loncom/interface/loncommon.pm diff -u loncom/interface/loncommon.pm:1.640 loncom/interface/loncommon.pm:1.641 --- loncom/interface/loncommon.pm:1.640 Wed Feb 13 07:41:11 2008 +++ loncom/interface/loncommon.pm Sun Feb 24 17:59:13 2008 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.640 2008/02/13 12:41:11 bisitz Exp $ +# $Id: loncommon.pm,v 1.641 2008/02/24 22:59:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2242,42 +2242,6 @@ } ############################################################### -## Get Authentication Defaults for Domain ## -############################################################### - -=pod - -=head1 Domains and Authentication - -Returns default authentication type and an associated argument as -listed in file 'domain.tab'. - -=over 4 - -=item * get_auth_defaults - -get_auth_defaults($target_domain) returns the default authentication -type and an associated argument (initial password or a kerberos domain). -These values are stored in lonTabs/domain.tab - -($def_auth, $def_arg) = &get_auth_defaults($target_domain); - -If target_domain is not found in domain.tab, returns nothing (''). - -=cut - -#------------------------------------------- -sub get_auth_defaults { - my $domain=shift; - return (&Apache::lonnet::domain($domain,'auth_def'), - &Apache::lonnet::domain($domain,'auth_arg_def')); - -} -############################################################### -## End Get Authentication Defaults for Domain ## -############################################################### - -############################################################### ## Get Kerberos Defaults for Domain ## ############################################################### ## @@ -2292,8 +2256,8 @@ =item * get_kerberos_defaults get_kerberos_defaults($target_domain) returns the default kerberos -version and domain. If not found in domain.tabs, it defaults to -version 4 and the domain of the server. +version and domain. If not found, it defaults to version 4 and the +domain of the server. ($def_version, $def_krb_domain) = &get_kerberos_defaults($target_domain); @@ -2302,9 +2266,12 @@ #------------------------------------------- sub get_kerberos_defaults { my $domain=shift; - my ($krbdef,$krbdefdom) = - &Apache::loncommon::get_auth_defaults($domain); - unless ($krbdef =~/^krb/ && $krbdefdom) { + my ($krbdef,$krbdefdom); + my %domdefaults = &Apache::lonnet::get_domain_defaults($domain); + if (($domdefaults{'auth_def'} =~/^krb(4|5)$/) && ($domdefaults{'auth_arg_def'} ne '')) { + $krbdef = $domdefaults{'auth_def'}; + $krbdefdom = $domdefaults{'auth_arg_def'}; + } else { $ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/; my $krbdefdom=$1; $krbdefdom=~tr/a-z/A-Z/; @@ -2883,21 +2850,15 @@ map { (split(/\s*;\s*/,$_))[0] } (split(/\s*,\s*/,$browser)); push(@languages,@browser); } - if (&Apache::lonnet::domain($env{'user.domain'},'lang_def')) { - @languages=(@languages, - &Apache::lonnet::domain($env{'user.domain'}, - 'lang_def')); - } - if (&Apache::lonnet::domain($env{'request.role.domain'},'lang_def')) { - @languages=(@languages, - &Apache::lonnet::domain($env{'request.role.domain'}, - 'lang_def')); - } - if (&Apache::lonnet::domain($Apache::lonnet::perlvar{'lonDefDomain'}, - 'lang_def')) { - @languages=(@languages, - &Apache::lonnet::domain($Apache::lonnet::perlvar{'lonDefDomain'}, - 'lang_def')); + + foreach my $domtype ($env{'user.domain'},$env{'request.role.domain'}, + $Apache::lonnet::perlvar{'lonDefDomain'}) { + if ($domtype ne '') { + my %domdefs = &Apache::lonnet::get_domain_defaults($domtype); + if ($domdefs{'lang_def'} ne '') { + push(@languages,$domdefs{'lang_def'}); + } + } } # turn "en-ca" into "en-ca,en" my @genlanguages; Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.942 loncom/lonnet/perl/lonnet.pm:1.943 --- loncom/lonnet/perl/lonnet.pm:1.942 Thu Feb 21 05:04:35 2008 +++ loncom/lonnet/perl/lonnet.pm Sun Feb 24 17:59:17 2008 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.942 2008/02/21 10:04:35 foxr Exp $ +# $Id: lonnet.pm,v 1.943 2008/02/24 22:59:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1064,6 +1064,10 @@ $response=&unescape(&reply('instidrulecheck:'.&escape($udom). ':'.&escape($id).':'.$rulestr, $homeserver)); + } elsif ($item eq 'selfenroll') { + $response=&unescape(&reply('instselfenrollcheck:'. + &escape($udom).':'.&escape($uname). + ':'.$rulestr,$homeserver)); } if ($response ne 'refused') { my @pairs=split(/\&/,$response); @@ -1090,6 +1094,9 @@ if ($check eq 'id') { $response=&reply('instidrules:'.&escape($udom), $homeserver); + } elsif ($check eq 'email') { + $response=&reply('instemailrules:'.&escape($udom), + $homeserver); } else { $response=&reply('instuserrules:'.&escape($udom), $homeserver); @@ -1115,6 +1122,35 @@ return (\%ruleshash,\@ruleorder); } +# ------------------------- Get Authentication and Language Defaults for Domain + +sub get_domain_defaults { + my ($domain) = @_; + my $cachetime = 60*60*24; + my ($defauthtype,$defautharg,$deflang); + my ($result,$cached)=&is_cached_new('domdefaults',$domain); + if (defined($cached)) { + if (ref($result) eq 'HASH') { + return %{$result}; + } + } + my %domdefaults; + my %domconfig = + &Apache::lonnet::get_dom('configuration',['defaults'],$domain); + if (ref($domconfig{'defaults'}) eq 'HASH') { + $domdefaults{'lang_def'} = $domconfig{'defaults'}{'lang_def'}; + $domdefaults{'auth_def'} = $domconfig{'defaults'}{'auth_def'}; + $domdefaults{'auth_arg_def'} = $domconfig{'defaults'}{'auth_arg_def'}; + } else { + $domdefaults{'lang_def'} = &domain($domain,'lang_def'); + $domdefaults{'auth_def'} = &domain($domain,'auth_def'); + $domdefaults{'auth_arg_def'} = &domain($domain,'auth_arg_def'); + } + &Apache::lonnet::do_cache_new('domdefaults',$domain,\%domdefaults, + $cachetime); + return %domdefaults; +} + # --------------------------------------------------- Assign a key to a student sub assign_access_key { @@ -9362,6 +9398,18 @@ domain level either on specified domain server ($uhome) or primary domain server ($udom and $uhome are optional) +=item * + +get_domain_defaults($target_domain) : returns hash with defaults for +authentication and language in the domain. Keys are: auth_def, auth_arg_def, +lang_def; corresponsing values are authentication type (internal, krb4, krb5, +or localauth), initial password or a kerberos realm, language (e.g., en-us). +Values are retrieved from cache (if current), or from domain's configuration.db +(if available), or lastly from values in lonTabs/dns_domain,tab, +or lonTabs/domain.tab. + +%domdefaults = &get_auth_defaults($target_domain); + =back =head2 Network Status Functions Index: loncom/enrollment/localenroll.pm diff -u loncom/enrollment/localenroll.pm:1.29 loncom/enrollment/localenroll.pm:1.30 --- loncom/enrollment/localenroll.pm:1.29 Thu Jan 3 18:28:33 2008 +++ loncom/enrollment/localenroll.pm Sun Feb 24 17:59:20 2008 @@ -1,6 +1,6 @@ # functions to glue school database system into Lon-CAPA for # automated enrollment -# $Id: localenroll.pm,v 1.29 2008/01/03 23:28:33 raeburn Exp $ +# $Id: localenroll.pm,v 1.30 2008/02/24 22:59:20 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -648,7 +648,6 @@ # # (c) $rulesorder - reference to array containing rule names # in order to be displayed - # # returns 'ok' if no processing error. # @@ -661,6 +660,33 @@ } ############################### +# sub selfenroll_rules +# +# Incoming data: three arguments +# (a) $dom - domain +# (b) $ruleshash - reference to hash containing rules +# (a hash of a hash) +# keys of top level hash are short names +# (e.g., netid) +# for each key, value is a hash +# desc => long name for rule +# rule => description of rule +# +# (c) $rulesorder - reference to array containing rule names +# in order to be displayed +# +# returns 'ok' if no processing error. +# +############################### + + +sub selfenroll_rules { + my ($dom,$ruleshash,$rulesorder) = @_; + my $outcome; + return $outcome; +} + +############################### # sub username_check # # Incoming data: four arguments @@ -705,6 +731,28 @@ } ############################### +# sub selfenroll_check +# +# Incoming data: four arguments +# (a) $dom - domain (scalar) +# (b) $selfenrollname - e-mail proposed as username (compare against rules - scalar) +# (c) $to_check (reference to array of rule names to check) +# (d) $resultshash (reference to hash of results) +# hash of results for rule checked +# - keys are rule names +# - values are: 1 or 0 (for matched or unmatched) +# +# returns 'ok' if no processing error. +# +############################### + +sub selfenroll_check { + my ($dom,$selfenrollname,$to_check,$resultshash) = @_; + my $outcome; + return $outcome; +} + +############################### # sub AUTOLOAD # # Incoming data: none --raeburn1203893961-- From lon-capa-cvs-allow@mail.lon-capa.org Sun Feb 24 23:18:40 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn) Date: Sun, 24 Feb 2008 23:18:40 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /auth lonlogin.pm /interface domainprefs.pm Message-ID: This is a MIME encoded message --raeburn1203895120 Content-Type: text/plain raeburn Sun Feb 24 18:18:40 2008 EDT Modified files: /loncom/auth lonlogin.pm /loncom/interface domainprefs.pm Log: - can add a "New User?" link to the log-in page to allow users with out LON-CAPA accounts to create them - Default authentication type, argument and language configurable via "Domain Configuration" interface (supercede domain.tab). - when these domain defaults are changed an e-mail is sent to LON-CAPA cluster administrator so dns_domain.tab can be updated to support LON-CAPA versions: 2.4, 2.5 and 2.6. - Ability to enable/disable format rules for users self-enrolling wth e-mail addresses. - Ability to determine types of usernames which may be created when self-enrolling (e-mail address, institutional logon, SSO, any, or none. --raeburn1203895120 Content-Type: text/plain Content-Disposition: attachment; filename="raeburn-20080224181840.txt" Index: loncom/auth/lonlogin.pm diff -u loncom/auth/lonlogin.pm:1.100 loncom/auth/lonlogin.pm:1.101 --- loncom/auth/lonlogin.pm:1.100 Thu Jan 24 10:06:21 2008 +++ loncom/auth/lonlogin.pm Sun Feb 24 18:18:37 2008 @@ -1,7 +1,7 @@ # The LearningOnline Network # Login Screen # -# $Id: lonlogin.pm,v 1.100 2008/01/24 15:06:21 bisitz Exp $ +# $Id: lonlogin.pm,v 1.101 2008/02/24 23:18:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -263,6 +263,8 @@ my $showcoursecat = &Apache::loncommon::designparm('login.coursecatalog',$domain); my $loginheader =&Apache::loncommon::designparm('login.loginheader',$domain); + my $shownewuserlink = + &Apache::loncommon::designparm('login.newuser',$domain); my $now=time; my $js = (< 'Server Administration', 'helpdesk' => 'Contact Helpdesk', 'forgotpw' => 'Forgot password?', + 'newuser' => 'New User?', 'options_headline' => 'Select Accessibility Options', 'sprs_img' => 'Suppress rendering of images', 'sprs_applet' => 'Suppress Java applets', @@ -396,6 +399,10 @@ if (($showcoursecat eq '') || ($showcoursecat)) { $coursecatalog = &coursecatalog_link($lt{'catalog'}); } + my $newuserlink; + if ($shownewuserlink) { + $newuserlink = &newuser_link($lt{'newuser'}); + } if ($fullgraph) { $r->print(< @@ -523,6 +530,8 @@ $loginhelp $forgotpw + $newuserlink +
@@ -667,7 +676,7 @@ my (%lt) = @_; my $prompt_for_resetpw = 1; if ($prompt_for_resetpw) { - return '
   
'.$lt{'forgotpw'}.'

'; + return '
   '.$lt{'forgotpw'}.'
'; } return; } @@ -691,5 +700,10 @@ END } +sub newuser_link { + my ($linkname) = @_; + return '   '.$linkname.'
'; +} + 1; __END__ Index: loncom/interface/domainprefs.pm diff -u loncom/interface/domainprefs.pm:1.42 loncom/interface/domainprefs.pm:1.43 --- loncom/interface/domainprefs.pm:1.42 Fri Feb 15 12:02:31 2008 +++ loncom/interface/domainprefs.pm Sun Feb 24 18:18:40 2008 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.42 2008/02/15 17:02:31 raeburn Exp $ +# $Id: domainprefs.pm,v 1.43 2008/02/24 23:18:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,9 +36,11 @@ use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonlocal; +use Apache::lonmsg(); use LONCAPA(); use LONCAPA::Enrollment; use File::Copy; +use Locale::Language; sub handler { my $r=shift; @@ -68,8 +70,8 @@ my %domconfig = &Apache::lonnet::get_dom('configuration',['login','rolecolors', 'quotas','autoenroll','autoupdate','directorysrch', - 'usercreation','usermodification','contacts'],$dom); - my @prefs_order = ('rolecolors','login','quotas','autoenroll', + 'usercreation','usermodification','contacts','defaults'],$dom); + my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', 'autoupdate','directorysrch','contacts', 'usercreation','usermodification'); my %prefs = ( @@ -91,6 +93,12 @@ header => [{col1 => 'Item', col2 => '',}], }, + 'defaults' => + { text => 'Default authentication/language', + help => '', + header => [{col1 => 'Setting', + col2 => 'Value'}], + }, 'quotas' => { text => 'Default quotas for user portfolios', help => 'Default_User_Quota', @@ -108,7 +116,7 @@ help => 'Domain_Auto_Update', header => [{col1 => 'Setting', col2 => 'Value',}, - {col1 => 'User Population', + {col1 => 'User population', col2 => 'Updataeable user data'}], }, 'directorysrch' => @@ -127,12 +135,12 @@ 'usercreation' => { text => 'User creation', help => 'Domain_User_Creation', - header => [{col1 => 'Format Rule Type', - col2 => 'Format Rules in force'}, + header => [{col1 => 'Format rule type', + col2 => 'Format rules in force'}, {col1 => 'User account creation', col2 => 'Usernames which may be created',}, {col1 => 'Context', - col2 => 'Assignable Authentication Types'}], + col2 => 'Assignable authentication types'}], }, 'usermodification' => { text => 'User modification', @@ -333,6 +341,8 @@ $output = &modify_usermodification($dom,%domconfig); } elsif ($action eq 'contacts') { $output = &modify_contacts($dom,%domconfig); + } elsif ($action eq 'defaults') { + $output = &modify_defaults($dom,$r); } return $output; } @@ -454,6 +464,8 @@ $output .= &print_directorysrch($dom,$settings,\$rowtotal); } elsif ($action eq 'contacts') { $output .= &print_contacts($dom,$settings,\$rowtotal); + } elsif ($action eq 'defaults') { + $output .= &print_defaults($dom,\$rowtotal); } } $output .= ' @@ -569,10 +581,11 @@ my ($dom,$confname,$phase,$settings,$rowtotal) = @_; my %choices = &login_choices(); my %defaultchecked = ( - 'coursecatalog' => 'on', - 'adminmail' => 'off', - ); - my @toggles = ('coursecatalog','adminmail'); + 'coursecatalog' => 'on', + 'adminmail' => 'off', + 'newuser' => 'off', + ); + my @toggles = ('coursecatalog','adminmail','newuser'); my (%checkedon,%checkedoff); foreach my $item (@toggles) { if ($defaultchecked{$item} eq 'on') { @@ -699,6 +712,7 @@ &Apache::lonlocal::texthash ( coursecatalog => 'Display Course Catalog link?', adminmail => "Display Administrator's E-mail Address?", + newuser => "Link to create a user account", img => "Header", logo => "Main Logo", domlogo => "Domain Logo", @@ -1479,13 +1493,23 @@ $rowcount ++; } } + my ($emailrules,$emailruleorder) = + &Apache::lonnet::inst_userrules($dom,'email'); + if (ref($emailrules) eq 'HASH') { + if (keys(%{$emailrules}) > 0) { + $datatable .= &user_formats_row('email',$settings,$emailrules, + $emailruleorder,$numinrow,$rowcount); + $$rowtotal ++; + $rowcount ++; + } + } if ($rowcount == 0) { $datatable .= ''.&mt('No format rules have been defined for usernames or IDs in this domain.').''; $$rowtotal ++; $rowcount ++; } } elsif ($position eq 'middle') { - my @creators = ('author','course'); + my @creators = ('author','course','selfenroll'); my ($rules,$ruleorder) = &Apache::lonnet::inst_userrules($dom,'username'); my %lt = &usercreation_types(); @@ -1507,7 +1531,11 @@ foreach my $item (@creators) { $rownum ++; if ($checked{$item} eq '') { - $checked{$item} = 'any'; + if ($item eq 'selfenroll') { + $checked{$item} = 'none'; + } else { + $checked{$item} = 'any'; + } } my $css_class; if ($rownum%2) { @@ -1519,9 +1547,13 @@ ''.$lt{$item}. ''; my @options = ('any'); - if (ref($rules) eq 'HASH') { - if (keys(%{$rules}) > 0) { - push(@options,('official','unofficial')); + if ($item eq 'selfenroll') { + push(@options,('email','login','sso')); + } else { + if (ref($rules) eq 'HASH') { + if (keys(%{$rules}) > 0) { + push(@options,('official','unofficial')); + } } } push(@options,'none'); @@ -1594,6 +1626,7 @@ my %text = ( 'username' => 'new usernames', 'id' => 'IDs', + 'email' => 'e-mail addresses of self-enrollers', ); my $css_class = $rowcount%2?' class="LC_odd_row"':''; $output = ''. @@ -1644,9 +1677,13 @@ my %lt = &Apache::lonlocal::texthash ( author => 'When adding a co-author', course => 'When adding a user to a course', + selfenroll => 'When a user is self-enrolling', any => 'Any', official => 'Institutional only ', unofficial => 'Non-institutional only', + email => 'Email address', + login => 'Institutional Login', + sso => 'SSO', none => 'None', ); return %lt; @@ -1697,6 +1734,61 @@ return $datatable; } +sub print_defaults { + my ($dom,$rowtotal) = @_; + my @items = ('auth_def','auth_arg_def','lang_def'); + my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); + my $titles = &defaults_titles(); + my $rownum = 0; + my ($datatable,$css_class); + foreach my $item (@items) { + if ($rownum%2) { + $css_class = ''; + } else { + $css_class = ' class="LC_odd_row" '; + } + $datatable .= ''. + ''.$titles->{$item}. + ''; + if ($item eq 'auth_def') { + my @authtypes = ('internal','krb4','krb5','localauth'); + my %shortauth = ( + internal => 'int', + krb4 => 'krb4', + krb5 => 'krb5', + localauth => 'loc' + ); + my %authnames = &authtype_names(); + foreach my $auth (@authtypes) { + my $checked = ' '; + if ($domdefaults{$item} eq $auth) { + $checked = ' checked="checked" '; + } + $datatable .= '  '; + } + } else { + $datatable .= ''; + } + $datatable .= ''; + $rownum ++; + } + $$rowtotal += $rownum; + return $datatable; +} + +sub defaults_titles { + my %titles = &Apache::lonlocal::texthash ( + 'auth_def' => 'Default authentication type', + 'auth_arg_def' => 'Default authentication argument', + 'lang_def' => 'Default language', + ); + return (\%titles); +} + + sub modifiable_userdata_row { my ($context,$role,$settings,$numinrow,$rowcount) = @_; my $rolename; @@ -1908,12 +2000,13 @@ my ($resulttext,$errors,$colchgtext,%changes,%colchanges); my %title = ( coursecatalog => 'Display course catalog', adminmail => 'Display administrator E-mail address', + newuser => 'Link for visitors to create a user account', loginheader => 'Log-in box header'); my @offon = ('off','on'); my %loginhash; ($errors,%colchanges) = &modify_colors($r,$dom,$confname,['login'], \%domconfig,\%loginhash); - my @toggles = ('coursecatalog','adminmail'); + my @toggles = ('coursecatalog','adminmail','newuser'); foreach my $item (@toggles) { $loginhash{login}{$item} = $env{'form.'.$item}; } @@ -1925,10 +2018,11 @@ my $putresult = &Apache::lonnet::put_dom('configuration',\%loginhash, $dom); if ($putresult eq 'ok') { - my @toggles = ('coursecatalog','adminmail'); + my @toggles = ('coursecatalog','adminmail','newuser'); my %defaultchecked = ( 'coursecatalog' => 'on', 'adminmail' => 'off', + 'newuser' => 'off', ); foreach my $item (@toggles) { if ($defaultchecked{$item} eq 'on') { @@ -3097,20 +3191,26 @@ sub modify_usercreation { my ($dom,%domconfig) = @_; my ($resulttext,%curr_usercreation,%changes,%authallowed,%cancreate); + my $warningmsg; if (ref($domconfig{'usercreation'}) eq 'HASH') { foreach my $key (keys(%{$domconfig{'usercreation'}})) { $curr_usercreation{$key} = $domconfig{'usercreation'}{$key}; } } - my %title = &Apache::lonlocal::texthash ( - author => 'adding co-authors/assistant authors', - course => 'adding users to a course', - ); my @username_rule = &Apache::loncommon::get_env_multiple('form.username_rule'); my @id_rule = &Apache::loncommon::get_env_multiple('form.id_rule'); - my @contexts = ('author','course'); + my @email_rule = &Apache::loncommon::get_env_multiple('form.email_rule'); + my @contexts = ('author','course','selfenroll'); foreach my $item(@contexts) { $cancreate{$item} = $env{'form.can_createuser_'.$item}; + if ($item eq 'selfenroll') { + my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); + if (!((($domdefaults{'auth_def'} =~/^krb/) && ($domdefaults{'auth_arg_def'} ne '')) || ($domdefaults{'auth_def'} eq 'localauth'))) { + if (($cancreate{$item} eq 'any') || ($cancreate{$item} eq 'login')) { + $warningmsg = &mt('Although account creation has been set to be available for institutional logins, currently default authentication in this domain has not been set to support this.').' '.&mt('You need to set the default authentication type to Kerberos 4 or 5 (with a Kerberos domain specified), or to Local authentication, if the localauth module has been customized in your domain to authenticate institutional logins.'); + } + } + } } if (ref($curr_usercreation{'cancreate'}) eq 'HASH') { foreach my $item (@contexts) { @@ -3120,7 +3220,7 @@ } } elsif (ref($curr_usercreation{'cancreate'}) eq 'ARRAY') { foreach my $item (@contexts) { - if (grep(/^\Q$item\E$/,@{$curr_usercreation{'cancreate'}})) { + if (!grep(/^\Q$item\E$/,@{$curr_usercreation{'cancreate'}})) { if ($cancreate{$item} ne 'any') { push(@{$changes{'cancreate'}},$item); } @@ -3131,7 +3231,7 @@ } } } else { - foreach my $item ('author','course') { + foreach my $item (@contexts) { push(@{$changes{'cancreate'}},$item); } } @@ -3166,10 +3266,25 @@ push(@{$changes{'id_rule'}},@id_rule); } - my @contexts = ('author','course','domain'); + if (ref($curr_usercreation{'email_rule'}) eq 'ARRAY') { + foreach my $type (@{$curr_usercreation{'email_rule'}}) { + if (!grep(/^\Q$type\E$/,@email_rule)) { + push(@{$changes{'email_rule'}},$type); + } + } + foreach my $type (@email_rule) { + if (!grep(/^\Q$type\E$/,@{$curr_usercreation{'email_rule'}})) { + push(@{$changes{'email_rule'}},$type); + } + } + } else { + push(@{$changes{'email_rule'}},@email_rule); + } + + my @authen_contexts = ('author','course','domain'); my @authtypes = ('int','krb4','krb5','loc'); my %authhash; - foreach my $item (@contexts) { + foreach my $item (@authen_contexts) { my @authallowed = &Apache::loncommon::get_env_multiple('form.'.$item.'_auth'); foreach my $auth (@authtypes) { if (grep(/^\Q$auth\E$/,@authallowed)) { @@ -3180,7 +3295,7 @@ } } if (ref($curr_usercreation{'authtypes'}) eq 'HASH') { - foreach my $item (@contexts) { + foreach my $item (@authen_contexts) { if (ref($curr_usercreation{'authtypes'}{$item}) eq 'HASH') { foreach my $auth (@authtypes) { if ($authhash{$item}{$auth} ne $curr_usercreation{'authtypes'}{$item}{$auth}) { @@ -3191,7 +3306,7 @@ } } } else { - foreach my $item (@contexts) { + foreach my $item (@authen_contexts) { push(@{$changes{'authtypes'}},$item); } } @@ -3201,6 +3316,7 @@ cancreate => \%cancreate, username_rule => \@username_rule, id_rule => \@id_rule, + email_rule => \@email_rule, authtypes => \%authhash, } ); @@ -3213,15 +3329,29 @@ if (ref($changes{'cancreate'}) eq 'ARRAY') { my %lt = &usercreation_types(); foreach my $type (@{$changes{'cancreate'}}) { - my $chgtext; - if ($cancreate{$type} eq 'none') { - $chgtext = $lt{$type}.' '.&mt('creation of new users is not permitted, except by a Domain Coordinator.'); - } elsif ($cancreate{$type} eq 'any') { - $chgtext = $lt{$type}.' '.&mt('creation of new users is permitted for both institutional and non-institutional usernames.'); - } elsif ($cancreate{$type} eq 'official') { - $chgtext = $lt{$type}.' '.&mt('creation of new users is only permitted for institutional usernames.',$lt{$type}); - } elsif ($cancreate{$type} eq 'unofficial') { - $chgtext = $lt{$type}.' '.&mt('creation of new users is only permitted for non-institutional usernames.',$lt{$type}); + my $chgtext = $lt{$type}.', '; + if ($type eq 'selfenroll') { + if ($cancreate{$type} eq 'none') { + $chgtext .= &mt('creation of a new user account is not permitted.'); + } elsif ($cancreate{$type} eq 'any') { + $chgtext .= &mt('creation of a new account is permitted for users authenticated by institutional log-in and SSO, and also for e-mail addresses used as usernames.'); + } elsif ($cancreate{$type} eq 'login') { + $chgtext .= &mt('creation of a new account is only permitted for users authenticated by institutional log-in.'); + } elsif ($cancreate{$type} eq 'sso') { + $chgtext .= &mt('creation of a new account is only permitted for users authenticated by institutional single sign on.'); + } elsif ($cancreate{$type} eq 'email') { + $chgtext .= &mt('creation of a new account is only permitted for users who provide a valid e-mail address for use as the username.'); + } + } else { + if ($cancreate{$type} eq 'none') { + $chgtext .= &mt('creation of new users is not permitted, except by a Domain Coordinator.'); + } elsif ($cancreate{$type} eq 'any') { + $chgtext .= &mt('creation of new users is permitted for both institutional and non-institutional usernames.'); + } elsif ($cancreate{$type} eq 'official') { + $chgtext .= &mt('creation of new users is only permitted for institutional usernames.'); + } elsif ($cancreate{$type} eq 'unofficial') { + $chgtext .= &mt('creation of new users is only permitted for non-institutional usernames.'); + } } $resulttext .= '
  • '.$chgtext.'
  • '; } @@ -3258,6 +3388,23 @@ $resulttext .= '
  • '.&mt('There are now no ID formats restricted to verified users in the institutional directory.').'
  • '; } } + if (ref($changes{'email_rule'}) eq 'ARRAY') { + my ($emailrules,$emailruleorder) = + &Apache::lonnet::inst_userrules($dom,'email'); + my $chgtext = '
      '; + foreach my $type (@email_rule) { + if (ref($emailrules->{$type}) eq 'HASH') { + $chgtext .= '
    • '.$emailrules->{$type}{'name'}.'
    • '; + } + } + $chgtext .= '
    '; + if (@email_rule > 0) { + $resulttext .= '
  • '.&mt('Accounts may not be created by users self-enrolling with e-mail addresses of the following types: ').$chgtext.'
  • '; + } else { + $resulttext .= '
  • '.&mt('There are now no restrictions on e-mail addresses which may be used as a username when self-enrolling.').'
  • '; + } + } + my %authname = &authtype_names(); my %context_title = &context_names(); if (ref($changes{'authtypes'}) eq 'ARRAY') { @@ -3270,7 +3417,11 @@ push(@allowed,$authname{$auth}); } } - $chgtext .= join(', ',@allowed).''; + if (@allowed > 0) { + $chgtext .= join(', ',@allowed).''; + } else { + $chgtext .= &mt('none').''; + } } $chgtext .= ''; $resulttext .= '
  • '.&mt('Authentication types available for assignment to new users').'
    '.$chgtext; @@ -3284,6 +3435,9 @@ $resulttext = ''. &mt('An error occurred: [_1]',$putresult).''; } + if ($warningmsg ne '') { + $resulttext .= '
    '.$warningmsg.'
    '; + } return $resulttext; } @@ -3387,4 +3541,91 @@ return $resulttext; } +sub modify_defaults { + my ($dom,$r) = @_; + my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors); + my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); + my @items = ('auth_def','auth_arg_def','lang_def'); + my @authtypes = ('internal','krb4','krb5','localauth'); + foreach my $item (@items) { + $newvalues{$item} = $env{'form.'.$item}; + if ($item eq 'auth_def') { + if ($newvalues{$item} ne '') { + if (!grep(/^\Q$newvalues{$item}\E$/,@authtypes)) { + push(@errors,$item); + } + } + } elsif ($item eq 'lang_def') { + if ($newvalues{$item} ne '') { + if ($newvalues{$item} =~ /^(\w+)/) { + my $langcode = $1; + if (code2language($langcode) eq '') { + push(@errors,$item); + } + } else { + push(@errors,$item); + } + } + } + if (grep(/^\Q$item\E$/,@errors)) { + $newvalues{$item} = $domdefaults{$item}; + } elsif ($domdefaults{$item} ne $newvalues{$item}) { + $changes{$item} = 1; + } + } + my %defaults_hash = ( + defaults => { auth_def => $newvalues{'auth_def'}, + auth_arg_def => $newvalues{'auth_arg_def'}, + lang_def => $newvalues{'lang_def'}, + } + ); + my $title = &defaults_titles(); + my $putresult = &Apache::lonnet::put_dom('configuration',\%defaults_hash, + $dom); + if ($putresult eq 'ok') { + if (keys(%changes) > 0) { + $resulttext = &mt('Changes made:').'
      '; + my $version = $r->dir_config('lonVersion'); + my $mailmsgtext = "Changes made to domain settings in a LON-CAPA installation - domain: $dom (running version: $version) - dns_domain.tab needs to be updated with the following changes, to support legacy 2.4, 2.5 and 2.6 versions of LON-CAPA.\n\n"; + foreach my $item (sort(keys(%changes))) { + my $value = $env{'form.'.$item}; + if ($value eq '') { + $value = &mt('none'); + } elsif ($item eq 'auth_def') { + my %authnames = &authtype_names(); + my %shortauth = ( + internal => 'int', + krb4 => 'krb4', + krb5 => 'krb5', + localauth => 'loc', + ); + $value = $authnames{$shortauth{$value}}; + } + $resulttext .= '
    • '.&mt('[_1] set to "[_2]"',$title->{$item},$value).'
    • '; + $mailmsgtext .= "$title->{$item} set to $value\n"; + } + $resulttext .= '
    '; + $mailmsgtext .= "\n"; + my $cachetime = 24*60*60; + &Apache::lonnet::do_cache_new('domdefaults',$dom, + $defaults_hash{'defaults'},$cachetime); + my $sysmail = $r->dir_config('lonSysEMail'); + &Apache::lonmsg::sendemail($sysmail,"LON-CAPA Domain Settings Change - $dom",$mailmsgtext); + } else { + $resulttext = &mt('No changes made to default authentication/language settings'); + } + } else { + $resulttext = ''. + &mt('An error occurred: [_1]',$putresult).''; + } + if (@errors > 0) { + $resulttext .= '
    '.&mt('The following were left unchanged because the values entered were invalid:'); + foreach my $item (@errors) { + $resulttext .= ' "'.$title->{$item}.'",'; + } + $resulttext =~ s/,$//; + } + return $resulttext; +} + 1; --raeburn1203895120-- From lon-capa-cvs-allow@mail.lon-capa.org Sun Feb 24 23:23:40 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn) Date: Sun, 24 Feb 2008 23:23:40 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface createaccount.pm Message-ID: This is a MIME encoded message --raeburn1203895420 Content-Type: text/plain raeburn Sun Feb 24 18:23:40 2008 EDT Added files: /loncom/interface createaccount.pm Log: Bug 5558. Visitors without a LON-CAPA account can create one, using an e-mail address (sends a URL to the address provided, which needs to be visited to complete the process), or an institutional login (authentication required). Requires Authen::Captcha perl module to discourage robotic account requests. Work in progress. --raeburn1203895420 Content-Type: text/plain Content-Disposition: attachment; filename="raeburn-20080224182340.txt" Index: loncom/interface/createaccount.pm +++ loncom/interface/createaccount.pm # The LearningOnline Network # Allow visitors to create a user account with the username being either an # institutional log-in ID (institutional authentication required - localauth # or kerberos) or an e-mail address. # # $Id: createaccount.pm,v 1.1 2008/02/24 23:23:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). # # LON-CAPA 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 2 of the License, or # (at your option) any later version. # # LON-CAPA 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 LON-CAPA; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # /home/httpd/html/adm/gpl.txt # # http://www.lon-capa.org/ # # package Apache::createaccount; use strict; use Apache::Constants qw(:common); use Apache::lonacc; use Apache::lonnet; use Apache::loncommon; use Apache::lonlocal; use Apache::resetpw; use Authen::Captcha; use DynaLoader; # for Crypt::DES version use Crypt::DES; use LONCAPA; sub handler { my $r = shift; &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; if ($r->header_only) { return OK; } my $domain = &Apache::lonnet::default_login_domain(); my $domdesc = &Apache::lonnet::domain($domain,'description'); my $start_page = &Apache::loncommon::start_page('Create a user account in LON-CAPA','', { 'no_inline_link' => 1,}); $r->print($start_page); &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb ({href=>"/adm/createuser", text=>"New username"}); my $contact_name = &mt('LON-CAPA helpdesk'); my $contact_email = $r->dir_config('lonSupportEMail'); my $lonhost = $r->dir_config('lonHostID'); my $include = $r->dir_config('lonIncludes'); &Apache::lonacc::get_posted_cgi($r); &Apache::lonlocal::get_language_handle($r); &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['token']); my $token = $env{'form.token'}; my $output; my $cancreate; my %domconfig = &Apache::lonnet::get_dom('configuration',['usercreation'],$domain); if (ref($domconfig{'usercreation'}) eq 'HASH') { if (ref($domconfig{'usercreation'}{'cancreate'}) eq 'HASH') { if ($domconfig{'usercreation'}{'cancreate'}{'selfenroll'} ne 'none') { $cancreate = $domconfig{'usercreation'}{'cancreate'}{'selfenroll'}; } } } $r->print(&Apache::lonhtmlcommon::breadcrumbs('Create account')); if (!$cancreate) { $output = &mt('Creation of a new user account using an e-mail address as username or a loginID from your institution is not permitted in the domain: [_1] ([_2])',$domain,$domdesc); } elsif ($token) { $output = &process_mailtoken($r,$token,$contact_name,$contact_email,$domain, $domdesc,$lonhost,$include); } elsif ($env{'form.create_with_email'}) { $output = &process_email_request($env{'form.useremail'},$domain,$domdesc, $contact_name,$contact_email,$cancreate, $lonhost,$domconfig{'usercreation'}); } elsif ($env{'form.phase'} eq 'username_validation') { $output = &username_validation($env{'form.uname'},$domain,$domdesc, $contact_name,$contact_email); } elsif ($env{'form.phase'} eq 'username_activation') { (my $result,$output) = &username_activation($env{'form.uname'}, $domain,$domdesc); } else { my $now=time; if ($cancreate eq 'any' || $cancreate eq 'login') { my $jsh=Apache::File->new($include."/londes.js"); $r->print(<$jsh>); $r->print(&javascript_setforms($now)); } $output = &print_username_form($domain,$domdesc,$cancreate,$now,$lonhost); } $r->print($output); $r->print(&Apache::loncommon::end_page()); return OK; } sub javascript_setforms { my ($now) = @_; my $js = < function send() { this.document.server.elements.uname.value = this.document.client.elements.uname.value; uextkey=this.document.client.elements.uextkey.value; lextkey=this.document.client.elements.lextkey.value; initkeys(); this.document.server.elements.upass.value = crypted(this.document.client.elements.upass$now.value); this.document.client.elements.uname.value=''; this.document.client.elements.upass$now.value=''; this.document.server.submit(); return false; } ENDSCRIPT return $js; } sub javascript_checkpass { my ($now) = @_; my $nopass = &mt('You must enter a password'); my $mismatchpass = &mt('The passwords you entered did not match.').'\\n'. &mt('Please try again.'); my $js = <<"ENDSCRIPT"; ENDSCRIPT return $js; } sub print_username_form { my ($domain,$domdesc,$cancreate,$now,$lonhost) = @_; my %lt = &Apache::lonlocal::texthash( unam => 'username', udom => 'domain', uemail => 'Email address in LON-CAPA', proc => 'Proceed'); my $output; if ($cancreate eq 'any' || $cancreate eq 'login') { my %domdefaults = &Apache::lonnet::get_domain_defaults($domain); if ((($domdefaults{'auth_def'} =~/^krb/) && ($domdefaults{'auth_arg_def'} ne '')) || ($domdefaults{'auth_def'} eq 'localauth')) { $output = '

    '.&mt('Create account with a username provided by your institution').'

    '; $output .= &mt('If you already have a Log-in ID at your institution, you may be able to use it[_1] for LON-CAPA.','
    ').' '.&mt('Type in your Log-in ID and password to find out.').'

    '; my ($lkey,$ukey) = &Apache::lonpreferences::des_keys(); my ($lextkey,$uextkey) = &getkeys($lkey,$ukey); my $logtoken=Apache::lonnet::reply('tmpput:'.$ukey.$lkey.'&createaccount', $lonhost); $output .= &serverform($logtoken,$lonhost); my $unameform = ''; my $upassform = ''; my $submit_text = &mt('Create LON-CAPA account'); $output .= '
    '."\n". &Apache::lonhtmlcommon::start_pick_box()."\n". &Apache::lonhtmlcommon::row_title(&mt('Log-in ID'), 'LC_pick_box_title')."\n". $unameform."\n". &Apache::lonhtmlcommon::row_closure(1)."\n". &Apache::lonhtmlcommon::row_title(&mt('Password'), 'LC_pick_box_title')."\n". $upassform."\n".'

    '."\n". ''."\n". &Apache::lonhtmlcommon::row_closure(1)."\n". &Apache::lonhtmlcommon::end_pick_box().'

    '."\n". ''."\n". ''."\n". '
    '; } } if (($cancreate eq 'any') || ($cancreate eq 'email')) { $output .= '

    '.&mt('Create account with an e-mail address as your username').'

    '; if ($cancreate eq 'any') { $output .= &mt('Provide your e-mail address to request a LON-CAPA account if you do not have [_1] a log-in ID at your institution.','
    ').'

    '; } elsif ($cancreate eq 'unofficial') { $output .= '
    '; } my $emailform = ''; my $captchaform = &create_captcha(); my $submit_text = &mt('Request LON-CAPA account'); $output .= '
    '. &Apache::lonhtmlcommon::start_pick_box()."\n". &Apache::lonhtmlcommon::row_title(&mt('E-mail address'), 'LC_pick_box_title')."\n". $emailform."\n". &Apache::lonhtmlcommon::row_closure(1). &Apache::lonhtmlcommon::row_title(&mt('Validation'), 'LC_pick_box_title')."\n". $captchaform."\n".'

    '. ''. &Apache::lonhtmlcommon::row_closure(1). &Apache::lonhtmlcommon::end_pick_box().'

    '. '
    '; } if ($output eq '') { $output = &mt('Creation of a new user account using either an e-mail address or institutional log-in ID as your username is not permitted in the domain: [_1] ([_2])',$domain,$domdesc); } else { $output .= ''; } return $output; } sub process_email_request { my ($useremail,$domain,$domdesc,$contact_name,$contact_email,$cancreate, $server,$settings) = @_; my $useremail = $env{'form.useremail'}; my $output; if ($cancreate ne 'any' && $cancreate ne 'email') { $output = &invalid_state('noemails',$domdesc, $contact_name,$contact_email); return $output; } elsif ($useremail !~ /^[^\@]+\@[^\@]+\.[^\@\.]+$/) { $output = &invalid_state('baduseremail',$domdesc, $contact_name,$contact_email); return $output; } else { my $uhome = &Apache::lonnet::homeserver($useremail,$domain); if ($uhome ne 'no_host') { $output = &invalid_state('existinguser',$domdesc, $contact_name,$contact_email); return $output; } else { my $code = $env{'form.code'}; my $md5sum = $env{'form.crypt'}; my %captcha_params = &captcha_settings(); my $captcha = Authen::Captcha->new( output_folder => $captcha_params{'output_dir'}, data_folder => $captcha_params{'db_dir'}, ); my $captcha_chk = $captcha->check_code($code,$md5sum); my %captcha_hash = ( 0 => 'Code not checked (file error)', -1 => 'Failed: code expired', -2 => 'Failed: invalid code (not in database)', -3 => 'Failed: invalid code (code does not match crypt)', ); if ($captcha_chk != 1) { $output = &invalid_state('captcha',$domdesc,$contact_name, $contact_email,$captcha_hash{$captcha_chk}); return $output; } my (%rulematch,%inst_results,%curr_rules,%got_rules,%alerts); my $uhome=&Apache::lonnet::homeserver($useremail,$domain); if ($uhome eq 'no_host') { my $checkhash; my $checks = { 'username' => 1 }; $checkhash->{$useremail.':'.$domain} = { 'newuser' => 1, }; &Apache::loncommon::user_rule_check($checkhash,$checks, \%alerts,\%rulematch,\%inst_results,\%curr_rules, \%got_rules); if (ref($alerts{'useremail'}) eq 'HASH') { if (ref($alerts{'useremail'}{$domain}) eq 'HASH') { if ($alerts{'username'}{$domain}{$useremail}) { $output = &invalid_state('userrules',$domdesc, $contact_name,$contact_email); return $output; } } } my $format_msg = &guest_format_check($useremail,$domain,$cancreate, $settings); if ($format_msg) { $output = &invalid_state('userformat',$domdesc,$contact_name, $contact_email,$format_msg); return $output; } } } } $output = &send_token($domain,$useremail,$server,$domdesc,$contact_name, $contact_email); return $output; } sub send_token { my ($domain,$email,$server,$domdesc,$contact_name,$contact_email) = @_; my $msg = &mt('Thank you for your request to create a new LON-CAPA account.').'

    '; my $now = time; my %info = ('ip' => $ENV{'REMOTE_ADDR'}, 'time' => $now, 'domain' => $domain, 'username' => $email); my $token = &Apache::lonnet::tmpput(\%info,$server); if ($token !~ /^error/ && $token ne 'no_such_host') { my $esc_token = &escape($token); my $mailmsg = &mt('A request was submitted on [_1] for creation of a LON-CAPA account in the [_2] domain.',localtime(time),$domdesc).' '. &mt('To complete this process please open a web browser and enter the following ". "URL in the address/location box: ').&Apache::lonnet::absolute_url()."/adm/createaccount?token=$esc_token"; my $result = &Apache::resetpw::send_mail($domdesc,$email,$mailmsg,$contact_name, $contact_email); if ($result eq 'ok') { $msg .= &mt('A message has been sent to the e-mail address you provided.').'
    '.&mt('The message includes the web address for the link you will use to complete the account creation process.').'
    '.&mt("The link included in the message will be valid for the next [_1]two[_2] hours.",'',''); } else { $msg .= &mt('An error occurred when sending a message to the e-mail address you provided. Please contact the [_1] ([_2]) for assistance.',$contact_name,$contact_email); } } else { $msg .= &mt('An error occurred creating a token required for the account creation process. Please contact the [_1] ([_2]) for assistance.',$contact_name,$contact_email); } return $msg; } sub process_mailtoken { my ($r,$token,$contact_name,$contact_email,$domain,$domdesc,$lonhost,$include) = @_; my $msg; my %data = &Apache::lonnet::tmpget($token); my $now = time; if (keys(%data) == 0) { $msg = &mt('Sorry, the URL you provided to complete creation of a new LON-CAPA account was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a new request for account creation and follow the link to the new URL included in the e-mail that will be sent to you.'); return $msg; } if (($data{'time'} =~ /^\d+$/) && ($data{'domain'} ne '') && ($data{'username'} =~ /^[^\@]+\@[^\@]+\.[^\@\.]+$/)) { my $reqtime = localtime($data{'time'}); if ($now - $data{'time'} < 7200) { if ($env{'form.phase'} eq 'createaccount') { my ($result,$output) = &create_account($r,$domain,$lonhost,$token, $data{'username'},$domdesc); if ($result eq 'ok') { $msg = $output; my $delete = &Apache::lonnet::tmpdel($token); my $now = localtime(time); my $mailmsg = &mt('A LON-CAPA account in the [_1] domain has been created [_2] from IP address: [_3]. If you did not perform this action or authorize it, please contact the [_4] ([_5]).',$domdesc,$now,$ENV{'REMOTE_ADDR'},$contact_name,$contact_email)."\n"; my $mailresult = &Apache::resetpw::send_mail($domdesc,$data{'email'}, $mailmsg,$contact_name, $contact_email); if ($mailresult eq 'ok') { $msg .= &mt('An e-mail confirming creation of your new LON-CAPA account has been sent to [_1].',$data{'username'}); } else { $msg .= &mt('An error occurred when sending e-mail to [_1] confirming creation of your LON-CAPA account.',$data{'username'}); } $msg .= '

    '.&mt('Go to the login page.'); } else { $msg .= &mt('A problem occurred when attempting to create your new LON-CAPA account').'
    '.$output.&mt('Please contact the [_1] - ([_2]) for assistance.',$contact_name,$contact_email); } } else { $r->print(&mt('Please provide user information and a password for your new account.').'
    '.&mt('Your password, which must contain at least seven characters, will be sent to the LON-CAPA server in an encrypted form.').'
    '); &print_dataentry_form($r,$domain,$lonhost,$include,$token,$now,$data{'username'}); } } else { $msg = &mt('Sorry, the token generated when you requested creation of an account has expired. Please submit a new request, and follow the link to the web page included in the new e-mail that will be sent to you, to allow you to create the account.'); } } else { $msg .= &mt('Sorry, the URL generated when you requested creation of an accountcontained incomplete information. Please submit a new request for creation of an account, and use the new URL that will be sent to your e-mail address to complete the process.'); } return $msg; } sub print_dataentry_form { my ($r,$domain,$lonhost,$include,$mailtoken,$now,$username) = @_; my ($error,$output); if (open(my $jsh,"<$include/londes.js")) { while(my $line = <$jsh>) { $r->print($line); } close($jsh); $r->print(&javascript_setforms($now)."\n".&javascript_checkpass($now)); my ($lkey,$ukey) = &Apache::lonpreferences::des_keys(); my ($lextkey,$uextkey) = &getkeys($lkey,$ukey); my $logtoken=Apache::lonnet::reply('tmpput:'.$ukey.$lkey.'&createaccount', $lonhost); my @userinfo = ('firstname','middlename','lastname','generation','id', 'permanentemail'); my %lt=&Apache::lonlocal::texthash( 'pd' => "Personal Data", 'firstname' => "First Name", 'middlename' => "Middle Name", 'lastname' => "Last Name", 'generation' => "Generation", 'permanentemail' => "Permanent e-mail address", 'id' => "ID/Student Number", 'lg' => "Login Data" ); my %textboxsize = ( firstname => '15', middlename => '15', lastname => '15', generation => '5', id => '15', ); my $genhelp=&Apache::loncommon::help_open_topic('Generation'); $output = '

    '.$lt{'pd'}.'

    '. '
    '. &Apache::lonhtmlcommon::start_pick_box(); foreach my $item (@userinfo) { my $rowtitle = $lt{$item}; if ($item eq 'generation') { $rowtitle = $genhelp.$rowtitle; } $output .= &Apache::lonhtmlcommon::row_title($rowtitle,undef,'LC_oddrow_value')."\n"; if ($item eq 'permanentemail') { $output .= $username; } else { $output .= ''; } $output .= &Apache::lonhtmlcommon::row_closure(1); } $output .= &Apache::lonhtmlcommon::end_pick_box(); $output .= <<"ENDSERVERFORM";
    ENDSERVERFORM my $upassone = ''; my $upasstwo = ''; my $submit_text = &mt('Create LON-CAPA account'); $output .= '

    '.$lt{'lg'}.'

    '."\n". '
    '."\n". &Apache::lonhtmlcommon::start_pick_box()."\n". &Apache::lonhtmlcommon::row_title(&mt('Username'), 'LC_pick_box_title')."\n". $username."\n". &Apache::lonhtmlcommon::row_closure(1)."\n". &Apache::lonhtmlcommon::row_title(&mt('Password'), 'LC_pick_box_title')."\n". $upassone."\n". &Apache::lonhtmlcommon::row_closure(1)."\n". &Apache::lonhtmlcommon::row_title(&mt('Confirm password'), 'LC_pick_box_title')."\n". $upasstwo."\n". &Apache::lonhtmlcommon::row_closure(1)."\n". &Apache::lonhtmlcommon::end_pick_box()."\n". ''."\n". ''."\n". ''."\n". '
    '."\n". ''; $r->print($output); } else { $error = &mt('Could not load javascript file [_1]','londes.js'); $r->print($error); } return; } sub create_account { my ($r,$domain,$lonhost,$logtoken,$username,$domdesc) = @_; my ($retrieved,$output,$upass) = &process_credentials($env{'form.logtoken'}, $env{'form.serverid'}); # Error messages my $error = ''.&mt('Error').': '; my $end = '

    '; my $rtnlink = ''. &mt('Return to previous page').''. &Apache::loncommon::end_page(); if ($retrieved eq 'ok') { if ($env{'form.cid'} ne '') { my ($result,$userchkmsg) = &check_id($username,$domain,$domdesc); if ($result eq 'fail') { $output = $error.&mt('Invalid ID format').$end. $userchkmsg.$rtnlink; return ('fail',$output); } } } else { return ('fail',$error.$output.$end.$rtnlink); } # Call modifyuser my $result = &Apache::lonnet::modifyuser($domain,$username,$env{'form.cid'}, 'internal',$upass,$env{'form.cfirstname'}, $env{'form.cmiddlename'},$env{'form.clastname'}, $env{'form.cgeneration'},undef,undef,$username); $output = &mt('Generating user').': '.$result; my $uhome = &Apache::lonnet::homeserver($username,$domain); $output .= '
    '.&mt('Home server').': '.$uhome.' '. &Apache::lonnet::hostname($uhome).'

    '; return ('ok',$output); } sub username_validation { my ($username,$domain,$domdesc,$contact_name,$contact_email) = @_; my ($retrieved,$output,$upass); $username= &LONCAPA::clean_username($username); $domain = &LONCAPA::clean_domain($domain); my $uhome = &Apache::lonnet::homeserver($username,$domain); if ($uhome ne 'no_host') { $output = &invalid_state('existinguser',$domdesc, $contact_name,$contact_email); return $output; } ($retrieved,$output,$upass) = &process_credentials($env{'form.logtoken'}, $env{'form.serverid'}); if ($retrieved eq 'ok') { my $primlibserv = &Apache::lonnet::domain($domain,'primary'); my $authok; my %domdefaults = &Apache::lonnet::get_domain_defaults($domain); if ((($domdefaults{'auth_def'} =~/^krb(4|5)$/) && ($domdefaults{'auth_arg_def'} ne '')) || ($domdefaults{'auth_def'} eq 'localauth')) { my $checkdefauth = 1; $authok = &Apache::lonnet::reply("encrypt:auth:$domain:$username:$upass:$checkdefauth",$primlibserv); } else { $authok = 'non_authorized'; } if ($authok eq 'authorized') { my (%rulematch,%inst_results,$newuser,%alerts,%curr_rules,%got_rules); $newuser = 1; my $checkhash; my $checks = { 'username' => 1 }; $checkhash->{$username.':'.$domain} = { 'newuser' => $newuser }; &Apache::loncommon::user_rule_check($checkhash,$checks, \%alerts,\%rulematch,\%inst_results,\%curr_rules,\%got_rules); if (ref($alerts{'username'}) eq 'HASH') { if (ref($alerts{'username'}{$domain}) eq 'HASH') { if ($alerts{'username'}{$domain}{$username}) { my $userchkmsg; if (ref($curr_rules{$domain}) eq 'HASH') { $userchkmsg = &Apache::loncommon::instrule_disallow_msg('username', $domdesc,1). &Apache::loncommon::user_rule_formats($domain, $domdesc,$curr_rules{$domain}{'username'}, 'username'); } return $userchkmsg; } } } my $submit_text = &mt('Create LON-CAPA account'); $output = '
    '. &Apache::loncreateuser::personal_data_display($username,$domain,1, undef,$inst_results{$username.':'.$domain}). '

    '. ''. '
    '; } else { $output = &mt('Not authenticated').' '.&mt('Please check the username and password'); } } return $output; } sub username_activation { my ($username,$domain,$domdesc) = @_; my $output; my $error = ''.&mt('Error').': '; my $end = '

    '; my $rtnlink = ''. &mt('Return to previous page').''. &Apache::loncommon::end_page(); my %domdefaults = &Apache::lonnet::get_domain_defaults($domain); if ((($domdefaults{'auth_def'} =~/^krb(4|5)$/) && ($domdefaults{'auth_arg_def'} ne '')) || ($domdefaults{'auth_def'} eq 'localauth')) { if ($env{'form.cid'} ne '') { my ($result,$userchkmsg) = &check_id($username,$domain,$domdesc); if ($result eq 'fail') { $output = $error.&mt('Invalid ID format').$end. $userchkmsg.$rtnlink; return ('fail',$output); } } # Call modifyuser my $result = &Apache::lonnet::modifyuser($domain,$username,$env{'form.cid'}, $domdefaults{'auth_def'}, $domdefaults{'auth_arg_def'},$env{'form.cfirstname'}, $env{'form.cmiddlename'},$env{'form.clastname'}, $env{'form.cgeneration'},undef,undef, $env{'form.cpermanentemail'}); $output = &mt('Generating user').': '.$result; my $uhome = &Apache::lonnet::homeserver($username,$domain); $output .= '
    '.&mt('Home server').': '.$uhome.' '. &Apache::lonnet::hostname($uhome).'

    '; return ('ok',$output); } else { $output = &mt("User account creation is not available for the current default authentication type.\n"); return('fail',$output); } } sub check_id { my ($username,$domain,$domdesc) = @_; # Check ID format my (%alerts,%rulematch,%inst_results,%curr_rules,%checkhash); my %checks = ('id' => 1); %{$checkhash{$username.':'.$domain}} = ( 'newuser' => 1, 'id' => $env{'form.cid'}, ); &Apache::loncommon::user_rule_check(\%checkhash,\%checks,\%alerts, \%rulematch,\%inst_results,\%curr_rules); if (ref($alerts{'id'}) eq 'HASH') { if (ref($alerts{'id'}{$domain}) eq 'HASH') { if ($alerts{'id'}{$domain}{$env{'form.cid'}}) { my $userchkmsg; if (ref($curr_rules{$domain}) eq 'HASH') { $userchkmsg = &Apache::loncommon::instrule_disallow_msg('id', $domdesc,1). &Apache::loncommon::user_rule_formats($domain, $domdesc,$curr_rules{$domain}{'id'},'id'); } return ('fail',$userchkmsg); } } } return; } sub invalid_state { my ($error,$domdesc,$contact_name,$contact_email,$msgtext) = @_; my $msg; if ($error eq 'baduseremail') { $msg = &mt('The e-mail address you provided does not appear to be a valid address.'); } elsif ($error eq 'existinguser') { $msg = &mt('The e-mail address you provided is already in use as a username in this LON-CAPA domain.'); } elsif ($error eq 'userrules') { $msg = &mt('Username rules for this LON-CAPA domain do not allow the e-mail address you provided to be used as a username.'); } elsif ($error eq 'userformat') { $msg = &mt('The e-mail address you provided may not be used as a username in this LON-CAPA domain.'); } elsif ($error eq 'captcha') { $msg = &mt('Validation of the code your entered failed.'); } elsif ($error eq 'noemails') { $msg = &mt('Creation of a new user account using an e-mail address as username is not permitted in this LON-CAPA domain.'); } if ($msgtext) { $msg .= '
    '.$msgtext; } if ($contact_email ne '') { my $escuri = &HTML::Entities::encode('/adm/createaccount','&<>"'); $msg .= '
    '.&mt(' You may wish to contact the LON-CAPA helpdesk for the [_2] domain.',$escuri,$domdesc); } else { $msg .= '
    '.&mt(' You may wish to send an e-mail to the server administrator: [_1] for the [_2] domain.',$Apache::lonnet::perlvar{'AdminEmail'},$domdesc); } return $msg; } sub create_captcha { my ($output_dir,$db_dir) = @_; my %captcha_params = &captcha_settings(); my $captcha = Authen::Captcha->new( output_folder => $captcha_params{'output_dir'}, data_folder => $captcha_params{'db_dir'}, ); my $md5sum = $captcha->generate_code($captcha_params{'numchars'}); my $output = ''."\n". &mt('Type in the letters/numbers shown below').' '. '
    '. ''; return $output; } sub captcha_settings { my %captcha_params = ( output_dir => "/home/httpd/html/captcha", www_output_dir => "/captcha", db_dir => "/home/www/captchadb", numchars => '5', ); return %captcha_params; } sub getkeys { my ($lkey,$ukey) = @_; my $lextkey=hex($lkey); if ($lextkey>2147483647) { $lextkey-=4294967296; } my $uextkey=hex($ukey); if ($uextkey>2147483647) { $uextkey-=4294967296; } return ($lextkey,$uextkey); } sub serverform { my ($logtoken,$lonhost,$mailtoken) = @_; my $output .= < ENDSERVERFORM return $output; } sub process_credentials { my ($logtoken,$lonhost) = @_; my $tmpinfo=Apache::lonnet::reply('tmpget:'.$logtoken,$lonhost); my ($retrieved,$output,$upass); if (($tmpinfo=~/^error/) || ($tmpinfo eq 'con_lost')) { $output = &mt('Information needed to retrieve your log-in information is missing, inaccessible or expired.').'
    '.&mt('You may need to reload the previous page to obtain a new token.'); return ($retrieved,$output,$upass); } else { my $reply = &Apache::lonnet::reply('tmpdel:'.$logtoken,$lonhost); if ($reply eq 'ok') { $retrieved = 'ok'; } else { $output = &mt('Session could not be opened.'); } } my ($key,$caller)=split(/&/,$tmpinfo); if ($caller eq 'createaccount') { $upass = &Apache::lonpreferences::des_decrypt($key,$env{'form.upass'}); } else { $output = &mt('Unable to retrieve your log-in information - unexpected context'); } return ($retrieved,$output,$upass); } sub guest_format_check { my ($useremail,$domain,$cancreate,$settings) = @_; my ($login,$format_match,$format_msg,@user_rules); if (ref($settings) eq 'HASH') { if (ref($settings->{'email_rule'}) eq 'ARRAY') { push(@user_rules,@{$settings->{'email_rule'}}); } } if (@user_rules > 0) { my %rule_check = &Apache::lonnet::inst_rulecheck($domain,$useremail,undef, 'selfenroll',\@user_rules); if (keys(%rule_check) > 0) { foreach my $item (keys(%rule_check)) { if ($rule_check{$item}) { $format_match = 1; last; } } } } if ($format_match) { ($login) = ($useremail =~ /^([^\@]+)\@/); $format_msg = '
    '.&mt("Your e-mail address uses the same internet domain as your institution's LON-CAPA service.").'
    '.&mt('Creation of a LON-CAPA account with this type of e-mail address as username is not permitted.').'
    '; if ($cancreate eq 'any' || $cancreate eq 'login') { $format_msg .= &mt('You should request creation of a LON-CAPA account for a Log-in ID of "[_1]" at your institution instead.',$login).'
    '; } } return $format_msg; } 1; --raeburn1203895420-- From lon-capa-cvs-allow@mail.lon-capa.org Sun Feb 24 23:41:00 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn) Date: Sun, 24 Feb 2008 23:41:00 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf Message-ID: raeburn Sun Feb 24 18:41:00 2008 EDT Modified files: /loncom loncapa_apache.conf Log: Make createaccount.pm available - used for self-service account creation. Index: loncom/loncapa_apache.conf diff -u loncom/loncapa_apache.conf:1.170 loncom/loncapa_apache.conf:1.171 --- loncom/loncapa_apache.conf:1.170 Fri Oct 5 17:28:27 2007 +++ loncom/loncapa_apache.conf Sun Feb 24 18:41:00 2008 @@ -1,7 +1,7 @@ ## ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file ## -## $Id: loncapa_apache.conf,v 1.170 2007/10/05 21:28:27 albertel Exp $ +## $Id: loncapa_apache.conf,v 1.171 2008/02/24 23:41:00 raeburn Exp $ ## # @@ -1203,6 +1203,12 @@ ErrorDocument 500 /adm/errorhandler + +SetHandler perl-script +PerlHandler Apache::createaccount +ErrorDocument 500 /adm/errorhandler + + SetHandler perl-script PerlHandler Apache::londns From lon-capa-cvs-allow@mail.lon-capa.org Sun Feb 24 23:43:29 2008 From: lon-capa-cvs-allow@mail.lon-capa.org (raeburn) Date: Sun, 24 Feb 2008 23:43:29 -0000 Subject: [LON-CAPA-cvs] cvs: doc /loncapafiles loncapafiles.lpml Message-ID: raeburn Sun Feb 24 18:43:29 2008 EDT Modified files: /doc/loncapafiles loncapafiles.lpml Log: Make createaccount.pm available - used for self-service account creation. Index: doc/loncapafiles/loncapafiles.lpml diff -u doc/loncapafiles/loncapafiles.lpml:1.569 doc/loncapafiles/loncapafiles.lpml:1.570 --- doc/loncapafiles/loncapafiles.lpml:1.569 Mon Jan 21 02:42:35 2008 +++ doc/loncapafiles/loncapafiles.lpml Sun Feb 24 18:43:29 2008 @@ -2,7 +2,7 @@ "http://lpml.sourceforge.net/DTD/lpml.dtd"> - +