summaryrefslogtreecommitdiffstats
path: root/remoting/host/chromoting_host.cc
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/host/chromoting_host.cc')
-rw-r--r--remoting/host/chromoting_host.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 1bc7b98..18f6399 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -168,6 +168,10 @@ bool ChromotingHost::OnAcceptConnection(
if (client_.get())
return false;
+ // Check that the user has access to the host.
+ if (!access_verifier_.VerifyPermissions(jid))
+ return false;
+
LOG(INFO) << "Client connected: " << jid << std::endl;
// If we accept the connected then create a client object and set the
@@ -212,10 +216,13 @@ void ChromotingHost::DoStart(Task* shutdown_task) {
std::string xmpp_auth_token;
if (!config_->GetString(kXmppLoginConfigPath, &xmpp_login) ||
!config_->GetString(kXmppAuthTokenConfigPath, &xmpp_auth_token)) {
- LOG(ERROR) << "XMMP credentials are not defined in config.";
+ LOG(ERROR) << "XMPP credentials are not defined in the config.";
return;
}
+ if (!access_verifier_.Init(config_))
+ return;
+
// Connect to the talk network with a JingleClient.
jingle_client_ = new JingleClient(context_->jingle_thread());
jingle_client_->Init(xmpp_login, xmpp_auth_token,