Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mahara
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mahara
mahara
Commits
e1c80084
Commit
e1c80084
authored
Jun 08, 2007
by
Donal McMullan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
2e827204
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
25 deletions
+28
-25
htdocs/admin/site/networking.php
htdocs/admin/site/networking.php
+2
-0
htdocs/admin/users/addauthority.php
htdocs/admin/users/addauthority.php
+1
-0
htdocs/auth/xmlrpc/lib.php
htdocs/auth/xmlrpc/lib.php
+3
-10
htdocs/include/eLearning/peer.php
htdocs/include/eLearning/peer.php
+19
-13
htdocs/lang/en.utf8/admin.php
htdocs/lang/en.utf8/admin.php
+3
-2
No files found.
htdocs/admin/site/networking.php
View file @
e1c80084
...
...
@@ -84,6 +84,8 @@ function networkingform_fail(Pieform $form) {
function
networkingform_submit
(
Pieform
$form
,
$values
)
{
$reply
=
get_string
(
'networkingunchanged'
,
'admin'
);
if
(
get_config
(
'enablenetworking'
)
!=
$values
[
'enablenetworking'
])
{
if
(
!
set_config
(
'enablenetworking'
,
$values
[
'enablenetworking'
]))
{
networkingform_fail
(
$form
);
...
...
htdocs/admin/users/addauthority.php
View file @
e1c80084
...
...
@@ -137,6 +137,7 @@ function auth_config_submit(Pieform $form, $values) {
// TODO: move to lib if people want this:
function
execute_javascript_and_close
(
$js
=
''
)
{
echo
'EXECUTE JS AND CLOSE'
;
echo
'<html>
<head>
<title>You may close this window</title>
...
...
htdocs/auth/xmlrpc/lib.php
View file @
e1c80084
...
...
@@ -469,14 +469,7 @@ class PluginAuthXmlrpc extends PluginAuth {
$authinstance
=
new
stdClass
();
$peer
=
new
Peer
();
if
(
false
==
$peer
->
findByWwwroot
(
$values
[
'wwwroot'
]))
{
try
{
$peer
->
bootstrap
(
$values
[
'wwwroot'
],
null
);
}
catch
(
RemoteServerException
$e
)
{
$form
->
set_error
(
'wwwroot'
,
get_string
(
'cantretrievekey'
,
'auth'
)
.
'<br>'
.
$e
->
getMessage
());
throw
new
RemoteServerException
(
$e
->
getMessage
(),
$e
->
getCode
());
}
}
//TODO: test values and set appropriate errors on form
}
public
static
function
save_config_options
(
$values
,
$form
)
{
...
...
@@ -507,7 +500,7 @@ class PluginAuthXmlrpc extends PluginAuth {
if
(
false
==
$peer
->
findByWwwroot
(
$values
[
'wwwroot'
]))
{
try
{
$peer
->
bootstrap
(
$values
[
'wwwroot'
],
null
);
$peer
->
bootstrap
(
$values
[
'wwwroot'
],
null
,
$values
[
'appname'
],
$values
[
'institution'
]
);
}
catch
(
RemoteServerException
$e
)
{
$form
->
set_error
(
'wwwroot'
,
get_string
(
'cantretrievekey'
,
'auth'
));
throw
new
RemoteServerException
(
$e
->
getMessage
(),
$e
->
getCode
());
...
...
@@ -529,7 +522,7 @@ class PluginAuthXmlrpc extends PluginAuth {
*/
$peer
->
commit
();
$authinstance
->
instancename
=
$values
[
'instancename'
];
$authinstance
->
institution
=
$values
[
'institution'
];
$authinstance
->
authname
=
$values
[
'authname'
];
...
...
htdocs/include/eLearning/peer.php
View file @
e1c80084
...
...
@@ -72,6 +72,7 @@ class Peer {
if
(
!
array_key_exists
(
$name
,
$this
->
members
))
{
throw
new
ParamOutOfRangeException
(
addslashes
(
$name
)
.
' is not a member of Peer.'
);
}
if
(
$value
!=
$this
->
members
[
$name
])
{
if
(
$name
==
'appname'
)
{
$this
->
application
=
Application
::
findByName
(
$value
);
...
...
@@ -147,18 +148,21 @@ class Peer {
if
(
$this
->
initialized
==
self
::
INITIALIZED
)
{
$this
->
initialized
=
self
::
PERSISTENT
;
return
insert_record
(
'host'
,
$host
);
}
elseif
(
$this
->
initialized
==
self
::
PERSISTENT
)
{
try
{
return
update_record
(
'host'
,
$host
,
array
(
'wwwroot'
=>
$host
->
wwwroot
));
}
catch
(
Exception
$e
)
{
throw
new
SQLException
();
$exists
=
get_record
(
'host'
,
'wwwroot'
,
$host
->
wwwroot
);
if
(
false
==
$exists
)
{
return
insert_record
(
'host'
,
$host
);
}
return
true
;
}
try
{
return
update_record
(
'host'
,
$host
,
array
(
'wwwroot'
=>
$host
->
wwwroot
));
}
catch
(
Exception
$e
)
{
throw
new
SQLException
();
}
return
false
;
}
public
function
bootstrap
(
$wwwroot
,
$pubkey
,
$appname
=
'moodle'
)
{
public
function
bootstrap
(
$wwwroot
,
$pubkey
,
$appname
=
'moodle'
,
$institution
=
null
)
{
global
$CFG
;
$wwwroot
=
dropslash
(
$wwwroot
);
...
...
@@ -200,17 +204,19 @@ class Peer {
require_once
(
$CFG
->
docroot
.
'/include/eLearning/institution.php'
);
$institution
=
new
Institution
;
$iname
=
preg_replace
(
'/\s+/'
,
''
,
$this
->
name
);
if
(
false
==
$institution
->
findByName
(
$iname
))
{
if
(
null
==
$institution
)
{
$institution
=
new
Institution
;
$iname
=
preg_replace
(
'/\s+/'
,
''
,
$this
->
name
);
$institution
->
name
=
preg_replace
(
'/\s+/'
,
''
,
$this
->
name
);
$institution
->
displayname
=
$this
->
name
;
$institution
->
commit
();
$this
->
institution
=
$institution
->
name
;
}
else
{
$this
->
institution
=
$institution
;
}
$this
->
institution
=
$institution
->
name
;
if
(
empty
(
$pubkey
))
{
try
{
$somekey
=
get_public_key
(
$this
->
wwwroot
,
$this
->
appname
);
...
...
htdocs/lang/en.utf8/admin.php
View file @
e1c80084
...
...
@@ -123,9 +123,10 @@ $string['enablenetworkingdescription'] = 'Allow your Mahara server to communicat
$string
[
'enablenetworking'
]
=
'Enable networking'
;
$string
[
'networkingenabled'
]
=
'Networking has been enabled'
;
$string
[
'networkingdisabled'
]
=
'Networking has been disabled'
;
$string
[
'networkingunchanged'
]
=
'Network settings were not changed'
;
$string
[
'promiscuousmode'
]
=
'Auto-register all hosts'
;
$string
[
'promiscuousmodedisabled'
]
=
'
Networking
has been disabled'
;
$string
[
'promiscuousmodeenabled'
]
=
'
Networking has been dis
abled'
;
$string
[
'promiscuousmodedisabled'
]
=
'
Auto-register
has been disabled'
;
$string
[
'promiscuousmodeenabled'
]
=
'
Auto-register has been en
abled'
;
$string
[
'promiscuousmodedescription'
]
=
'Create an institution record for any host that connects to you, and allow its users to log on to Mahara'
;
// Admin menu editor
...
...
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