logo

The ConnectWise Control forum has moved to ConnectWise University! This forum has been locked and is in read-only mode. Click here for instructions on how to access the new forum.

Welcome Guest! You can not login or register.

Notification

Icon
Error

Options
Go to last post Go to first unread
ivanskie  
#1 Posted : Wednesday, December 25, 2013 7:56:15 AM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
Hi guys/gals,

I'm working on a ruby on rails app for our support site, I would like to integrate ScreenConnect invitation code into the main page, without using an iframe.
At the moment we use the iframe on the page.

For mockup, i have setup this page http://help.ibcworld.net that is basically what I am trying to achieve.
I have seen a youtube video of somebody going through a pretty intense procedure to figure something similar out, but..
Has anyone done something like this yet?
I'm not a full on developer, but if there's a piece of code that just needs to be integrated or something like that, i can handle..



Thanks!!




P.S.: As a recommendation, I think a lot of people would absolutely love a way of writing plugins, or a way to share their customization / projects on here.
A lot of posts here, but its mostly people answering question.. but if people do the work, and it's not too proprietary perhaps they could share it, so it did not need to be done again?

Edited by user Tuesday, March 4, 2014 10:21:31 PM(UTC)  | Reason: Not specified

FrogDog  
#2 Posted : Friday, December 27, 2013 9:06:06 PM(UTC)
FrogDog


Rank: Advanced Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 7/31/2013(UTC)
Posts: 51
Location: Topeka, Kansas USA

Thanks: 14 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: ivanskie Go to Quoted Post
Hi guys/gals,

I'm working on a ruby on rails app for our support site, I would like to integrate ScreenConnect invitation code into the main page, without using an iframe.
At the moment we use the iframe on the page.

For mockup, i have setup this page http://help.ibcworld.net that is basically what I am trying to achieve.
I have seen a youtube video of somebody going through a pretty intense procedure to figure something similar out, but..
Has anyone done something like this yet?
I'm not a full on developer, but if there's a piece of code that just needs to be integrated or something like that, i can handle..



Thanks!!




P.S.: As a recommendation, I think a lot of people would absolutely love a way of writing plugins, or a way to share their customization / projects on here.
A lot of posts here, but its mostly people answering question.. but if people do the work, and it's not too proprietary perhaps they could share it, so it did not need to be done again?




That is pretty neat. I saw your page up and running. My webhost has ruby on rails as a feature included in my webhost plan. I did quick google search for Ruby on Rails and Mono and there was some good positive possibilities there, but im clueless. I just would like to see if ruby on rails can run the host on the webserver lol. Still your idea looks better integrated without the ugly iframe. I am watching this topic!
Alexander  
#3 Posted : Thursday, January 2, 2014 4:57:50 PM(UTC)
Alexander


Rank: Administration

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 7/23/2013(UTC)
Posts: 715
Man
Location: Raleigh, NC

Was thanked: 66 time(s) in 63 post(s)
So you want to connect to the session with the entered code when they click the Join button? This should do the trick:
Code:
<script src="http://support.yoursite.com/Script.ashx"></script>

Code:
SC.context.scriptBaseUrl = "http://support.yoursite.com/"; // Includes trailing slash
SC.service.getGuestSessionInfo("entered code", null, 0, function(result) {
    if(result.ss)
        {
            SC.launch.getSortedLaunchers()[0].launch(SC.util.combineObjects(result.ss.clp, SC.context.clp, { y: "Guest" }));
        }
    else
        {
            // No session with code "code"
        }
}, function(result) {
    // Call failed
});
ScreenConnect Team
sudogreg  
#4 Posted : Thursday, January 2, 2014 10:23:55 PM(UTC)
sudogreg


Rank: Newbie

Joined: 6/10/2013(UTC)
Posts: 9
Location: St. Louis, MO

Thanks: 2 times
excuse my ignorance, but where does the bottom snip of code go exactly?

Originally Posted by: Alexander Go to Quoted Post
So you want to connect to the session with the entered code when they click the Join button? This should do the trick:
Code:
<script src="http://support.yoursite.com/Script.ashx"></script>

Code:
SC.context.scriptBaseUrl = "http://support.yoursite.com/"; // Includes trailing slash
SC.service.getGuestSessionInfo("entered code", null, 0, function(result) {
    if(result.ss)
        {
            SC.launch.getSortedLaunchers()[0].launch(SC.util.combineObjects(result.ss.clp, SC.context.clp, { y: "Guest" }));
        }
    else
        {
            // No session with code "code"
        }
}, function(result) {
    // Call failed
});


Alexander  
#5 Posted : Friday, January 3, 2014 3:37:07 PM(UTC)
Alexander


Rank: Administration

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 7/23/2013(UTC)
Posts: 715
Man
Location: Raleigh, NC

Was thanked: 66 time(s) in 63 post(s)
Well, you just want it to be called when someone clicks the Join button.
So for example, if the input field has an id of "codeBox" and the Join button has an id of "codeButton", you could add another script tag like this:
Code:
<script>
window.onload = function() {
document.getElementById("codeButton").onclick = function() {
// Insert code here; replace '"entered code"' with 'document.getElementById("codeBox").value'
};
};
</script>
ScreenConnect Team
ivanskie  
#6 Posted : Wednesday, February 26, 2014 7:05:14 AM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
this didn't work,

When clicking codeButton Chrome console shows:
Uncaught ReferenceError: Sys is not defined

Code:
<script>
    window.onload = function () {
        document.getElementById("codeButton").onclick = function () {
            SC.context.scriptBaseUrl = "http://help.example.net/";
            SC.service.getGuestSessionInfo('document.getElementById("codeBox").value', null, 0, function (result) {
                if (result.ss) {
                    SC.launch.getSortedLaunchers()[0].launch(SC.util.combineObjects(result.ss.clp, SC.context.clp, {
                        y: "Guest"
                    }));
                } else {
                    document.getElementById("joinBox").value = "";
                    alert("wrong code");
                }
            }, function (result) {
                alert("Call failed");
            });
        };
    };
</script>

Edited by user Wednesday, February 26, 2014 7:06:43 AM(UTC)  | Reason: Not specified

Alexander  
#7 Posted : Wednesday, February 26, 2014 3:27:32 PM(UTC)
Alexander


Rank: Administration

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 7/23/2013(UTC)
Posts: 715
Man
Location: Raleigh, NC

Was thanked: 66 time(s) in 63 post(s)
Hmm… that doesn't seem to be an issue with our code specifically. This thread has some suggestions that'll hopefully help.
ScreenConnect Team
ivanskie  
#8 Posted : Wednesday, February 26, 2014 7:07:42 PM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
Well.. as far as i can tell its not the java script that's complaining..

Uncaught ReferenceError: Sys is not defined . . . . . . . Script.ashx:5

Script.ashx
Code:
window.SC = window.SC || {};
SC.util = SC.util || {};

SC.util.jsonSerialize = function (object) {
	if (SC.util.isDefined(Sys)) {
		return Sys.Serialization.JavaScriptSerializer.serialize(object);
	} else if (SC.util.isDefined(JSON)) {
		if (window.Prototype)
			delete Array.prototype.toJSON;

		return JSON.stringify(object);
	} else if (SC.util.isDefined(object.toJSON)) {
		return object.toJSON();
	}
}
...
ivanskie  
#9 Posted : Monday, March 3, 2014 7:24:37 PM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
Looking at the suggested thread: http://stackoverflow.com...s/75322/sys-is-undefined

Suggestion 1, "I fixed my problem by moving the <script type="text/javascript"></script> block containing the Sys.* calls lower down (to the last item before the close of the body's <asp:Content/> section) in the HTML on the page. I originally had my the script block in the HEAD <asp:Content/> section of my page. I was working inside a page that had a MasterPageFile. Hope this helps someone out."

I've moved the javascript call for Script.aspx from head to end of body. -- did not change anything

suggestion 2, "When I experienced the errors

Sys is undefined
ASP.NET Ajax client-side framework failed to load
in IE when using ASP.NET Ajax controls in .NET 2.0, I needed to add the following to the web.config file within the <system.web> tags:

Code:
<httpHandlers>
  <remove verb="*" path="*.asmx"/>
  <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  <add verb="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler" validate="false"/>
</httpHandlers>"


I'm not using APS.NET in my project... however looking at ScreenConnect's web.config file, here are similar lines of code:
Code:
<httpHandlers>
      <remove verb="*" path="*.ashx" />
      <add verb="*" path="*.ashx" type="Elsinore.ScreenConnect.SingletonHandlerFactory, Elsinore.ScreenConnect.Web" />
      <add verb="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />



suggestion 3, "You must add these lines in the web.config

Code:
<httpHandlers>
  <remove verb="*" path="*.asmx"/>
  <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
  <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>

Hope this helps."

I've tried adding those lines to web.config in the screenconnect folder.. it hasn't helped :(

for other suggestions on that thread, i'm not sure what to do there.



And in chrome console, when I type the code for an existing session.. i'm still getting this error tree:


Code:
Uncaught ReferenceError: Sys is not defined                      Script.ashx:5
- SC.util.jsonSerialize                                                        Script.ashx:5
- SC.util.invokeService                                                       Script.ashx:641
- SC.service.getGuestSessionInfo                                       Script.ashx:2069
- document.getElementById.onclick                                  (index):147



UPDATE:
I've just upgraded my installation to 4.2.6216
no change :(

I'd love to get this to work.
This is the project I've been working on. https://github.com/i5okie/redress

project

adding an iframe there, would not be very nice... :(

Edited by user Monday, March 3, 2014 7:43:28 PM(UTC)  | Reason: Not specified

Paul Moore  
#10 Posted : Monday, March 3, 2014 8:49:33 PM(UTC)
Paul Moore


Rank: Advanced Member

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 9/16/2011(UTC)
Posts: 334

Thanks: 5 times
Was thanked: 70 time(s) in 44 post(s)
Check out my Project:Polish mod.

I cured the Sys issue with a script in HEAD.
ScreenConnect Reporting - Collects live & historical information including session times.
http://goo.gl/nrF3e9
ivanskie  
#11 Posted : Monday, March 3, 2014 9:07:26 PM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
It doesn't matter where I put the import Script.ashx, or the above js script.
I get the error anyway.

unless you're talking about including this microsoftajax.js ?

Edited by user Monday, March 3, 2014 9:32:55 PM(UTC)  | Reason: Not specified

Paul Moore  
#12 Posted : Monday, March 3, 2014 10:49:34 PM(UTC)
Paul Moore


Rank: Advanced Member

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 9/16/2011(UTC)
Posts: 334

Thanks: 5 times
Was thanked: 70 time(s) in 44 post(s)
That's the one :)
ScreenConnect Reporting - Collects live & historical information including session times.
http://goo.gl/nrF3e9
thanks 1 user thanked Paul Moore for this useful post.
ivanskie on 3/3/2014(UTC)
ivanskie  
#13 Posted : Monday, March 3, 2014 11:11:50 PM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
hah wow.. that made progress! lol

Now i'm just getting call failure :(

..err never mind that's just me mistyping something.

alright, now i get this:


Code:
XMLHttpRequest cannot load http://live.mydomain.net/Service.ashx/GetGuestSessionInfo. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://10.1.8.47:3000' is therefore not allowed access.


However.. I think I should be able to fix this with actually putting my project on the same server.. same domain..

Edited by user Monday, March 3, 2014 11:17:13 PM(UTC)  | Reason: Not specified

Paul Moore  
#14 Posted : Monday, March 3, 2014 11:14:03 PM(UTC)
Paul Moore


Rank: Advanced Member

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 9/16/2011(UTC)
Posts: 334

Thanks: 5 times
Was thanked: 70 time(s) in 44 post(s)
Are you posting from a different domain?

Remember CORS will kick in.
ScreenConnect Reporting - Collects live & historical information including session times.
http://goo.gl/nrF3e9
ivanskie  
#15 Posted : Monday, March 3, 2014 11:18:21 PM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
yeah i just googled this.
I'm running the code from my laptop.. so this makes sense.
once I put the code up onto the same server I'd imagine this should fix itself.
Paul Moore  
#16 Posted : Monday, March 3, 2014 11:20:52 PM(UTC)
Paul Moore


Rank: Advanced Member

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 9/16/2011(UTC)
Posts: 334

Thanks: 5 times
Was thanked: 70 time(s) in 44 post(s)
Sort of. It doesn't have to be on the same server, as such... just the same domain.

The Project:Polish mod runs under the same FQDN and path as ScreenConnect, so CORS is never an issue. If you host yours in the same way, you're set.

Cheers.
ScreenConnect Reporting - Collects live & historical information including session times.
http://goo.gl/nrF3e9
Jake  
#17 Posted : Tuesday, March 4, 2014 1:55:48 AM(UTC)
Jake


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 4/9/2010(UTC)
Posts: 2,061

Thanks: 1 times
Was thanked: 393 time(s) in 188 post(s)
There is a web.config setting to specify the cors filter.
ScreenConnect Team
Paul Moore  
#18 Posted : Tuesday, March 4, 2014 11:42:11 AM(UTC)
Paul Moore


Rank: Advanced Member

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 9/16/2011(UTC)
Posts: 334

Thanks: 5 times
Was thanked: 70 time(s) in 44 post(s)
You have to be very careful with it though ivanskie. It's pretty powerful and can easily lead to account hijacking if you get it wrong.
ScreenConnect Reporting - Collects live & historical information including session times.
http://goo.gl/nrF3e9
ivanskie  
#19 Posted : Tuesday, March 4, 2014 6:06:32 PM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
looks like i will have to do that, because my screenconnect is at
http://live.ibcworld.net

and the new support page is at

http://help.ibcworld.net


its on the same server however.

Paul Moore  
#20 Posted : Tuesday, March 4, 2014 7:08:38 PM(UTC)
Paul Moore


Rank: Advanced Member

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 9/16/2011(UTC)
Posts: 334

Thanks: 5 times
Was thanked: 70 time(s) in 44 post(s)
If possible, I'd configure ScreenConnect to listen on help instead...

You can still use the native ScreenConnect UI by calling those files directly or moving them to a subdirectory rather than a subdomain.

Don't get me wrong, both will work just fine... but if you get cors wrong, you're opening the server to a plethora of security issues. XSRF being the obvious one.
ScreenConnect Reporting - Collects live & historical information including session times.
http://goo.gl/nrF3e9
Jake  
#21 Posted : Tuesday, March 4, 2014 7:31:12 PM(UTC)
Jake


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 4/9/2010(UTC)
Posts: 2,061

Thanks: 1 times
Was thanked: 393 time(s) in 188 post(s)
The appsetting is "AccessControlOriginFilter" if you want to use it ... set it to "^http://help.ibcworld.net$"

I'm not as sure of the implications as Cresona.
ScreenConnect Team
ivanskie  
#22 Posted : Tuesday, March 4, 2014 7:52:04 PM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
Do I have to add that anywhere specific within the web.config file?
ivanskie  
#23 Posted : Tuesday, March 4, 2014 7:57:45 PM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
fixed :)

Thanks guys!!

Edited by user Tuesday, March 4, 2014 10:14:29 PM(UTC)  | Reason: Not specified

Paul Moore  
#24 Posted : Wednesday, March 5, 2014 11:04:38 AM(UTC)
Paul Moore


Rank: Advanced Member

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 9/16/2011(UTC)
Posts: 334

Thanks: 5 times
Was thanked: 70 time(s) in 44 post(s)
Originally Posted by: Jake Go to Quoted Post
I'm not as sure of the implications as Cresona.


If you enable CORS using a wildcard (*), any site can send any HTTP verb (GET, POST, HEAD, PUT etc) and crucially, read the response. With CORS disabled, a site can still POST data to you, but it's unable to read the response. Cross Origin Resource Sharing (CORS) circumvents the Same Origin Policy (SOP) protection built into browsers.

It's worth noting too, SOP is baked into every browser. CORS isn't. What works in Chrome v31 may not work in Netscape, for example.

The difference...

CORS disabled:
1. A remote site sends a GET request to /GetHostSessionInfo.
2. ScreenConnect grabs the session data and returns it.
3. The browser checks the "Origin" & "Methods" header and because they don't match, the remote site cannot access the response data.

CORS enabled:
1. A remote site sends a GET request to /GetHostSessionInfo.
2. ScreenConnect grabs the session data and returns it.
3. The browser checks the "Origin" & "Methods" header, finds a match and allows the remote site to access the response data in full. Cookies, headers, body et al.

You install WordPress on the remote site, which is later revealed as vulnerable. A hacker can place code on the remote site and extract everything from your ScreenConnect installation. Sessions, licenses, notes, host access tokens... everything.
ScreenConnect Reporting - Collects live & historical information including session times.
http://goo.gl/nrF3e9
ivanskie  
#25 Posted : Tuesday, March 11, 2014 11:30:58 PM(UTC)
ivanskie


Rank: Advanced Member

Joined: 12/3/2013(UTC)
Posts: 56
Location: Canada

Thanks: 5 times
Is there any documentation on 4.3 customization?
I'm getting
joiningPanelDefinition is not defined

within (
// for legacy compatibility
SC.launch.getSortedLaunchers = function () {
return [{
launch: function (clientLaunchParameters) {
var joinPanelDefinitionTreeRoot = SC.launch.getJoinPanelDefinitionTreeRoot();
var initialPanelDefinitionPath = SC.launch.getInitialJoinPanelDefinitionPath(joinPanelDefinitionTreeRoot);
var panelDefinition = initialPanelDefinitionPath[initialPanelDefinitionPath.length - 1];

if (panelDefinition.joinProc != null)
joiningPanelDefinition.joinProc(clientLaunchParameters);
}
}];
}
)

perhaps there is a new way to launch the join panel, or what not?
Alexander  
#26 Posted : Wednesday, March 12, 2014 7:05:21 PM(UTC)
Alexander


Rank: Administration

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 7/23/2013(UTC)
Posts: 715
Man
Location: Raleigh, NC

Was thanked: 66 time(s) in 63 post(s)
That "joiningPanelDefinition" should just be "panelDefinition". (And that'll be fixed in the next build of 4.3)
ScreenConnect Team
Jay  
#27 Posted : Friday, March 21, 2014 7:57:13 PM(UTC)
Jay


Rank: Newbie

Joined: 3/21/2014(UTC)
Posts: 2
United States

Hi, guys. I have been following along with this topic to add a code field on my site. I have done everything listed and I get no more errors on the console. Here is what I have:

Quote:
<script src="http://ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js"></script>
<script src="http://remote.domain.com/Script.ashx"></script>
<script type="text/javascript">
jQuery( document ).ready(function($) {
$( "#codebutton" ).click(function() {
SC.context.scriptBaseUrl = "http://remote.domain.com/";
SC.service.getGuestSessionInfo('document.getElementById("code").value', null, 0, function(result) {
if(result.ss)
{
SC.launch.getSortedLaunchers()[0].launch(SC.util.combineObjects(result.ss.clp, SC.context.clp, { y: "Guest" }));
}
else
{
alert("Code Not Found");
}
}), function(result) {
alert("Call failed");
}
});
});
</script>
<input type="text" placeholder="Support Code" id="code">
<br /><br />
<input type="button" value="Connect" id="codebutton">


Now even when I enter a valid code, I get the "Code Not Found" alert.

Any ideas what I'm missing?

Thanks in advance.
Alexander  
#28 Posted : Monday, March 24, 2014 2:36:42 PM(UTC)
Alexander


Rank: Administration

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 7/23/2013(UTC)
Posts: 715
Man
Location: Raleigh, NC

Was thanked: 66 time(s) in 63 post(s)
document.getElementById("code").value shouldn't have those quotes around it; in my earlier post they were just there to try to distinguish the code from the rest of the comment.
ScreenConnect Team
Jay  
#29 Posted : Monday, March 24, 2014 5:18:06 PM(UTC)
Jay


Rank: Newbie

Joined: 3/21/2014(UTC)
Posts: 2
United States

Wow. I spend a morning working on this and a stupid syntax error gets me at the end.

Thank you very much for the help.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.