# Copyright (c) 2005-2008 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: RealmOwner.bunit,v 1.7 2009/05/20 20:10:47 moeller Exp $ Request(); my($email) = ShellUtil_SQL()->DEMO_EMAIL; my($name) = ShellUtil_SQL()->DEMO; my($id) = unauth_model(RealmOwner => {name => $name})->get('realm_id'); my($_RT) = __PACKAGE__->use('Auth.RealmType'); [ { object => [req()], compute_return => sub { return [shift->get('object')->unsafe_get('name')]; }, } => [ unauth_load_by_email => [ $email => $name, [$email, realm_type => $_RT->USER] => $name, [$email, realm_type => $_RT->CLUB] => [undef], [$email, {realm_type => $_RT->USER}] => $name, [$email, {realm_type => $_RT->CLUB}] => [undef], ], unauth_load_by_id_or_name_or_die => [ not_a_user => MODEL_NOT_FOUND(), $name => $name, $id => $name, ], unauth_load_by_email_id_or_name => [ not_a_user => [undef], $name => $name, $id => $name, $email => $name, ], create => [ [{ realm_id => '12345', name => '', display_name => '', realm_type => $_RT->CLUB, }] => DB_ERROR(), ], ], ];