1 /* Copyright (C) 2000-2004 Thomas Bopp, Thorsten Hampel, Ludger Merkens
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * $Id: secure_n_n.pike,v 1.1 2008/03/31 13:39:57 exodusd Exp $
19 inherit "/kernel/module";
20 inherit "/kernel/db_n_n";
23 class secure_n_n : public module,db_n_n{
31 * called on initialization.
32 * connects the secure_n_n table with the according database handle.
47 * look up a user object from the sTeam database by username.
49 * @param string - username
50 * @return object - proxy associated with the user.
53 mixed lookup(string key)
56 try_event(EVENT_DB_QUERY, CALLER, key);
58 run_event(EVENT_DB_QUERY, CALLER, key);
63 * removes a key from the key lookup table, called on deletion of a key.
64 * @param string key - the name the key is registered with
68 int unregister(string key)
71 try_event(EVENT_DB_UNREGISTER, CALLER, key);
73 run_event(EVENT_DB_UNREGISTER, CALLER, key);
78 * registers a key in the sTeam database with it's keyname.
79 * Notice, this will remove all values previously set to this key
81 * @param string - uname (name to register with)
82 * @param object - key (the (proxy) object to register)
86 int register(array keys, object obj)
89 try_event(EVENT_DB_REGISTER, CALLER, obj, keys);
91 ::set_value(keys, obj);
92 run_event(EVENT_DB_REGISTER, CALLER, obj, keys);
96 // int get_object_id()
98 // return __module::get_object_id();
106 try_event(EVENT_DB_QUERY, CALLER);
108 run_event(EVENT_DB_QUERY, CALLER);