Help for this page

Select Code to Download


  1. or download this
    # Loads user information, logs users in and out, controls cookies
    my $user = My::Authentication::load();
    
  2. or download this
    # Loads user information, logs users in and out, controls cookies
    my $user = My::Authentication->load;
    
  3. or download this
    #allow user administration. (for registration etc)
    My::Authentication::add_user($username, $password, { #hash to store da
    +ta }, [ roles ]);
    My::Authentication::del_user($username);
    
  4. or download this
    #allow user administration. (for registration etc)
    My::Authentication->add_user($username, $password, { #hash to store da
    +ta }, [ roles ]);
    My::Authentication->del_user($username);
    
  5. or download this
    #allow user administration. (for registration etc)
    my $suspect = My::Authentication->add_user($username, $password, { #ha
    +sh to store data });
    $suspect->add_roles(roles);
    
  6. or download this
    # Loads user information, logs users in and out, controls cookies
    my $user = My::Authentication->load;
    ...
    
    # require a user to be an admin, or give them an "Access denied page"
    $user->require('admin', undef);