Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-rest
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-rest
Commits
61044990
Commit
61044990
authored
Feb 22, 2012
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- REST Authentication:
Now also honoring ad_session_id
parent
93b9a78e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
intranet-rest-util-procs.tcl
tcl/intranet-rest-util-procs.tcl
+23
-1
No files found.
tcl/intranet-rest-util-procs.tcl
View file @
61044990
...
...
@@ -91,7 +91,8 @@ ad_proc -private im_rest_cookie_auth_user_id {
set cookie_list
[
split
$cookie
_string
";"
]
# ns_log Notice
"im_rest_cookie_auth_user_id: cookie=
$cookie
_string
\n
"
# ns_log Notice
"im_rest_cookie_auth_user_id: cookie_list=
$cookie
_list
\n
"
array set cookie_hash
{}
foreach l
$cookie
_list
{
if
{[
regexp
{([
^ =
]
+
)
\=
(
.+
)}
$l
match key value
]}
{
...
...
@@ -102,6 +103,27 @@ ad_proc -private im_rest_cookie_auth_user_id {
}
}
set user_id
""
if
{[
info
exists cookie_hash
(
ad_session_id
)]}
{
set ad_session_id
$cookie
_hash
(
ad_session_id
)
ns_log Notice
"im_rest_cookie_auth_user_id: ad_session_id=
$ad
_session_id"
set user_id
""
catch
{
set user_id
[
ad_get_user_id
]
}
if
{
""
!=
$user
_id
}
{
ns_log Notice
"im_rest_cookie_auth_user_id: found autenticated user_id: storing into cache"
ns_cache set im_rest
$ad
_session_id
$user
_id
return
$user
_id
}
if
{[
ns_cache get im_rest
$ad
_session_id value
]}
{
ns_log Notice
"im_rest_cookie_auth_user_id: Didn't find autenticated user_id: returning cached value"
return
$value
}
}
if
{[
info
exists cookie_hash
(
ad_user_login
)]}
{
set ad_user_login
$cookie
_hash
(
ad_user_login
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment