Branch: Tag:

2001-01-30

2001-01-30 04:49:55 by Per Hedbor <ph@opera.com>

Added list_users and list_groups methods to the configuration object

Rev: server/base_server/configuration.pike:1.416

1:   // A vitual server's main configuration   // Copyright © 1996 - 2000, Roxen IS. - constant cvs_version = "$Id: configuration.pike,v 1.415 2001/01/29 05:47:58 per Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.416 2001/01/30 04:49:55 per Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>
679:   {    User uid;    -  if( id->misc->authenticated_user +  if( id && id->misc->authenticated_user    && ( uid = id->misc->authenticated_user->database->find_user( user ) ))    return uid;   
688:    return uid;   }    + array(string) list_users() + //! Fetches the full list of valid usernames from the authentication + //! modules by calling the list-users() methods. + { +  array(string) list = ({}); +  foreach( user_databases(), UserDB m ) +  list |= m->list_users(); +  return list; + } +  + array(string) list_groups() + //! Fetches the full list of valid groupnames from the authentication + //! modules by calling the list-users() methods. + { +  array(string) list = ({}); +  foreach( user_databases(), UserDB m ) +  list |= m->list_groups(); +  return list; + } +  +  +    Group find_group( string group, RequestID|void id )   //! Tries to find the specified group in the currently available user   //! databases. If id is specified, this function defaults to the
697:   {    Group uid;    -  if( id->misc->authenticated_user +  if( id && id->misc->authenticated_user    && ( uid = id->misc->authenticated_user->database->find_group( group ) ))    return uid;