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