2008-05-21 14:19:38 +02:00
|
|
|
/*
|
|
|
|
* The contents of this file are subject to the Initial
|
|
|
|
* Developer's Public License Version 1.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
|
|
|
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed AS IS,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing rights
|
|
|
|
* and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code was created by Alex Peshkov
|
|
|
|
* for the Firebird Open Source RDBMS project.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2008 Alex Peshkov <alexpeshkoff@users.sf.net>
|
|
|
|
* and all contributors signed below.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef JRD_USER_MANAGEMENT_H
|
|
|
|
#define JRD_USER_MANAGEMENT_H
|
|
|
|
|
|
|
|
#include "firebird.h"
|
2009-02-19 13:59:32 +01:00
|
|
|
#include "../common/classes/array.h"
|
2010-07-09 14:51:05 +02:00
|
|
|
#include "../common/classes/fb_string.h"
|
2008-05-21 14:19:38 +02:00
|
|
|
#include "../jrd/ibase.h"
|
2010-07-09 14:51:05 +02:00
|
|
|
#include "../jrd/DatabaseSnapshot.h"
|
2010-07-13 14:31:35 +02:00
|
|
|
#include "../jrd/recsrc/RecordSource.h"
|
2011-12-23 13:43:58 +01:00
|
|
|
#include "firebird/Auth.h"
|
2011-03-02 14:42:56 +01:00
|
|
|
#include "../common/security.h"
|
2008-05-21 14:19:38 +02:00
|
|
|
|
|
|
|
namespace Jrd {
|
|
|
|
|
|
|
|
class thread_db;
|
2009-02-19 13:59:32 +01:00
|
|
|
class jrd_tra;
|
2010-07-09 14:51:05 +02:00
|
|
|
class RecordBuffer;
|
2008-05-21 14:19:38 +02:00
|
|
|
|
2010-07-13 14:31:35 +02:00
|
|
|
class UsersTableScan: public VirtualTableScan
|
|
|
|
{
|
|
|
|
public:
|
2012-04-12 11:02:13 +02:00
|
|
|
UsersTableScan(CompilerScratch* csb, const Firebird::string& name, StreamType stream)
|
2010-07-13 14:31:35 +02:00
|
|
|
: VirtualTableScan(csb, name, stream)
|
|
|
|
{}
|
|
|
|
|
2011-02-18 01:52:10 +01:00
|
|
|
protected:
|
2011-02-15 09:47:51 +01:00
|
|
|
const Format* getFormat(thread_db* tdbb, jrd_rel* relation) const;
|
2010-07-13 14:31:35 +02:00
|
|
|
bool retrieveRecord(thread_db* tdbb, jrd_rel* relation, FB_UINT64 position, Record* record) const;
|
|
|
|
};
|
|
|
|
|
2008-05-21 14:19:38 +02:00
|
|
|
// User management argument for deferred work
|
2010-07-09 14:51:05 +02:00
|
|
|
class UserManagement : public DataDump
|
2008-05-21 14:19:38 +02:00
|
|
|
{
|
|
|
|
public:
|
2009-02-19 13:59:32 +01:00
|
|
|
explicit UserManagement(jrd_tra* tra);
|
2008-05-21 14:19:38 +02:00
|
|
|
~UserManagement();
|
2008-05-22 23:45:22 +02:00
|
|
|
|
2009-02-19 13:59:32 +01:00
|
|
|
// store userData for DFW-time processing
|
2013-11-18 14:28:47 +01:00
|
|
|
USHORT put(Auth::DynamicUserData* userData);
|
2009-02-19 13:59:32 +01:00
|
|
|
// execute command with ID
|
|
|
|
void execute(USHORT id);
|
|
|
|
// commit transaction in security database
|
|
|
|
void commit();
|
2010-07-09 14:51:05 +02:00
|
|
|
// return users list for SEC$USERS
|
2010-07-13 14:31:35 +02:00
|
|
|
RecordBuffer* getList(thread_db* tdbb, jrd_rel* relation);
|
2011-03-02 14:42:56 +01:00
|
|
|
// callback for users display
|
2011-04-08 17:18:50 +02:00
|
|
|
void list(Auth::IUser* u);
|
2009-02-19 13:59:32 +01:00
|
|
|
|
2008-05-21 14:19:38 +02:00
|
|
|
private:
|
2010-07-09 14:51:05 +02:00
|
|
|
thread_db* threadDbb;
|
2013-11-18 14:28:47 +01:00
|
|
|
Firebird::HalfStaticArray<Auth::DynamicUserData*, 8> commands;
|
2011-04-08 17:18:50 +02:00
|
|
|
Auth::IManagement* manager;
|
2010-07-09 14:51:05 +02:00
|
|
|
|
2011-12-26 17:06:00 +01:00
|
|
|
static void checkSecurityResult(int errcode, Firebird::IStatus* status, const char* userName, Auth::IUser* user);
|
2008-05-21 14:19:38 +02:00
|
|
|
};
|
|
|
|
|
2008-12-24 01:32:49 +01:00
|
|
|
} // namespace
|
2008-05-21 14:19:38 +02:00
|
|
|
|
|
|
|
#endif // JRD_USER_MANAGEMENT_H
|