[LON-CAPA-cvs] cvs: modules /raeburn monitor.pl
raeburn
lon-capa-cvs@mail.lon-capa.org
Mon, 11 Jul 2005 20:37:28 -0000
raeburn Mon Jul 11 16:37:28 2005 EDT
Modified files:
/modules/raeburn monitor.pl
Log:
Passing of upass parameters changed because log-in now supports longer passwords (upass split into three parts). Changes to londes_auto.js required.
Index: modules/raeburn/monitor.pl
diff -u modules/raeburn/monitor.pl:1.3 modules/raeburn/monitor.pl:1.4
--- modules/raeburn/monitor.pl:1.3 Wed Apr 6 13:04:30 2005
+++ modules/raeburn/monitor.pl Mon Jul 11 16:37:26 2005
@@ -33,7 +33,11 @@
# Modifications include the following new lines at line 71.
# var uextkey = arguments[0];
# var lextkey = arguments[1];
-# var upass = arguments[2];
+# var upass = '';
+# var arglen = arguments.length;
+# if (arglen == 3) {
+# upass = arguments[2];
+# }
# initkeys()
# var newpass = crypted(upass);
# print (newpass);
@@ -101,7 +105,8 @@
# Configuration
#
my $monitordir = '/home/msuremot/monitoring';
-my $path_to_java = '/usr/java/j2sdk1.4.2_05/bin/java';
+#my $path_to_java = '/usr/java/j2sdk1.4.2_05/bin/java';
+my $path_to_java = '/usr/java/j2re1.4.2_07/bin/java';
my $contact_email = 'helpdesk@loncapa.org';
#
#########################################################
@@ -232,7 +237,7 @@
$paramcount ++;
}
}
- if ($paramcount = scalar(@formitems)) {
+ if ($paramcount == scalar(@formitems)) {
$outcome = 'ok';
} else {
$outcome = 'missingparam';
@@ -243,10 +248,19 @@
sub logmein {
my ($server,$uname,$udom,$upass,$ua,$loncookie_file,$formvalues,$loadtimes,$monitordir,$path_to_java) = @_;
my ($outcome,$lonid);
+ my $upass0 = substr($upass,0,15);
+ my $upass1 = substr($upass,15,15);
+ my $upass2 = substr($upass,30,15);
my $classpath="$monitordir/js.jar";
my $londesfile = "$monitordir/londes_auto.js";
- open(PIPE,"-|") || exec "$path_to_java -classpath $classpath org.mozilla.javascript.tools.shell.Main $londesfile $$formvalues{uextkey} $$formvalues{lextkey} $upass";
- my $cryppass = <PIPE>;
+ open(PIPE,"-|") || exec "$path_to_java -classpath $classpath org.mozilla.javascript.tools.shell.Main $londesfile $$formvalues{uextkey} $$formvalues{lextkey} $upass0";
+ my $cryppass0 = <PIPE>;
+ close PIPE;
+ open(PIPE,"-|") || exec "$path_to_java -classpath $classpath org.mozilla.javascript.tools.shell.Main $londesfile $$formvalues{uextkey} $$formvalues{lextkey} $upass1";
+ my $cryppass1 = <PIPE>;
+ close PIPE;
+ open(PIPE,"-|") || exec "$path_to_java -classpath $classpath org.mozilla.javascript.tools.shell.Main $londesfile $$formvalues{uextkey} $$formvalues{lextkey} $upass2";
+ my $cryppass2 = <PIPE>;
close PIPE;
my $URL = 'http://'.$server.'/adm/authenticate';
$ua->cookie_jar( $loncookie_file );
@@ -256,7 +270,9 @@
[
uname => "$uname",
udom => "$udom",
- upass => "$cryppass",
+ upass0 => "$cryppass0",
+ upass1 => "$cryppass1",
+ upass2 => "$cryppass2",
logtoken => "$$formvalues{logtoken}",
serverid => "$$formvalues{serverid}",
];