Migrated auth_filter_t to INIT/METHOD macros.
This commit is contained in:
@@ -40,11 +40,9 @@ struct private_auth_filter_t {
|
|||||||
database_t *db;
|
database_t *db;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
METHOD(filter_t, run, bool,
|
||||||
* Implementation of filter_t.run
|
private_auth_filter_t *this, request_t *request, char *controller,
|
||||||
*/
|
char *action, char *p2, char *p3, char *p4, char *p5)
|
||||||
static bool run(private_auth_filter_t *this, request_t *request,
|
|
||||||
char *controller, char *action)
|
|
||||||
{
|
{
|
||||||
if (this->user->get_user(this->user))
|
if (this->user->get_user(this->user))
|
||||||
{
|
{
|
||||||
@@ -72,10 +70,8 @@ static bool run(private_auth_filter_t *this, request_t *request,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
METHOD(filter_t, destroy, void,
|
||||||
* Implementation of filter_t.destroy
|
private_auth_filter_t *this)
|
||||||
*/
|
|
||||||
static void destroy(private_auth_filter_t *this)
|
|
||||||
{
|
{
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
@@ -85,13 +81,18 @@ static void destroy(private_auth_filter_t *this)
|
|||||||
*/
|
*/
|
||||||
filter_t *auth_filter_create(user_t *user, database_t *db)
|
filter_t *auth_filter_create(user_t *user, database_t *db)
|
||||||
{
|
{
|
||||||
private_auth_filter_t *this= malloc_thing(private_auth_filter_t);
|
private_auth_filter_t *this;
|
||||||
|
|
||||||
this->public.filter.destroy = (void(*)(filter_t*))destroy;
|
INIT(this,
|
||||||
this->public.filter.run = (bool(*)(filter_t*, request_t*,char*,char*,char*,char*,char*,char*))run;
|
.public = {
|
||||||
|
.filter = {
|
||||||
this->user = user;
|
.destroy = _destroy,
|
||||||
this->db = db;
|
.run = _run,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
.user = user,
|
||||||
|
.db = db,
|
||||||
|
);
|
||||||
|
|
||||||
return &this->public.filter;
|
return &this->public.filter;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user