Annotation of loncom/auth/lonlogin.pm, revision 1.118
1.1 albertel 1: # The LearningOnline Network
2: # Login Screen
1.11 www 3: #
1.118 ! tempelho 4: # $Id: lonlogin.pm,v 1.117 2009/04/01 14:43:19 hauer Exp $
1.11 www 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: #
1.14 albertel 28:
1.1 albertel 29: package Apache::lonlogin;
30:
31: use strict;
32: use Apache::Constants qw(:common);
33: use Apache::File ();
1.63 albertel 34: use Apache::lonnet;
1.12 albertel 35: use Apache::loncommon();
1.49 www 36: use Apache::lonauth();
1.50 www 37: use Apache::lonlocal;
1.71 albertel 38: use Apache::migrateuser();
1.75 www 39: use lib '/home/httpd/lib/perl/';
40: use LONCAPA;
41:
1.1 albertel 42: sub handler {
43: my $r = shift;
1.71 albertel 44:
45: &Apache::loncommon::get_unprocessed_cgi
1.79 albertel 46: (join('&',$ENV{'QUERY_STRING'},$env{'request.querystring'},
47: $ENV{'REDIRECT_QUERY_STRING'}),
1.71 albertel 48: ['interface','username','domain','firsturl','localpath','localres',
49: 'token']);
1.102 raeburn 50: if (!defined($env{'form.firsturl'})) {
51: &Apache::lonacc::get_posted_cgi($r,['firsturl']);
52: }
1.71 albertel 53:
54: # -- check if they are a migrating user
55: if (defined($env{'form.token'})) {
56: return &Apache::migrateuser::handler($r);
57: }
58:
1.53 www 59: &Apache::loncommon::no_cache($r);
60: &Apache::lonlocal::get_language_handle($r);
1.54 www 61: &Apache::loncommon::content_type($r,'text/html');
1.1 albertel 62: $r->send_http_header;
63: return OK if $r->header_only;
64:
1.49 www 65:
66: # Are we re-routing?
67: if (-e '/home/httpd/html/lon-status/reroute.txt') {
68: &Apache::lonauth::reroute($r);
69: return OK;
70: }
1.55 www 71:
1.71 albertel 72:
1.55 www 73: # -------------------------------- Prevent users from attempting to login twice
1.95 albertel 74: my $handle = &Apache::lonnet::check_for_valid_session($r);
75: if ($handle=~/^publicuser\_/) {
1.70 www 76: # For "public user" - remove it, we apparently really want to login
1.95 albertel 77: unlink($r->dir_config('lonIDsDir')."/$handle.id");
78: } elsif ($handle ne '') {
1.55 www 79: # Indeed, a valid token is found
1.95 albertel 80: my $start_page =
81: &Apache::loncommon::start_page('Already logged in');
82: my $end_page =
83: &Apache::loncommon::end_page();
1.100 bisitz 84: $r->print(
85: $start_page
1.103 bisitz 86: .'<h1>'.&mt('You are already logged in!').'</h1>'
1.117 hauer 87: .'<p>'.&mt('Please either [_1]continue the current session[_2] or [_3]log out[_4].',
1.100 bisitz 88: '<a href="/adm/roles">','</a>','<a href="/adm/logout">','</a>').'</p>'
89: .'<p><a href="/adm/loginproblems.html">'.&mt('Login problems?').'</a></p>'
90: .$end_page
91: );
1.95 albertel 92: return OK;
1.55 www 93: }
94:
95: # ---------------------------------------------------- No valid token, continue
1.16 www 96:
1.70 www 97: # ---------------------------- Not possible to really login to domain "public"
98: if ($env{'form.domain'} eq 'public') {
99: $env{'form.domain'}='';
100: $env{'form.username'}='';
101: }
1.32 www 102: # ----------------------------------------------------------- Process Interface
1.63 albertel 103: $env{'form.interface'}=~s/\W//g;
1.16 www 104:
1.32 www 105: my $httpbrowser=$ENV{"HTTP_USER_AGENT"};
106:
1.63 albertel 107: my $fullgraph=($env{'form.interface'} ne 'textual');
1.94 albertel 108:
109: my $iconpath=
110: &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
111:
1.87 raeburn 112: my $domain = &Apache::lonnet::default_login_domain();
1.63 albertel 113: if (($env{'form.domain'}) &&
1.89 albertel 114: (&Apache::lonnet::domain($env{'form.domain'},'description'))) {
1.63 albertel 115: $domain=$env{'form.domain'};
1.46 www 116: }
1.1 albertel 117: my $role = $r->dir_config('lonRole');
118: my $loadlim = $r->dir_config('lonLoadLim');
1.90 raeburn 119: my $servadm = $r->dir_config('lonAdmEMail');
1.1 albertel 120: my $lonhost = $r->dir_config('lonHostID');
121: my $tabdir = $r->dir_config('lonTabDir');
1.6 www 122: my $include = $r->dir_config('lonIncludes');
1.37 www 123: my $expire = $r->dir_config('lonExpire');
1.44 www 124: my $version = $r->dir_config('lonVersion');
1.88 albertel 125: my $host_name = &Apache::lonnet::hostname($lonhost);
1.1 albertel 126:
1.30 www 127: # --------------------------------------------- Default values for login fields
128:
1.63 albertel 129: my $authusername=($env{'form.username'}?$env{'form.username'}:'');
130: my $authdomain=($env{'form.domain'}?$env{'form.domain'}:$domain);
1.30 www 131:
132: # ---------------------------------------------------------- Determine own load
1.1 albertel 133: my $loadavg;
1.41 albertel 134: {
135: my $loadfile=Apache::File->new('/proc/loadavg');
136: $loadavg=<$loadfile>;
137: }
1.1 albertel 138: $loadavg =~ s/\s.*//g;
1.57 matthew 139: my $loadpercent=sprintf("%.1f",100*$loadavg/$loadlim);
1.41 albertel 140: my $userloadpercent=&Apache::lonnet::userload();
1.1 albertel 141:
1.30 www 142: # ------------------------------------------------------- Do the load balancing
1.80 albertel 143: my $otherserver= &Apache::lonnet::absolute_url($host_name);
1.31 www 144: my $firsturl=
1.63 albertel 145: ($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'});
1.97 albertel 146: # ---------------------------------------------------------- Are we overloaded?
147: if ((($userloadpercent>100.0)||($loadpercent>100.0))) {
1.47 albertel 148: my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent);
149: if ($unloaded) { $otherserver=$unloaded; }
1.1 albertel 150: }
1.6 www 151:
1.45 www 152: # ----------------------------------------------------------- Get announcements
153: my $announcements=&Apache::lonnet::getannounce();
1.6 www 154: # -------------------------------------------------------- Set login parameters
155:
156: my @hexstr=('0','1','2','3','4','5','6','7',
157: '8','9','a','b','c','d','e','f');
158: my $lkey='';
159: for (0..7) {
160: $lkey.=$hexstr[rand(15)];
161: }
162:
163: my $ukey='';
164: for (0..7) {
165: $ukey.=$hexstr[rand(15)];
166: }
167:
168: my $lextkey=hex($lkey);
1.15 www 169: if ($lextkey>2147483647) { $lextkey-=4294967296; }
170:
1.6 www 171: my $uextkey=hex($ukey);
1.15 www 172: if ($uextkey>2147483647) { $uextkey-=4294967296; }
173:
1.31 www 174: # -------------------------------------------------------- Store away log token
1.6 www 175: my $logtoken=Apache::lonnet::reply(
1.7 www 176: 'tmpput:'.$ukey.$lkey.'&'.$firsturl,
1.6 www 177: $lonhost);
1.31 www 178:
179: # ------------------- If we cannot talk to ourselves, we are in serious trouble
180:
181: if ($logtoken eq 'con_lost') {
182: my $spares='';
1.64 albertel 183: my $last;
184: foreach my $hostid (sort
185: {
1.88 albertel 186: &Apache::lonnet::hostname($a) cmp
187: &Apache::lonnet::hostname($b);
1.64 albertel 188: }
189: keys(%Apache::lonnet::spareid)) {
1.58 matthew 190: next if ($hostid eq $lonhost);
1.88 albertel 191: my $hostname = &Apache::lonnet::hostname($hostid);
192: next if ($last eq $hostname);
1.58 matthew 193: $spares.='<br /><font size="+1"><a href="http://'.
1.88 albertel 194: $hostname.
1.58 matthew 195: '/adm/login?domain='.$authdomain.'">'.
1.88 albertel 196: $hostname.'</a>'.
1.106 bisitz 197: ' '.&mt('(preferred)').'</font>'.$/;
1.88 albertel 198: $last=$hostname;
1.58 matthew 199: }
1.107 tempelho 200: $spares.= '<br />';
201: my %all_hostnames = &Apache::lonnet::all_hostnames();
202: foreach my $hostid (sort
203: {
204: &Apache::lonnet::hostname($a) cmp
205: &Apache::lonnet::hostname($b);
206: }
207: keys(%all_hostnames)) {
208: next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});
209: my $hostname = &Apache::lonnet::hostname($hostid);
210: next if ($last eq $hostname);
211: $spares.='<br /><a href="http://'.
212: $hostname.
213: '/adm/login?domain='.$authdomain.'">'.
214: $hostname.'</a>';
215: $last=$hostname;
216: }
217: $r->print(
218: '<html>'
219: .'<head><title>'
220: .&mt('The LearningOnline Network with CAPA')
221: .'</title></head>'
222: .'<body bgcolor="#FFFFFF">'
223: .'<h1>'.&mt('The LearningOnline Network with CAPA').'</h1>'
224: .'<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />'
225: .'<h3>'.&mt('This LON-CAPA server is temporarily not available for login.').'</h3>'
226: .'<p>'.&mt('Please attempt to login to one of the following servers:').'</p>'
227: .$spares
228: .'</body>'
229: .'</html>'
230: );
231: return OK;
232: }
1.31 www 233:
234: # ----------------------------------------------- Apparently we are in business
1.107 tempelho 235: $servadm=~s/\,/\<br \/\>/g;
1.38 www 236:
1.21 www 237: # ----------------------------------------------------------- Front page design
1.107 tempelho 238: my $pgbg=
239: ($fullgraph?&Apache::loncommon::designparm('login.pgbg',$domain):'#FFFFFF');
240: my $font=
241: ($fullgraph?&Apache::loncommon::designparm('login.font',$domain):'#000000');
242: my $link=
243: ($fullgraph?&Apache::loncommon::designparm('login.link',$domain):'#0000FF');
244: my $vlink=
245: ($fullgraph?&Apache::loncommon::designparm('login.vlink',$domain):'#0000FF');
246: my $alink=&Apache::loncommon::designparm('login.alink',$domain);
247: my $mainbg=
248: ($fullgraph?&Apache::loncommon::designparm('login.mainbg',$domain):'#FFFFFF');
249: my $logo=&Apache::loncommon::designparm('login.logo',$domain);
250: my $img=&Apache::loncommon::designparm('login.img',$domain);
251: my $domainlogo=&Apache::loncommon::domainlogo($domain);
252: my $login=&Apache::loncommon::designparm('login.login',$domain);
253: if ($login eq '') {
254: $login = $iconpath.'/'.&mt('userauthentication.gif');
255: }
1.109 raeburn 256: my $showbanner = 1;
257: my $showmainlogo = 1;
258: if (defined(&Apache::loncommon::designparm('login.showlogo_img',$domain))) {
259: $showbanner = &Apache::loncommon::designparm('login.showlogo_img',$domain);
260: }
261: if (defined(&Apache::loncommon::designparm('login.showlogo_logo',$domain))) {
262: $showmainlogo = &Apache::loncommon::designparm('login.showlogo_logo',$domain);
263: }
1.107 tempelho 264: my $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain);
265: my $showcoursecat =
266: &Apache::loncommon::designparm('login.coursecatalog',$domain);
267: my $loginheader =&Apache::loncommon::designparm('login.loginheader',$domain);
268: my $shownewuserlink =
269: &Apache::loncommon::designparm('login.newuser',$domain);
270: my $now=time;
271: my $js = (<<ENDSCRIPT);
272:
1.116 bisitz 273: <script type="text/javascript" language="JavaScript">
1.107 tempelho 274: function send()
275: {
276: this.document.server.elements.uname.value
277: =this.document.client.elements.uname.value;
278:
279: this.document.server.elements.udom.value
280: =this.document.client.elements.udom.value;
281:
282: uextkey=this.document.client.elements.uextkey.value;
283: lextkey=this.document.client.elements.lextkey.value;
284: initkeys();
285:
286: this.document.server.elements.upass0.value
287: =crypted(this.document.client.elements.upass$now.value.substr(0,15));
288: this.document.server.elements.upass1.value
289: =crypted(this.document.client.elements.upass$now.value.substr(15,15));
290: this.document.server.elements.upass2.value
291: =crypted(this.document.client.elements.upass$now.value.substr(30,15));
1.6 www 292:
1.107 tempelho 293: this.document.client.elements.uname.value='';
294: this.document.client.elements.upass$now.value='';
1.6 www 295:
1.107 tempelho 296: this.document.server.submit();
297: return false;
298: }
299: </script>
1.98 raeburn 300:
1.16 www 301: ENDSCRIPT
1.6 www 302:
1.98 raeburn 303: # --------------------------------------------------- Print login screen header
304:
1.118 ! tempelho 305: my %add_entries = (
1.108 tempelho 306: bgcolor => "$mainbg",
1.107 tempelho 307: text => "$font",
308: link => "$link",
309: vlink => "$vlink",
310: alink => "$alink",);
311:
312: $r->print(&Apache::loncommon::start_page('The LearningOnline Network with CAPA Login',$js,
313: { 'redirect' => [$expire,'/adm/roles'],
314: 'add_entries' => \%add_entries,
315: 'only_body' => 1,}));
1.98 raeburn 316:
317: # ----------------------------------------------------------------------- Texts
318:
319: my %lt=&Apache::lonlocal::texthash(
1.107 tempelho 320: 'un' => 'Username',
321: 'pw' => 'Password',
322: 'dom' => 'Domain',
323: 'perc' => 'percent',
324: 'load' => 'Server Load',
325: 'userload' => 'User Load',
326: 'about' => 'About LON-CAPA',
327: 'catalog' => 'Course Catalog',
328: 'log' => 'Log in',
329: 'help' => 'Log-in Help',
330: 'serv' => 'Server',
331: 'servadm' => 'Server Administration',
332: 'helpdesk' => 'Contact Helpdesk',
333: 'forgotpw' => 'Forgot password?',
334: 'newuser' => 'New User?',
1.111 muellerd 335: );
1.98 raeburn 336: # -------------------------------------------------- Change password field name
1.107 tempelho 337: my $forgotpw = &forgotpwdisplay(%lt);
338: my $loginhelp = &loginhelpdisplay(%lt);
1.98 raeburn 339:
340: # ---------------------------------------------------- Serve out DES JavaScript
1.107 tempelho 341: {
342: my $jsh=Apache::File->new($include."/londes.js");
343: $r->print(<$jsh>);
344: }
1.98 raeburn 345: # ---------------------------------------------------------- Serve rest of page
346:
1.107 tempelho 347: if ($fullgraph) {
348: $r->print(
349: '<div class="LC_loginpage_container">');
350: }
1.6 www 351:
1.107 tempelho 352: $r->print(<<ENDSERVERFORM);
353: <form name="server" action="$otherserver/adm/authenticate" method="post" target="_top">
1.33 www 354: <input type="hidden" name="logtoken" value="$logtoken" />
355: <input type="hidden" name="serverid" value="$lonhost" />
356: <input type="hidden" name="uname" value="" />
1.65 www 357: <input type="hidden" name="upass0" value="" />
358: <input type="hidden" name="upass1" value="" />
359: <input type="hidden" name="upass2" value="" />
1.33 www 360: <input type="hidden" name="udom" value="" />
1.63 albertel 361: <input type="hidden" name="localpath" value="$env{'form.localpath'}" />
362: <input type="hidden" name="localres" value="$env{'form.localres'}" />
1.14 albertel 363: </form>
1.16 www 364: ENDSERVERFORM
1.108 tempelho 365: my $coursecatalog;
366: if (($showcoursecat eq '') || ($showcoursecat)) {
367: $coursecatalog = &coursecatalog_link($lt{'catalog'});
368: }
369: my $newuserlink;
370: if ($shownewuserlink) {
1.114 tempelho 371: $newuserlink = &newuser_link($lt{'newuser'}).'<br />';
1.108 tempelho 372: }
373: my $logintitle;
374: if ($loginheader eq 'text') {
1.113 tempelho 375: $logintitle ='<h2>'.$lt{'log'}.'</h2>';
1.108 tempelho 376: } else {
377: $logintitle = '<img src="'.$login.'" alt="'.
378: &mt('User Authentication').'" />';
379: }
380:
381: my $noscript_warning='<noscript><span class="LC_warning"><b>'
382: .&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.')
383: .'</b></span></noscript>';
384: my $helpdeskscript;
385: my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,
386: $version,$authdomain,\$helpdeskscript);
1.107 tempelho 387:
1.108 tempelho 388: my $loginform=(<<LFORM);
389: <form name="client" onsubmit="return(send())">
1.115 bisitz 390: <input type="hidden" name="lextkey" value="$lextkey" />
391: <input type="hidden" name="uextkey" value="$uextkey" />
1.108 tempelho 392: <b><label for="uname">$lt{'un'}</label>:</b><br />
1.113 tempelho 393: <input type="text" name="uname" size="15" value="$authusername" /><br />
1.108 tempelho 394: <b><label for="upass$now">$lt{'pw'}</label>:</b><br />
1.113 tempelho 395: <input type="password" name="upass$now" size="15" /><br />
1.108 tempelho 396: <b><label for="udom">$lt{'dom'}</label>:</b><br />
1.113 tempelho 397: <input type="text" name="udom" size="15" value="$authdomain" /><br />
1.108 tempelho 398: <input type="submit" value="$lt{'log'}" />
399: </form>
400: LFORM
401:
1.109 raeburn 402: if ($fullgraph) {
403: if ($showbanner) {
404: $r->print(<<HEADER);
405: <!-- The LON-CAPA Header -->
406: <table border="0" align="left" width="100%" cellspacing="0" cellpadding="1">
407: <tr>
408: <td align="left" valign="top" bgcolor="$pgbg">
1.115 bisitz 409: <img src="$img" border="0" alt="The Learning Online Network with CAPA" />
1.109 raeburn 410: </td>
411: </tr>
412: </table>
413: HEADER
414: }
415: $r->print(<<ENDTOP);
1.118 ! tempelho 416: <div class="LC_loginpage_space"> </div>
! 417: <div class="LC_loginpage_floatLeft">
1.108 tempelho 418: <div class="LC_loginpage_loginContainer">
1.112 muellerd 419: $logintitle
420: <table border="0" align="left" cellspacing="1" cellpadding="2" width="100%">
1.108 tempelho 421: <tr>
422: <td>
423: $loginform
424: </td>
425: </tr>
426: </table>
427: $noscript_warning
428: </div>
1.107 tempelho 429:
430: <div class="LC_loginpage_loginInfo">
431: $loginhelp<br />
1.114 tempelho 432: $forgotpw<br />
433: $contactblock<br />
434: $newuserlink
1.107 tempelho 435: $coursecatalog<br /><br />
1.114 tempelho 436: <a href="/adm/about.html"><b>$lt{'about'}</b></a>
1.107 tempelho 437: </div>
1.118 ! tempelho 438: </div>
! 439: ENDTOP
! 440: if ($showmainlogo) {
! 441: $r->print(' <img src="'.$logo.'" alt="" />'."\n");
! 442: }
! 443: $r->print(<<ENDTOP);
! 444: $announcements
! 445: $domainlogo
1.107 tempelho 446: <div class="LC_loginpage_space"> </div>
1.108 tempelho 447: ENDTOP
1.107 tempelho 448: }
1.108 tempelho 449:
450: if ($fullgraph) {
451: $r->print(<<ENDDOCUMENT);
1.115 bisitz 452: <table border="0" cellspacing="0" cellpadding="0">
1.14 albertel 453: <tr>
1.110 muellerd 454: <td align="left" valign="top">
1.51 www 455: <small><b> $lt{'dom'}: </b></small>
1.14 albertel 456: </td>
1.110 muellerd 457: <td align="left" valign="top">
1.14 albertel 458: <small><tt> $domain</tt></small>
459: </td>
460: </tr>
461: <tr>
1.110 muellerd 462: <td align="left" valign="top">
1.51 www 463: <small><b> $lt{'serv'}: </b></small>
1.14 albertel 464: </td>
1.110 muellerd 465: <td align="left" valign="top">
1.14 albertel 466: <small><tt> $lonhost ($role)</tt></small>
467: </td>
468: </tr>
469: <tr>
1.110 muellerd 470: <td align="left" valign="top">
1.52 www 471: <small><b> $lt{'load'}: </b></small>
1.14 albertel 472: </td>
1.110 muellerd 473: <td align="left" valign="top">
1.51 www 474: <small><tt> $loadpercent $lt{'perc'}</tt></small>
1.42 albertel 475: </td>
476: </tr>
477: <tr>
1.110 muellerd 478: <td align="left" valign="top">
1.52 www 479: <small><b> $lt{'userload'}: </b></small>
1.42 albertel 480: </td>
1.110 muellerd 481: <td align="left" valign="top">
1.51 www 482: <small><tt> $userloadpercent $lt{'perc'}</tt></small>
1.14 albertel 483: </td>
484: </tr>
485: </table>
1.107 tempelho 486: </div>
1.25 bowersj2 487:
1.59 albertel 488: <script type="text/javascript">
489: // the if prevents the script error if the browser can not handle this
1.25 bowersj2 490: if ( document.client.uname ) { document.client.uname.focus(); }
491: </script>
1.62 raeburn 492: $helpdeskscript
1.14 albertel 493:
1.1 albertel 494: ENDDOCUMENT
1.16 www 495: }
1.98 raeburn 496: my %endargs = ( 'noredirectlink' => 1, );
497: $r->print(&Apache::loncommon::end_page(\%endargs));
1.1 albertel 498: return OK;
1.60 raeburn 499: }
500:
501: sub contactdisplay {
1.90 raeburn 502: my ($lt,$servadm,$showadminmail,$version,$authdomain,$helpdeskscript) = @_;
1.60 raeburn 503: my $contactblock;
1.62 raeburn 504: my $showhelpdesk = 0;
505: my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
506: if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {
507: $showhelpdesk = 1;
508: }
1.90 raeburn 509: if ($servadm && $showadminmail) {
510: $contactblock .= '<b> '.$$lt{'servadm'}.':</b><br />'.
511: '<tt> '.$servadm.'</tt><br /> <br />';
512: }
1.60 raeburn 513: if ($showhelpdesk) {
1.114 tempelho 514: $contactblock .= '<a href="javascript:helpdesk()">'.$lt->{'helpdesk'}.'</a><br />';
1.75 www 515: my $thisurl = &escape('/adm/login');
1.62 raeburn 516: $$helpdeskscript = <<"ENDSCRIPT";
517: <script type="text/javascript">
518: function helpdesk() {
519: var codedom = document.client.udom.value;
520: if (codedom == '') {
521: codedom = "$authdomain";
522: }
523: var querystr = "origurl=$thisurl&codedom="+codedom;
524: document.location.href = "/adm/helpdesk?"+querystr;
525: return;
526: }
527: </script>
528: ENDSCRIPT
1.60 raeburn 529: }
530: $contactblock .= <<"ENDBLOCK";
531: $version
532: ENDBLOCK
533: return $contactblock;
534: }
1.83 raeburn 535:
536: sub forgotpwdisplay {
1.84 raeburn 537: my (%lt) = @_;
1.83 raeburn 538: my $prompt_for_resetpw = 1;
539: if ($prompt_for_resetpw) {
1.107 tempelho 540: return '<a href="/adm/resetpw">'.$lt{'forgotpw'}.'</a>';
1.84 raeburn 541: }
542: return;
543: }
544:
545: sub loginhelpdisplay {
546: my (%lt) = @_;
547: my $login_help = 1;
548: if ($login_help) {
1.107 tempelho 549: return '<a href="/adm/loginproblems.html">'.$lt{'help'}.'</a>';
1.83 raeburn 550: }
551: return;
552: }
1.1 albertel 553:
1.90 raeburn 554: sub coursecatalog_link {
555: my ($linkname) = @_;
556: return <<"END";
1.107 tempelho 557: <a href="/adm/coursecatalog">$linkname</a>
1.90 raeburn 558: END
559: }
560:
1.101 raeburn 561: sub newuser_link {
562: my ($linkname) = @_;
563: return ' <a href="/adm/createaccount"><b>'.$linkname.'</b></a><br />';
564: }
565:
1.1 albertel 566: 1;
567: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>