Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: ODS briefcase login out of date #1149

Open
wants to merge 1 commit into
base: develop/7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions appsrc/ODS-Briefcase/new/od-a-code.sql
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ _end:;

-------------------------------------------------------------------------------
--
create procedure ODRIVE.WA.session_restore (
inout params any)
create procedure ODRIVE.WA.session_restore ( inout params any, inout lines any)
{
declare domain_id, user_id, user_name, user_role, sid, realm, options any;
declare domain_id, user_id, user_name, user_role, sid, realm, options, cookies any;

sid := get_keyword ('sid', params, '');
realm := get_keyword ('realm', params, 'wa');
cookies := DB.DBA.vsp_ua_get_cookie_vec (lines);
if (sid = '')
sid := get_keyword ('sid', cookies, '');
domain_id := ODRIVE.WA.session_domain (params);
user_id := -1;
user_role := 'expire';
Expand Down
4 changes: 2 additions & 2 deletions appsrc/ODS-Briefcase/www/ajax.vsp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
action := get_keyword ('a', params, '');
subAction := get_keyword ('sa', params, '');

sessionData := ODRIVE.WA.session_restore (params);
sessionData := ODRIVE.WA.session_restore (params, lines);
_domain_id := cast (get_keyword ('domain_id', sessionData, '0') as integer);
_account_id := cast (get_keyword ('user_id', sessionData, '0') as integer);
_account_name := ODRIVE.WA.account_name (_account_id);
Expand Down Expand Up @@ -244,4 +244,4 @@
http ( '</table>');
http ( '</div>');
}
?>
?>
2 changes: 1 addition & 1 deletion appsrc/ODS-Briefcase/www/odrive_login.vspx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-->
<v:login name="odrive_login" realm="wa" mode="url" xmlns:v="http://www.openlinksw.com/vspx/" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<v:login name="odrive_login" realm="wa" mode="cookie" xmlns:v="http://www.openlinksw.com/vspx/" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<v:template name='inl' type='if-no-login'/>
<v:after-data-bind>
<![CDATA[
Expand Down
2 changes: 1 addition & 1 deletion appsrc/ODS-Briefcase/www/template/popup.vspx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
-- Initialize variables
declare aSessInfo any;

aSessInfo := ODRIVE.WA.session_restore (params);
aSessInfo := ODRIVE.WA.session_restore (params, lines);
self.domain_id := cast (get_keyword ('domain_id', aSessInfo, '-1') as integer);
self.account_id := cast (get_keyword ('user_id', aSessInfo, '-1') as integer);
self.account_role := get_keyword ('user_role', aSessInfo, '');
Expand Down
2 changes: 1 addition & 1 deletion appsrc/ODS-Briefcase/www/template/template.vspx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
-- Initialize variables
declare aSessInfo any;

aSessInfo := ODRIVE.WA.session_restore (params);
aSessInfo := ODRIVE.WA.session_restore (params, lines);
self.domain_id := cast (get_keyword ('domain_id', aSessInfo, '-1') as integer);
self.owner_id := ODRIVE.WA.domain_owner_id (self.domain_id);
self.account_id := cast (get_keyword ('user_id', aSessInfo, '-1') as integer);
Expand Down
4 changes: 3 additions & 1 deletion appsrc/ODS-Framework/comp/login.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@
if (get_keyword('cb_remember_me', self.vc_event.ve_params) is not null)
expire := sprintf (' expires=%s;', date_rfc1123 (dateadd ('hour', 1, now())));

cook_str := http_header_get () || sprintf ('Set-Cookie: sid=%s;%s path=/\r\n', self.sid, expire);
cook_str := http_header_get () ||
sprintf ('Set-Cookie: sid=%s; %s path=/\r\n', self.sid, expire) ||
sprintf ('Set-Cookie: realm=%s; %s path=/\r\n', self.realm, expire);
http_header (cook_str);
}
]]>
Expand Down
4 changes: 3 additions & 1 deletion appsrc/ODS-Framework/comp/register.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
http_header (sprintf ('Location: %s%ssid=%s&realm=wa\r\n', self.ret_page, delim, self.sid));
}
if (strstr (http_header_get (), 'Set-Cookie: sid=') is null)
http_header (http_header_get () || sprintf ('Set-Cookie: sid=%s; path=/\r\n', self.sid));
http_header (http_header_get () ||
sprintf ('Set-Cookie: sid=%s; path=/\r\n', self.sid) ||
sprintf ('Set-Cookie: realm=%s; %s path=/\r\n', self.realm, expire));

http_flush ();
}
Expand Down
8 changes: 2 additions & 6 deletions appsrc/ODS-Framework/comp/services.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,8 @@ function selectAllCheckboxes (form, btn, txt)
_owner_id := (select WAM_USER from WA_MEMBER where WAM_MEMBER_TYPE = 1 and WAM_INST = (control.vc_parent as vspx_row_template).te_rowset[3]);
_owner_name := (select U_NAME from DB.DBA.SYS_USERS where U_ID = _owner_id);
sid := md5 (concat (datestring (now ()), http_client_ip (), http_path ()));
insert into DB.DBA.VSPX_SESSION (VS_REALM, VS_SID, VS_UID, VS_STATE, VS_EXPIRY)
values ('wa', sid, _owner_name,
serialize (
vector (
'vspx_user', _owner_name)
), now());
insert into DB.DBA.VSPX_SESSION (VS_REALM, VS_SID, VS_UID, VS_STATE, VS_EXPIRY, VS_IP)
values ('wa', sid, _owner_name, serialize ( vector ( 'vspx_user', _owner_name)), now(), http_client_ip());
http_request_status ('HTTP/1.1 302 Found');
http_header(sprintf('Location: services.vspx?sid=%s&realm=wa\r\n', sid));
]]>
Expand Down
4 changes: 2 additions & 2 deletions appsrc/ODS-Framework/fb_front.vspx
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@
declare _sid varchar;

_sid := md5 (concat (datestring (now ()), http_client_ip (), http_path ()));
insert into DB.DBA.VSPX_SESSION (VS_REALM, VS_SID, VS_UID, VS_STATE, VS_EXPIRY)
values ('wa', _sid, _user_name, serialize (vector ('vspx_user', _user_name)), now());
insert into DB.DBA.VSPX_SESSION (VS_REALM, VS_SID, VS_UID, VS_STATE, VS_EXPIRY, VS_IP)
values ('wa', _sid, _user_name, serialize (vector ('vspx_user', _user_name)), now(), http_client_ip());
http_request_status ('HTTP/1.1 302 Found');
http_header (sprintf('Location: %sfb_front.vspx?sid=%s&realm=wa\r\n', self.odsbar_ods_gpath, _sid));
return;
Expand Down
1 change: 1 addition & 0 deletions appsrc/ODS-Framework/nav_framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ ODS.Nav = function(navOptions) {
"WA_SES_VALIDBIND",
function() {
self.createCookie ('sid', self.session.sid, 1);
self.createCookie ('realm', self.session.realm, 1);
self.userLogged = 1;
self.session.usersGetInfo(self.session.userId, 'fullName', function(xmlDoc) {
self.setLoggedUserInfo(xmlDoc);
Expand Down
7 changes: 4 additions & 3 deletions appsrc/ODS-Framework/nav_framework_api.sql
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ create procedure sessionStart (in realm varchar :='wa') __SOAP_HTTP 'text/xml'

sid:=DB.DBA.vspx_sid_generate ();

insert into DB.DBA.VSPX_SESSION (VS_SID, VS_REALM, VS_UID, VS_EXPIRY)
values (sid, realm, 'nobody', now ());
insert into DB.DBA.VSPX_SESSION (VS_SID, VS_REALM, VS_UID, VS_EXPIRY, VS_IP)
values (sid, realm, 'nobody', now (), http_client_ip());

http('<session>'||sid||'</session>',resXml);

Expand Down Expand Up @@ -1772,7 +1772,8 @@ create procedure openIdCheckAuthentication (

declare sid varchar;
sid := DB.DBA.vspx_sid_generate ();
insert into DB.DBA.VSPX_SESSION (VS_SID, VS_REALM, VS_UID, VS_EXPIRY, VS_STATE) values (sid, realm, user_name, now (),serialize ( vector ( 'vspx_user', user_name)));
insert into DB.DBA.VSPX_SESSION (VS_SID, VS_REALM, VS_UID, VS_EXPIRY, VS_STATE, VS_IP)
values (sid, realm, user_name, now (),serialize ( vector ( 'vspx_user', user_name)), http_client_ip());

http('<session>'||sid||'</session>',resXml);
http('<userName>'||user_name||'</userName>',resXml);
Expand Down
4 changes: 2 additions & 2 deletions appsrc/ODS-Framework/ods_api_users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ create procedure ODS_USER_LOGIN (
if (not isnull (pUser)) {
sid := vspx_sid_generate ();
realm := 'wa';
insert into DB.DBA.VSPX_SESSION (VS_REALM, VS_SID, VS_UID, VS_STATE, VS_EXPIRY)
values (realm, sid, pUser, serialize ( vector ('vspx_user', pUser)), now());
insert into DB.DBA.VSPX_SESSION (VS_REALM, VS_SID, VS_UID, VS_STATE, VS_EXPIRY, VS_IP)
values (realm, sid, pUser, serialize ( vector ('vspx_user', pUser)), now(), http_client_ip());
DB.DBA.ODS_ERROR_XML (sStream, 'OK', 'OK');
DB.DBA.ODS_SESSION_XML (sStream, sid, realm);
if (pDetail) {
Expand Down
6 changes: 3 additions & 3 deletions appsrc/ODS-Framework/ods_controllers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ create procedure get_ses (in uname varchar)
if (sid is null)
{
sid := DB.DBA.vspx_sid_generate ();
insert into DB.DBA.VSPX_SESSION (VS_SID, VS_REALM, VS_UID, VS_EXPIRY) values (sid, 'wa', uname, now ());
insert into DB.DBA.VSPX_SESSION (VS_SID, VS_REALM, VS_UID, VS_EXPIRY, VS_IP) values (sid, 'wa', uname, now (), http_client_ip());
}
return sid;
}
Expand Down Expand Up @@ -4525,8 +4525,8 @@ create procedure ODS..ods_new_user_session (

sid := DB.DBA.vspx_sid_generate ();

insert into DB.DBA.VSPX_SESSION (VS_SID, VS_REALM, VS_UID, VS_STATE, VS_EXPIRY)
values (sid, 'wa', uname, serialize (vector ('vspx_user', uname)), now ());
insert into DB.DBA.VSPX_SESSION (VS_SID, VS_REALM, VS_UID, VS_STATE, VS_EXPIRY, VS_IP)
values (sid, 'wa', uname, serialize (vector ('vspx_user', uname)), now (), http_client_ip());

return sid;
}
Expand Down
3 changes: 2 additions & 1 deletion appsrc/ODS-Framework/openid_login.vspx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
if (vec is not null)
{
sid := DB.DBA.vspx_sid_generate ();
insert into DB.DBA.VSPX_SESSION (VS_SID, VS_REALM, VS_STATE) values (sid, 'wa', serialize (vector ('OpenID_sreg', vec)));
insert into DB.DBA.VSPX_SESSION (VS_SID, VS_REALM, VS_STATE, VS_IP)
values (sid, 'wa', serialize (vector ('OpenID_sreg', vec)), http_client_ip());
self.vc_event.ve_params := OPENID.DBA.oid_set_sid (sid, self.vc_event.ve_params);
}
}
Expand Down