[LON-CAPA-cvs] cvs: modules /msu localenroll.pm

raeburn raeburn at source.lon-capa.org
Sat Feb 26 22:05:10 EST 2022


raeburn		Sun Feb 27 03:05:10 2022 EDT

  Modified files:              
    /modules/msu	localenroll.pm 
  Log:
  - Integration with MSU campus information systems
    If MSU email address was entered as username in standard LON-CAPA log-in 
    page, authentication can be tried using just the MSUNetID as username.
  
  
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.92 modules/msu/localenroll.pm:1.93
--- modules/msu/localenroll.pm:1.92	Fri Feb 25 10:23:45 2022
+++ modules/msu/localenroll.pm	Sun Feb 27 03:05:10 2022
@@ -1,6 +1,6 @@
 # functions to glue school database system into Lon-CAPA for
 # automated enrollment
-# $Id: localenroll.pm,v 1.92 2022/02/25 10:23:45 raeburn Exp $
+# $Id: localenroll.pm,v 1.93 2022/02/27 03:05:10 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2459,6 +2459,20 @@
     return 'ok';
 }
 
+sub unamemap_rules {
+    my ($dom,$ruleshash,$rulesorder) = @_;
+    if ($dom eq 'msu') {
+        %{$ruleshash} = (
+                         msuemail  => {
+                                       name     => 'MSU Email address to MSUNetID',
+                                       desc     => 'Extract netid from netid at msu.edu',
+                                      },
+                        );
+        @{$rulesorder} = ('msuemail');
+    }
+    return 'ok';
+}
+
 sub username_check {
     my ($dom,$uname,$to_check,$resultshash) = @_;
     my $outcome;
@@ -2531,6 +2545,23 @@
     return $outcome;
 }
 
+sub unamemap_check {
+    my ($dom,$uname,$to_check,$resultshash) = @_;
+    my $outcome;
+    if ((ref($to_check) eq 'ARRAY') &&
+        (ref($resultshash) eq 'HASH')) {
+        foreach my $item (@{$to_check}) {
+            if ($item eq 'msuemail') {
+                if ($uname =~ /^(\w{2,8})\@msu\.edu$/) {
+                    $resultshash->{$item} = $1;
+                }
+            }
+        }
+        $outcome = 'ok';
+    }
+    return $outcome;
+}
+
 ###############################
 # sub AUTOLOAD
 #




More information about the LON-CAPA-cvs mailing list