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