--- loncom/lonnet/perl/lonnet.pm 2019/02/26 14:42:27 1.1406 +++ loncom/lonnet/perl/lonnet.pm 2019/04/24 01:44:46 1.1407 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1406 2019/02/26 14:42:27 raeburn Exp $ +# $Id: lonnet.pm,v 1.1407 2019/04/24 01:44:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2721,6 +2721,29 @@ sub course_portal_url { return $firsturl; } +# --------------------------------------------- Get domain config for passwords + +sub get_passwdconf { + my ($dom) = @_; + my (%passwdconf,$gotconf,$lookup); + my ($result,$cached)=&is_cached_new('passwdconf',$dom); + if (defined($cached)) { + if (ref($result) eq 'HASH') { + %passwdconf = %{$result}; + $gotconf = 1; + } + } + unless ($gotconf) { + my %domconfig = &get_dom('configuration',['passwords'],$dom); + if (ref($domconfig{'passwords'}) eq 'HASH') { + %passwdconf = %{$domconfig{'passwords'}}; + } + my $cachetime = 24*60*60; + &do_cache_new('passwdconf',$dom,\%passwdconf,$cachetime); + } + return %passwdconf; +} + # --------------------------------------------------- Assign a key to a student sub assign_access_key {