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