Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
4be7bc9d
Commit
4be7bc9d
authored
Jun 25, 2007
by
Donal McMullan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check that the enablenetworking config var is on (and specify an exception)
parent
ad9fecdb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
12 deletions
+32
-12
htdocs/api/xmlrpc/server.php
htdocs/api/xmlrpc/server.php
+6
-2
htdocs/auth/xmlrpc/jump.php
htdocs/auth/xmlrpc/jump.php
+5
-1
htdocs/auth/xmlrpc/land.php
htdocs/auth/xmlrpc/land.php
+11
-1
htdocs/lib/errors.php
htdocs/lib/errors.php
+1
-1
htdocs/lib/web.php
htdocs/lib/web.php
+9
-7
No files found.
htdocs/api/xmlrpc/server.php
View file @
4be7bc9d
...
...
@@ -50,10 +50,14 @@ ob_start();
$errors
=
trim
(
ob_get_contents
());
ob_end_clean
();
// If networking is off, return a 40
4
// If networking is off, return a
'
40
3 Forbidden' response
$networkenabled
=
get_config
(
'enablenetworking'
);
if
(
empty
(
$networkenabled
))
{
header
(
"HTTP/1.0 404 Not Found"
);
$protocol
=
strtoupper
(
$_SERVER
[
'SERVER_PROTOCOL'
]);
if
(
$protocol
!=
'HTTP/1.1'
)
{
$protocol
=
'HTTP/1.0'
;
}
header
(
$protocol
.
' 403 Forbidden'
);
exit
;
}
...
...
htdocs/auth/xmlrpc/jump.php
View file @
4be7bc9d
...
...
@@ -22,6 +22,10 @@ $remotewwwroot = param_variable('wr');
$instanceid
=
param_variable
(
'ins'
);
$wantsurl
=
''
;
if
(
!
get_config
(
'enablenetworking'
))
{
throw
new
XmlrpcClientException
(
'Sorry - networking has been disabled for this Mahara site.'
);
}
$peer
=
new
Peer
();
$peer
->
findByWwwroot
(
$remotewwwroot
);
$url
=
$remotewwwroot
.
$peer
->
application
->
ssolandurl
;
...
...
@@ -32,7 +36,7 @@ $approved = false;
$url
=
start_jump_session
(
$peer
,
$instanceid
);
if
(
empty
(
$url
))
{
throw
new
Exception
(
'DEBUG: Jump session was not started correctly or blank URL returned.'
);
// TODO: errors
throw
new
XmlrpcClient
Exception
(
'DEBUG: Jump session was not started correctly or blank URL returned.'
);
// TODO: errors
}
redirect
(
$url
);
...
...
htdocs/auth/xmlrpc/land.php
View file @
4be7bc9d
...
...
@@ -19,6 +19,17 @@ define('XMLRPC', 1);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
// If networking is turned off, it's safer to die immediately
if
(
!
get_config
(
'enablenetworking'
))
{
$protocol
=
strtoupper
(
$_SERVER
[
'SERVER_PROTOCOL'
]);
if
(
$protocol
!=
'HTTP/1.1'
)
{
$protocol
=
'HTTP/1.0'
;
}
header
(
$protocol
.
' 403 Forbidden'
);
exit
;
}
require_once
(
get_config
(
'docroot'
)
.
'api/xmlrpc/client.php'
);
require_once
(
get_config
(
'docroot'
)
.
'auth/xmlrpc/lib.php'
);
require_once
(
get_config
(
'libroot'
)
.
'institution.php'
);
...
...
@@ -27,7 +38,6 @@ $token = param_variable('token');
$remotewwwroot
=
param_variable
(
'idp'
);
$wantsurl
=
param_variable
(
'wantsurl'
,
'/'
);
$institution
=
new
Institution
();
$institution
->
findByWwwroot
(
$remotewwwroot
);
$instances
=
auth_get_auth_instances_for_wwwroot
(
$remotewwwroot
);
...
...
htdocs/lib/errors.php
View file @
4be7bc9d
...
...
@@ -649,7 +649,7 @@ class RemoteServerException extends SystemException {}
class
XmlrpcServerException
extends
SystemException
{}
/**
* Xmlrpc
Server
exception -
must output well formed XMLRPC error to the client
* Xmlrpc
Client
exception -
Something has gone wrong in the networking
*/
class
XmlrpcClientException
extends
SystemException
{}
...
...
htdocs/lib/web.php
View file @
4be7bc9d
...
...
@@ -288,13 +288,15 @@ EOF;
);
}
require_once
(
get_config
(
'docroot'
)
.
'api/xmlrpc/lib.php'
);
if
(
$ssopeers
=
get_service_providers
(
$USER
->
authinstance
))
{
$SIDEBLOCKS
[]
=
array
(
'name'
=>
'ssopeers'
,
'weight'
=>
1
,
'data'
=>
$ssopeers
,
);
if
(
get_config
(
'enablenetworking'
))
{
require_once
(
get_config
(
'docroot'
)
.
'api/xmlrpc/lib.php'
);
if
(
$ssopeers
=
get_service_providers
(
$USER
->
authinstance
))
{
$SIDEBLOCKS
[]
=
array
(
'name'
=>
'ssopeers'
,
'weight'
=>
1
,
'data'
=>
$ssopeers
,
);
}
}
if
(
isset
(
$extraconfig
[
'sideblocks'
])
&&
is_array
(
$extraconfig
[
'sideblocks'
]))
{
...
...
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