Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Server
Tiny Tiny RSS
Commits
3bb7e191
Commit
3bb7e191
authored
Dec 16, 2009
by
Andrew Dolgov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: allow session id overriding
parent
7af0309b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
api/index.php
api/index.php
+8
-2
No files found.
api/index.php
View file @
3bb7e191
...
...
@@ -12,6 +12,12 @@
$session_expire
=
SESSION_EXPIRE_TIME
;
//seconds
$session_name
=
(
!
defined
(
'TTRSS_SESSION_NAME'
))
?
"ttrss_sid_api"
:
TTRSS_SESSION_NAME
.
"_api"
;
session_name
(
$session_name
);
if
(
$_REQUEST
[
"sid"
])
{
session_id
(
$_REQUEST
[
"sid"
]);
}
session_start
();
if
(
!
$link
)
{
...
...
@@ -57,7 +63,7 @@
if
(
get_pref
(
$link
,
"ENABLE_API_ACCESS"
,
$uid
))
{
if
(
authenticate_user
(
$link
,
$login
,
$password
))
{
print
json_encode
(
array
(
"
uid"
=>
$_SESSION
[
"uid"
]
));
print
json_encode
(
array
(
"
session_id"
=>
session_id
()
));
}
else
{
print
json_encode
(
array
(
"error"
=>
"LOGIN_ERROR"
));
}
...
...
@@ -68,7 +74,7 @@
break
;
case
"logout"
:
logout_user
();
print
json_encode
(
array
(
"
uid
"
=>
0
));
print
json_encode
(
array
(
"
status
"
=>
"OK"
));
break
;
case
"isLoggedIn"
:
print
json_encode
(
array
(
"status"
=>
$_SESSION
[
"uid"
]
!=
''
));
...
...
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