[LON-CAPA-cvs] cvs: loncom /interface createaccount.pm

raeburn raeburn at source.lon-capa.org
Sun Nov 12 15:42:52 EST 2017


raeburn		Sun Nov 12 20:42:52 2017 EDT

  Modified files:              
    /loncom/interface	createaccount.pm 
  Log:
  - Use three-argument open() to separate file mode from the filename.
  
  
Index: loncom/interface/createaccount.pm
diff -u loncom/interface/createaccount.pm:1.75 loncom/interface/createaccount.pm:1.76
--- loncom/interface/createaccount.pm:1.75	Thu Aug  3 20:06:21 2017
+++ loncom/interface/createaccount.pm	Sun Nov 12 20:42:52 2017
@@ -4,7 +4,7 @@
 # kerberos, or SSO) or an e-mail address. Requests to use an e-mail address as
 # username may be processed automatically, or may be queued for approval.
 #
-# $Id: createaccount.pm,v 1.75 2017/08/03 20:06:21 raeburn Exp $
+# $Id: createaccount.pm,v 1.76 2017/11/12 20:42:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -328,7 +328,7 @@
         &print_header($r,$start_page,$courseid,$pagetitle);
         my $now=time;
         if ((grep(/^login$/,@{$cancreate})) && (!grep(/^email$/,@{$cancreate}))) {
-            if (open(my $jsh,"<$include/londes.js")) {
+            if (open(my $jsh,"<","$include/londes.js")) {
                 while(my $line = <$jsh>) {
                     $r->print($line);
                 }
@@ -1089,7 +1089,7 @@
     my ($r,$domain,$lonhost,$include,$now,$captchaform,$courseid,$emailusername,$captcha,
         $usertype,$recaptchaversion,$usernameset,$condition,$excluded) = @_;
     my ($error,$output);
-    if (open(my $jsh,"<$include/londes.js")) {
+    if (open(my $jsh,"<","$include/londes.js")) {
         while(my $line = <$jsh>) {
             $r->print($line);
         }
@@ -1886,14 +1886,14 @@
     if (defined($r->dir_config('lonSSOUserLogoutMessageFile_'.$domain))) {
         my $msgfile = $r->dir_config('lonSSOUserLogoutMessageFile_'.$domain);
         if (-e $msgfile) {
-            open(my $fh,"<$msgfile");
+            open(my $fh,"<",$msgfile);
             $endsessionmsg = join('',<$fh>);
             close($fh);
         }
     } elsif (defined($r->dir_config('lonSSOUserLogoutMessageFile'))) {
         my $msgfile = $r->dir_config('lonSSOUserLogoutMessageFile');
         if (-e $msgfile) {     
-            open(my $fh,"<$msgfile");
+            open(my $fh,"<",$msgfile);
             $endsessionmsg = join('',<$fh>);
             close($fh);
         }




More information about the LON-CAPA-cvs mailing list