1: # The LearningOnline Network
2: # Login Screen
3: #
4: # $Id: lonlogin.pm,v 1.67 2005/06/14 20:09:13 albertel Exp $
5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
28:
29: package Apache::lonlogin;
30:
31: use strict;
32: use Apache::Constants qw(:common);
33: use CGI::Cookie();
34: use Apache::File ();
35: use Apache::lonnet;
36: use Apache::loncommon();
37: use Apache::lonauth();
38: use Apache::lonlocal;
39:
40: sub handler {
41: my $r = shift;
42: &Apache::loncommon::no_cache($r);
43: &Apache::lonlocal::get_language_handle($r);
44: &Apache::loncommon::content_type($r,'text/html');
45: $r->send_http_header;
46: return OK if $r->header_only;
47:
48:
49: # Are we re-routing?
50: if (-e '/home/httpd/html/lon-status/reroute.txt') {
51: &Apache::lonauth::reroute($r);
52: return OK;
53: }
54:
55: # -------------------------------- Prevent users from attempting to login twice
56: my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));
57: my $lonid=$cookies{'lonID'};
58: my $cookie;
59: if ($lonid) {
60: my $handle=$lonid->value;
61: $handle=~s/\W//g;
62: my $lonidsdir=$r->dir_config('lonIDsDir');
63: if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) {
64: # Indeed, a valid token is found
65: my $bodytag=&Apache::loncommon::bodytag('Already logged in');
66: $r->print(<<ENDFAILED);
67: <html>
68: <head>
69: <title>Already logged in</title>
70: </head>
71: $bodytag
72: <h1>You are already logged in</h1>
73: <p>Please either <a href="/adm/roles">continue the current session</a> or
74: <a href="/adm/logout">logout</a>.</p>
75: <p>
76: <a href="/adm/loginproblems.html">Problems?</a></p>
77: </body>
78: </html>
79: ENDFAILED
80: return OK;
81: }
82: }
83:
84: # ---------------------------------------------------- No valid token, continue
85:
86: &Apache::loncommon::get_unprocessed_cgi
87: ($ENV{'QUERY_STRING'}.'&'.$env{'request.querystring'},
88: ['interface','username','domain','firsturl','localpath','localres']);
89:
90:
91: # ----------------------------------------------------------- Process Interface
92: $env{'form.interface'}=~s/\W//g;
93:
94: my $textbrowsers=$r->dir_config('lonTextBrowsers');
95: my $httpbrowser=$ENV{"HTTP_USER_AGENT"};
96:
97: foreach (split(/\:/,$textbrowsers)) {
98: if ($httpbrowser=~/$_/i) {
99: $env{'form.interface'}='textual';
100: }
101: }
102:
103: my $fullgraph=($env{'form.interface'} ne 'textual');
104: my $port_to_use=$r->dir_config('lonhttpdPort');
105: if (!defined($port_to_use)) {
106: $port_to_use='8080';
107: }
108: my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':'.$port_to_use.
109: $r->dir_config('lonIconsURL');
110: my $domain = $r->dir_config('lonDefDomain');
111: if (($env{'form.domain'}) &&
112: ($Apache::lonnet::domaindescription{$env{'form.domain'}})) {
113: $domain=$env{'form.domain'};
114: }
115: my $role = $r->dir_config('lonRole');
116: my $loadlim = $r->dir_config('lonLoadLim');
117: my $servadm = $r->dir_config('lonAdmEMail');
118: my $sysadm = $r->dir_config('lonSysEMail');
119: my $lonhost = $r->dir_config('lonHostID');
120: my $tabdir = $r->dir_config('lonTabDir');
121: my $include = $r->dir_config('lonIncludes');
122: my $expire = $r->dir_config('lonExpire');
123: my $version = $r->dir_config('lonVersion');
124:
125: # --------------------------------------------- Default values for login fields
126:
127: my $authusername=($env{'form.username'}?$env{'form.username'}:'');
128: my $authdomain=($env{'form.domain'}?$env{'form.domain'}:$domain);
129:
130: # ---------------------------------------------------------- Determine own load
131: my $loadavg;
132: {
133: my $loadfile=Apache::File->new('/proc/loadavg');
134: $loadavg=<$loadfile>;
135: }
136: $loadavg =~ s/\s.*//g;
137: my $loadpercent=sprintf("%.1f",100*$loadavg/$loadlim);
138: my $userloadpercent=&Apache::lonnet::userload();
139:
140: # ------------------------------------------------------- Do the load balancing
141: my $otherserver='http://'.$ENV{'SERVER_NAME'};
142: my $firsturl=
143: ($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'});
144: # ---------------------------------------- Are we access server and overloaded?
145: if (($role eq 'access') &&
146: (($userloadpercent>100.0)||($loadpercent>100.0))) {
147: my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent);
148: if ($unloaded) { $otherserver=$unloaded; }
149: }
150:
151: # ----------------------------------------------------------- Get announcements
152: my $announcements=&Apache::lonnet::getannounce();
153: # -------------------------------------------------------- Set login parameters
154:
155: my @hexstr=('0','1','2','3','4','5','6','7',
156: '8','9','a','b','c','d','e','f');
157: my $lkey='';
158: for (0..7) {
159: $lkey.=$hexstr[rand(15)];
160: }
161:
162: my $ukey='';
163: for (0..7) {
164: $ukey.=$hexstr[rand(15)];
165: }
166:
167: my $lextkey=hex($lkey);
168: if ($lextkey>2147483647) { $lextkey-=4294967296; }
169:
170: my $uextkey=hex($ukey);
171: if ($uextkey>2147483647) { $uextkey-=4294967296; }
172:
173: # -------------------------------------------------------- Store away log token
174: my $logtoken=Apache::lonnet::reply(
175: 'tmpput:'.$ukey.$lkey.'&'.$firsturl,
176: $lonhost);
177:
178: # ------------------- If we cannot talk to ourselves, we are in serious trouble
179:
180: if ($logtoken eq 'con_lost') {
181: my $spares='';
182: my $last;
183: foreach my $hostid (sort
184: {
185: $Apache::lonnet::hostname{$a} cmp
186: $Apache::lonnet::hostname{$b};
187: }
188: keys(%Apache::lonnet::spareid)) {
189: next if ($hostid eq $lonhost);
190: next if ($last eq $Apache::lonnet::hostname{$hostid});
191: $spares.='<br /><font size="+1"><a href="http://'.
192: $Apache::lonnet::hostname{$hostid}.
193: '/adm/login?domain='.$authdomain.'">'.
194: $Apache::lonnet::hostname{$hostid}.'</a>'.
195: ' (preferred)</font>'.$/;
196: $last=$Apache::lonnet::hostname{$hostid};
197: }
198: $spares.= '<br />';
199: foreach my $hostid (sort
200: {
201: $Apache::lonnet::hostname{$a} cmp
202: $Apache::lonnet::hostname{$b};
203: }
204: keys(%Apache::lonnet::hostname)) {
205: next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});
206: next if ($last eq $Apache::lonnet::hostname{$hostid});
207: $spares.='<br /><a href="http://'.
208: $Apache::lonnet::hostname{$hostid}.
209: '/adm/login?domain='.$authdomain.'">'.
210: $Apache::lonnet::hostname{$hostid}.'</a>';
211: $last=$Apache::lonnet::hostname{$hostid};
212: }
213: $r->print(<<ENDTROUBLE);
214: <html>
215: <head><title>The LearningOnline Network with CAPA</title></head>
216: <body bgcolor="#FFFFFF">
217: <img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />
218: <h3>This LON-CAPA server is temporarily not available for login</h3>
219: <p>Please attempt to login to one of the following servers:</p>$spares
220: <p>If the problem persists, please contact <tt>$servadm</tt>.</p>
221: </body>
222: </html>
223: ENDTROUBLE
224: return OK;
225: }
226:
227: # ----------------------------------------------- Apparently we are in business
228:
229: my $domainlogo=&Apache::loncommon::domainlogo($domain);
230: $servadm=~s/\,/\<br \/\>/g;
231: $sysadm=~s/\,/\<br \/\>/g;
232:
233: # --------------------------------------------------- Print login screen header
234: $r->print(<<ENDHEADER);
235: <html>
236: <head>
237: <meta HTTP-EQUIV="Refresh" CONTENT="$expire; url=/adm/roles" />
238: <title>The LearningOnline Network with CAPA Login</title>
239: </head>
240: ENDHEADER
241: # ---------------------------------------------------- Serve out DES JavaScript
242: {
243: my $jsh=Apache::File->new($include."/londes.js");
244: $r->print(<$jsh>);
245: }
246:
247: # ----------------------------------------------------------- Front page design
248: my $pgbg=
249: ($fullgraph?&Apache::loncommon::designparm('login.pgbg',$domain):'#FFFFFF');
250: my $font=
251: ($fullgraph?&Apache::loncommon::designparm('login.font',$domain):'#000000');
252: my $link=
253: ($fullgraph?&Apache::loncommon::designparm('login.link',$domain):'#0000FF');
254: my $vlink=
255: ($fullgraph?&Apache::loncommon::designparm('login.vlink',$domain):'#0000FF');
256: my $alink=&Apache::loncommon::designparm('login.alink',$domain);
257: my $mainbg=
258: ($fullgraph?&Apache::loncommon::designparm('login.mainbg',$domain):'#FFFFFF');
259: my $sidebg=
260: ($fullgraph?&Apache::loncommon::designparm('login.sidebg',$domain):'#FFFFFF');
261: my $logo=&Apache::loncommon::designparm('login.logo',$domain);
262: my $img=&Apache::loncommon::designparm('login.img',$domain);
263:
264: # ----------------------------------------------------------------------- Texts
265:
266: my %lt=&Apache::lonlocal::texthash(
267: 'un' => 'Username',
268: 'pw' => 'Password',
269: 'dom' => 'Domain',
270: 'perc' => 'percent',
271: 'load' => 'Load',
272: 'userload' => 'User Load',
273: 'about' => 'aboutlon.gif',
274: 'access' => 'accessbutton.gif',
275: 'auth' => 'userauthentication.gif',
276: 'log' => 'Log in',
277: 'help' => 'Help',
278: 'serv' => 'Server',
279: 'servadm' => 'Server Administration',
280: 'sysadm' => 'System Administration',
281: 'helpdesk' => 'Contact Helpdesk');
282: # -------------------------------------------------- Change password field name
283: my $now=time;
284: # ---------------------------------------------------------- Serve rest of page
285: $r->print(<<ENDSCRIPT);
286:
287: <body bgcolor="$pgbg" text="$font" link="$link" vlink="$vlink" alink="$alink"
288: topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>
289:
290: <script language="JavaScript">
291: function send()
292: {
293: this.document.server.elements.uname.value
294: =this.document.client.elements.uname.value;
295:
296: this.document.server.elements.udom.value
297: =this.document.client.elements.udom.value;
298:
299: this.document.server.elements.imagesuppress.value
300: =this.document.client.elements.imagesuppress.checked;
301:
302: this.document.server.elements.embedsuppress.value
303: =this.document.client.elements.embedsuppress.checked;
304:
305: this.document.server.elements.appletsuppress.value
306: =this.document.client.elements.appletsuppress.checked;
307:
308: this.document.server.elements.fontenhance.value
309: =this.document.client.elements.fontenhance.checked;
310:
311: this.document.server.elements.blackwhite.value
312: =this.document.client.elements.blackwhite.checked;
313:
314: this.document.server.elements.remember.value
315: =this.document.client.elements.remember.checked;
316:
317: uextkey=this.document.client.elements.uextkey.value;
318: lextkey=this.document.client.elements.lextkey.value;
319: initkeys();
320:
321: this.document.server.elements.upass0.value
322: =crypted(this.document.client.elements.upass$now.value.substr(0,15));
323: this.document.server.elements.upass1.value
324: =crypted(this.document.client.elements.upass$now.value.substr(15,15));
325: this.document.server.elements.upass2.value
326: =crypted(this.document.client.elements.upass$now.value.substr(30,15));
327:
328: this.document.client.elements.uname.value='';
329: this.document.client.elements.upass$now.value='';
330:
331: this.document.server.submit();
332: return false;
333: }
334: </script>
335: ENDSCRIPT
336:
337: if ($fullgraph) {
338: $r->print(
339: '<table width="100%" cellpadding=0 cellspacing=0 border=0>');
340: }
341:
342: $r->print(<<ENDSERVERFORM);
343: <form name="server" action="$otherserver/adm/authenticate" method="post" target="_top">
344: <input type="hidden" name="logtoken" value="$logtoken" />
345: <input type="hidden" name="serverid" value="$lonhost" />
346: <input type="hidden" name="interface" value="$env{'form.interface'}" />
347: <input type="hidden" name="uname" value="" />
348: <input type="hidden" name="upass0" value="" />
349: <input type="hidden" name="upass1" value="" />
350: <input type="hidden" name="upass2" value="" />
351: <input type="hidden" name="udom" value="" />
352: <input type="hidden" name="imagesuppress" value="" />
353: <input type="hidden" name="appletsuppress" value="" />
354: <input type="hidden" name="embedsuppress" value="" />
355: <input type="hidden" name="fontenhance" value="" />
356: <input type="hidden" name="blackwhite" value="" />
357: <input type="hidden" name="remember" value="" />
358: <input type="hidden" name="localpath" value="$env{'form.localpath'}" />
359: <input type="hidden" name="localres" value="$env{'form.localres'}" />
360: </form>
361: ENDSERVERFORM
362: if ($fullgraph) { $r->print(<<ENDTOP);
363: <!-- The LON-CAPA Header -->
364: <tr>
365:
366: <!-- Row 1 Columns 2-4 -->
367: <td width="100%" height=75 colspan=4 align="left" valign="top" bgcolor="$pgbg"><img src="$img" border=0 alt="The Learning Online Network with CAPA" /></td>
368: </tr>
369:
370: <!-- The gray bar that starts the two table frames -->
371: <tr>
372:
373: <!-- Row 2 Column 1 -->
374: <td width=182 height=27 bgcolor="$sidebg"> </td>
375:
376: <!-- Row 2 Column 2 -->
377: <td width=27 height=27 align="left" background="$iconpath/filltop.gif"><img src="$iconpath/upperleft.gif" border=0 alt="" /></td>
378:
379: <!-- Row 2 Column 3 -->
380: <td height=27 background="$iconpath/filltop.gif"><img src="$iconpath/filltop.gif" alt="" /></td>
381:
382: <!-- Row 2 Column 4 -->
383: <td width=27 height=27 align="right" background="$iconpath/filltop.gif"><img src="$iconpath/upperright.gif" border=0 alt="" /></td>
384: </tr>
385: <tr>
386:
387: <!-- A cell that will hold the 'access' and 'about' buttons -->
388: <!-- Row 3 Column 1 -->
389: <td valign="top" height=60 align="center" bgcolor="$sidebg">
390: <a href="/adm/login?interface=textual"><img src="$iconpath/$lt{'access'}" border=0 alt="Accessibility Options" /></a>
391: <br />
392: <a href="/adm/about.html"><img src="$iconpath/$lt{'about'}" border=0 alt="About LON-CAPA" /></a>
393: </td>
394:
395: <!-- The shaded space between the two main columns -->
396: <!-- Row 3 Column 2 -->
397: <td width=27 height=60 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td>
398:
399: <!-- The right main column holding the large LON-CAPA logo-->
400: <!-- Rows 3-4 Column 3 -->
401: <td align="center" valign="top" width="100%" height="100%" bgcolor="$mainbg">
402: <center>
403: <img src="$logo" alt="" />
404: </center>
405: </td>
406:
407: <!-- Row 3 Column 4 -->
408: <td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td>
409: </tr>
410: <tr>
411:
412: <!-- The entry form -->
413: <!-- Row 4 Column 1 -->
414: <td align="center" valign="middle" bgcolor="$sidebg">
415: ENDTOP
416: } else {
417: $r->print('<h1>The Learning<i>Online</i> Network with CAPA</h1><h2>Text-based Interface Login</h2>'.$announcements);
418: }
419: $r->print('<form name="client" onsubmit="return(send())">');
420: unless ($fullgraph) {
421: $r->print(<<ENDACCESSOPTIONS);
422: <h3>Select Accessibility Options</h3>
423: <label><input type="checkbox" name="imagesuppress" /> Suppress rendering of images</label><br />
424: <label><input type="checkbox" name="appletsuppress" /> Suppress Java applets</label><br />
425: <label><input type="checkbox" name="embedsuppress" /> Suppress rendering of embedded multimedia</label><br />
426: <label><input type="checkbox" name="fontenhance" /> Increase font size</label><br />
427: <label><input type="checkbox" name="blackwhite" /> Switch to black and white mode</label><br />
428: <p>If you have accessibility needs that are not addressed by this interface,
429: please
430: contact the system administrator at <tt>$sysadm</tt>.</p><br />
431: <input type="checkbox" name="remember" /> Remember these settings for next login<hr />
432: ENDACCESSOPTIONS
433: } else {
434: $r->print(<<ENDNOOPT);
435: <input type="hidden" name="imagesuppress" value="" />
436: <input type="hidden" name="embedsuppress" value="" />
437: <input type="hidden" name="appletsuppress" value="" />
438: <input type="hidden" name="fontenhance" value="" />
439: <input type="hidden" name="blackwhite" value="" />
440: <input type="hidden" name="remember" value="" />
441: ENDNOOPT
442: }
443: $r->print(<<ENDLOGIN);
444: <input type="hidden" name="lextkey" value="$lextkey">
445: <input type="hidden" name="uextkey" value="$uextkey">
446:
447: <!-- Start the sub-table for text and input alignment -->
448: <table border=0 cellspacing=0 cellpadding=0>
449: <tr><td bgcolor="$sidebg" colspan=2><img src="$iconpath/$lt{'auth'}" alt="User Authentication" /></td></tr>
450: <tr>
451: <td bgcolor="$mainbg"><br /><font size=-1><b> $lt{'un'}:</b></font></td>
452: <td bgcolor="$mainbg"><br /><input type="text" name="uname" size="10" value="$authusername" /></td>
453: </tr>
454: <tr>
455: <td bgcolor="$mainbg"><font size=-1><b> $lt{'pw'}:</b></font></td>
456: <td bgcolor="$mainbg"><input type="password" name="upass$now" size="10" /></td>
457: </tr>
458: <tr>
459: <td bgcolor="$mainbg"><font size=-1><b> $lt{'dom'}:</b></font></td>
460: <td bgcolor="$mainbg"><input type="text" name="udom" size="10" value="$authdomain" /></td>
461: </tr>
462: <tr>
463: <td bgcolor="$mainbg"> <a href="/adm/loginproblems.html">$lt{'help'}</a></td>
464: <td bgcolor="$mainbg" valign="bottom" align="center">
465: <br />
466: <input type="submit" value="$lt{'log'}" />
467: </td>
468: </tr>
469: </table>
470: <!-- End sub-table -->
471: </form>
472: ENDLOGIN
473: if ($fullgraph) {
474: my $helpdeskscript;
475: my $contactblock = &contactdisplay(\%lt,$sysadm,$servadm,$version,$authdomain,\$helpdeskscript);
476: $r->print(<<ENDDOCUMENT);
477: </td>
478:
479: <!-- Row 4 Column 2 -->
480: <td width=27 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td>
481:
482: <!-- Row 4 Column 3 -->
483: <td bgcolor="$mainbg">$announcements</td>
484:
485: <!-- Row 4 Column 4 -->
486: <td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td>
487: </tr>
488: <tr>
489:
490: <!-- Row 5 Column 1 -->
491: <td bgcolor="$sidebg" valign="middle" align="left">
492: <br />
493: <table border=0 cellspacing=0 cellpadding=0>
494: <tr>
495: <td bgcolor="$sidebg" align="left" valign="top">
496: <small><b> $lt{'dom'}: </b></small>
497: </td>
498: <td bgcolor="$sidebg" align="left" valign="top">
499: <small><tt> $domain</tt></small>
500: </td>
501: </tr>
502: <tr>
503: <td bgcolor="$sidebg" align="left" valign="top">
504: <small><b> $lt{'serv'}: </b></small>
505: </td>
506: <td bgcolor="$sidebg" align="left" valign="top">
507: <small><tt> $lonhost ($role)</tt></small>
508: </td>
509: </tr>
510: <tr>
511: <td bgcolor="$sidebg" align="left" valign="top">
512: <small><b> $lt{'load'}: </b></small>
513: </td>
514: <td bgcolor="$sidebg" align="left" valign="top">
515: <small><tt> $loadpercent $lt{'perc'}</tt></small>
516: </td>
517: </tr>
518: <tr>
519: <td bgcolor="$sidebg" align="left" valign="top">
520: <small><b> $lt{'userload'}: </b></small>
521: </td>
522: <td bgcolor="$sidebg" align="left" valign="top">
523: <small><tt> $userloadpercent $lt{'perc'}</tt></small>
524: </td>
525: </tr>
526: </table>
527: <br />
528: $contactblock
529: </td>
530:
531: <!-- Row 5 Column 2 -->
532: <td width=27 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td>
533:
534: <!-- Row 5 Column 3 -->
535: <td width="100%" valign="bottom" bgcolor="$mainbg">
536: $domainlogo
537: </td>
538:
539: <!-- Row 5 Column 4 -->
540: <td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td>
541: </tr>
542: <tr>
543:
544: <!-- Row 6 Column 1 -->
545: <td bgcolor="$sidebg"> </td>
546:
547: <!-- Row 6 Column 2 -->
548: <td align="left" background="$iconpath/fillbottom.gif"><img src="$iconpath/lowerleft.gif" alt="" /></td>
549:
550: <!-- Row 6 Column 3 -->
551: <td background="$iconpath/fillbottom.gif"><img src="$iconpath/fillbottom.gif" alt="" /></td>
552:
553: <!-- Row 6 Column 4 -->
554: <td align="right" background="$iconpath/fillbottom.gif"><img src="$iconpath/lowerright.gif" alt="" /></td>
555: </tr>
556: </table>
557:
558: <script type="text/javascript">
559: // the if prevents the script error if the browser can not handle this
560: if ( document.client.uname ) { document.client.uname.focus(); }
561: </script>
562: $helpdeskscript
563:
564: ENDDOCUMENT
565: }
566: $r->print('</body></html>');
567: return OK;
568: }
569:
570: sub contactdisplay {
571: my ($lt,$sysadm,$servadm,$version,$authdomain,$helpdeskscript) = @_;
572: my $contactblock;
573: my $showsysadm = 1;
574: my $showservadm = 1;
575: my $showhelpdesk = 0;
576: my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
577: if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {
578: $showhelpdesk = 1;
579: }
580: if ($showsysadm) {
581: $contactblock .= '<b> '.$$lt{'sysadm'}.':</b><br />'.
582: '<tt> '.$sysadm.'</tt><br />';
583: }
584: if ($showservadm) {
585: $contactblock .= '<b> '.$$lt{'servadm'}.':</b><br />'.
586: '<tt> '.$servadm.'</tt><br /> <br />';
587: }
588: if ($showhelpdesk) {
589: $contactblock .= '<b> <a href="javascript:helpdesk()">'.$$lt{'helpdesk'}.'</a></b><br />';
590: my $thisurl = &Apache::lonnet::escape('/adm/login');
591: $$helpdeskscript = <<"ENDSCRIPT";
592: <script type="text/javascript">
593: function helpdesk() {
594: var codedom = document.client.udom.value;
595: if (codedom == '') {
596: codedom = "$authdomain";
597: }
598: var querystr = "origurl=$thisurl&codedom="+codedom;
599: document.location.href = "/adm/helpdesk?"+querystr;
600: return;
601: }
602: </script>
603: ENDSCRIPT
604: }
605: $contactblock .= <<"ENDBLOCK";
606: $version
607: ENDBLOCK
608: return $contactblock;
609: }
610:
611:
612: 1;
613: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>