diff options
author | Christophe Nowicki <cnowicki@easter-eggs.com> | 2004-08-16 15:03:48 +0000 |
---|---|---|
committer | Christophe Nowicki <cnowicki@easter-eggs.com> | 2004-08-16 15:03:48 +0000 |
commit | c398b83f37550f400b3a8f13d32cc6d5f2b75ed9 (patch) | |
tree | 2cf759482f6c3cfb031b065dc87692f06ba20de7 | |
parent | efa9e723b14e730d678df3efe1aa70ff8c706e2f (diff) | |
download | lasso-c398b83f37550f400b3a8f13d32cc6d5f2b75ed9.tar.gz lasso-c398b83f37550f400b3a8f13d32cc6d5f2b75ed9.tar.xz lasso-c398b83f37550f400b3a8f13d32cc6d5f2b75ed9.zip |
Add lasso_profile_get_identity, lasso_profile_is_identity_dirty, lasso_profile_get_session, lasso_profile_is_session_dirty
-rw-r--r-- | php/environs/lasso_profile.c | 100 | ||||
-rw-r--r-- | php/environs/lasso_session.c | 1 | ||||
-rw-r--r-- | php/lasso.c | 7 | ||||
-rw-r--r-- | php/php_lasso.h | 7 |
4 files changed, 112 insertions, 3 deletions
diff --git a/php/environs/lasso_profile.c b/php/environs/lasso_profile.c index 722d5655..ecaa0137 100644 --- a/php/environs/lasso_profile.c +++ b/php/environs/lasso_profile.c @@ -189,7 +189,6 @@ PHP_FUNCTION(lasso_profile_get_msg_url) { if (ctx->msg_url) RETURN_STRING(ctx->msg_url, 1); } - /* }}} */ /* {{{ proto string lasso_profile_get_msg_body(resource ctx) */ @@ -243,3 +242,102 @@ PHP_FUNCTION(lasso_profile_get_msg_relaystate) { RETURN_STRING(ctx->msg_relayState, 1); } /* }}} */ + + +/* {{{ proto string lasso_profile_get_identity(resource ctx) */ +PHP_FUNCTION(lasso_profile_get_identity) { + LassoProfile *ctx; + LassoIdentity *identity; + + zval *parm; + + int num_args; + int ret; + + if ((num_args = ZEND_NUM_ARGS()) != 1) + WRONG_PARAM_COUNT + + if (zend_parse_parameters(num_args TSRMLS_CC, "z", &parm) == FAILURE) { + return; + } + + ZEND_FETCH_RESOURCE(ctx, LassoProfile *, &parm, -1, le_lassoprofile_name, le_lassoprofile); + + identity = lasso_profile_get_identity(ctx); + + ZEND_REGISTER_RESOURCE(return_value, identity, le_lassoidentity); +} +/* }}} */ + +/* {{{ proto string lasso_profile_is_identity_dirty(resource ctx) */ +PHP_FUNCTION(lasso_profile_is_identity_dirty) { + LassoProfile *ctx; + + zval *parm; + + int num_args; + int ret; + + if ((num_args = ZEND_NUM_ARGS()) != 1) + WRONG_PARAM_COUNT + + if (zend_parse_parameters(num_args TSRMLS_CC, "z", &parm) == FAILURE) { + return; + } + + ZEND_FETCH_RESOURCE(ctx, LassoProfile *, &parm, -1, le_lassoprofile_name, le_lassoprofile); + + ret = lasso_profile_is_identity_dirty(ctx); + + RETURN_BOOL(ret); +} +/* }}} */ + +/* {{{ proto string lasso_profile_get_session(resource ctx) */ +PHP_FUNCTION(lasso_profile_get_session) { + LassoProfile *ctx; + LassoSession *session; + + zval *parm; + + int num_args; + int ret; + + if ((num_args = ZEND_NUM_ARGS()) != 1) + WRONG_PARAM_COUNT + + if (zend_parse_parameters(num_args TSRMLS_CC, "z", &parm) == FAILURE) { + return; + } + + ZEND_FETCH_RESOURCE(ctx, LassoProfile *, &parm, -1, le_lassoprofile_name, le_lassoprofile); + + session = lasso_profile_get_session(ctx); + + ZEND_REGISTER_RESOURCE(return_value, session, le_lassosession); +} +/* }}} */ + +/* {{{ proto string lasso_profile_is_session_dirty(resource ctx) */ +PHP_FUNCTION(lasso_profile_is_session_dirty) { + LassoProfile *ctx; + + zval *parm; + + int num_args; + int ret; + + if ((num_args = ZEND_NUM_ARGS()) != 1) + WRONG_PARAM_COUNT + + if (zend_parse_parameters(num_args TSRMLS_CC, "z", &parm) == FAILURE) { + return; + } + + ZEND_FETCH_RESOURCE(ctx, LassoProfile *, &parm, -1, le_lassoprofile_name, le_lassoprofile); + + ret = lasso_profile_is_session_dirty(ctx); + + RETURN_BOOL(ret); +} +/* }}} */ diff --git a/php/environs/lasso_session.c b/php/environs/lasso_session.c index d5b8e307..b0b297ec 100644 --- a/php/environs/lasso_session.c +++ b/php/environs/lasso_session.c @@ -32,3 +32,4 @@ #include "lasso.h" + diff --git a/php/lasso.c b/php/lasso.c index 54aecf84..06e98af0 100644 --- a/php/lasso.c +++ b/php/lasso.c @@ -79,7 +79,7 @@ function_entry lasso_functions[] = { PHP_FE(lasso_identity_dump, NULL) PHP_FE(lasso_identity_destroy, NULL) - /* lasso_profile_.c */ + /* lasso_profile.c */ PHP_FE(lasso_profile_new, NULL) PHP_FE(lasso_profile_dump, NULL) PHP_FE(lasso_profile_set_remote_providerid, NULL) @@ -90,6 +90,11 @@ function_entry lasso_functions[] = { PHP_FE(lasso_profile_get_request, NULL) PHP_FE(lasso_profile_get_msg_url, NULL) PHP_FE(lasso_profile_get_msg_body, NULL) + PHP_FE(lasso_profile_get_msg_relaystate, NULL) + PHP_FE(lasso_profile_get_identity, NULL) + PHP_FE(lasso_profile_is_identity_dirty, NULL) + PHP_FE(lasso_profile_get_session, NULL) + PHP_FE(lasso_profile_is_session_dirty, NULL) /* lasso_lib_authn_request.c */ PHP_FE(lasso_cast_to_lib_authn_request, NULL) diff --git a/php/php_lasso.h b/php/php_lasso.h index 0620a3f0..bfff97fc 100644 --- a/php/php_lasso.h +++ b/php/php_lasso.h @@ -86,7 +86,7 @@ PHP_FUNCTION(lasso_identity_destroy); /* lasso_federation.c */ PHP_FUNCTION(lasso_federation_new); -/* lasso_profile_.c */ +/* lasso_profile.c */ PHP_FUNCTION(lasso_profile_new); PHP_FUNCTION(lasso_profile_dump); PHP_FUNCTION(lasso_profile_set_remote_providerid); @@ -98,6 +98,11 @@ PHP_FUNCTION(lasso_profile_get_request); PHP_FUNCTION(lasso_profile_get_msg_url); PHP_FUNCTION(lasso_profile_get_msg_body); PHP_FUNCTION(lasso_profile_get_msg_relaystate); +PHP_FUNCTION(lasso_profile_get_identity); +PHP_FUNCTION(lasso_profile_is_identity_dirty); +PHP_FUNCTION(lasso_profile_get_session); +PHP_FUNCTION(lasso_profile_is_session_dirty); + /* lasso_lib_authn_request.c */ PHP_FUNCTION(lasso_cast_to_lib_authn_request); |