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
7af97b3e
Commit
7af97b3e
authored
Apr 24, 2007
by
Donal McMullan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New tables for application and host... fix fieldnames (remove underscores)
parent
8275b9b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
36 deletions
+66
-36
htdocs/api/xmlrpc/lib.php
htdocs/api/xmlrpc/lib.php
+35
-36
htdocs/lib/db/install.xml
htdocs/lib/db/install.xml
+31
-0
No files found.
htdocs/api/xmlrpc/lib.php
View file @
7af97b3e
...
...
@@ -598,18 +598,18 @@ class Peer {
public
$wwwroot
=
''
;
public
$deleted
=
0
;
public
$ip
_
address
=
''
;
public
$ipaddress
=
''
;
public
$name
=
''
;
public
$public
_
key
;
public
$public
_
key
_
expires
=
''
;
public
$publickey
;
public
$publickeyexpires
=
''
;
public
$portno
=
80
;
public
$last
_
connect
_
time
=
0
;
public
$we
_
sso
_
out
=
0
;
public
$they
_
sso
_
in
=
0
;
public
$lastconnecttime
=
0
;
public
$wessoout
=
0
;
public
$theyssoin
=
0
;
public
$initialized
=
self
::
UNINITIALIZED
;
public
$application
=
'moodle'
;
public
$application_display
=
'Moodle'
;
public
$xmlrpc
_
server
_
url
=
'/mnet/xmlrpc/server.php'
;
public
$xmlrpcserverurl
=
'/mnet/xmlrpc/server.php'
;
public
$error
=
array
();
function
__construct
()
{
...
...
@@ -623,17 +623,17 @@ class Peer {
SELECT
host.wwwroot,
host.deleted,
host.ip
_
address,
host.ipaddress,
host.name,
host.public
_
key,
host.public
_
key
_
expires,
host.publickey,
host.publickeyexpires,
host.portno,
host.last
_
connect
_
time,
host.we
_
sso
_
out,
host.they
_
sso
_
in,
host.lastconnecttime,
host.wessoout,
host.theyssoin,
application.shortname,
application.name,
application.xmlrpc
_
server
_
url
application.xmlrpcserverurl
FROM
'
.
$cfg
->
dbprefix
.
'host,
'
.
$cfg
->
dbprefix
.
'application
...
...
@@ -647,7 +647,7 @@ class Peer {
foreach
(
get_object_vars
(
$hostinfo
)
as
$key
=>
$value
)
{
$this
->
{
$key
}
=
$value
;
}
$this
->
public
_
key
=
new
PublicKey
(
$this
->
public
_
key
,
$this
->
wwwroot
);
$this
->
publickey
=
new
PublicKey
(
$this
->
publickey
,
$this
->
wwwroot
);
$this
->
initialized
=
self
::
PERSISTENT
;
return
true
;
}
...
...
@@ -656,7 +656,7 @@ class Peer {
function
__get
(
$name
)
{
if
(
$name
==
'certificate'
)
{
return
$this
->
public
_
key
->
certificate
;
return
$this
->
publickey
->
certificate
;
}
return
$this
->
{
$name
};
}
...
...
@@ -668,17 +668,17 @@ class Peer {
function
commit
()
{
if
(
$this
->
initialized
==
self
::
UNINITIALIZED
)
return
false
;
$host
=
new
stdClass
();
$host
->
wwwroot
=
$this
->
wwwroot
;
$host
->
deleted
=
$this
->
deleted
;
$host
->
ip
_
address
=
$this
->
ip_address
;
$host
->
name
=
$this
->
name
;
$host
->
public
_
key
=
$this
->
public
_
key
->
certificate
;
$host
->
public
_
key
_
expires
=
$this
->
public
_
key
_
expires
;
$host
->
portno
=
$this
->
portno
;
$host
->
last
_
connect
_
time
=
$this
->
last
_
connect
_
time
;
$host
->
application
=
$this
->
application
;
$host
->
we
_
sso
_
out
=
$this
->
we
_
sso
_
out
;
$host
->
they
_
sso
_
in
=
$this
->
they
_
sso
_
in
;
$host
->
wwwroot
=
$this
->
wwwroot
;
$host
->
deleted
=
$this
->
deleted
;
$host
->
ipaddress
=
$this
->
ip_address
;
$host
->
name
=
$this
->
name
;
$host
->
publickey
=
$this
->
publickey
->
certificate
;
$host
->
publickeyexpires
=
$this
->
publickeyexpires
;
$host
->
portno
=
$this
->
portno
;
$host
->
lastconnecttime
=
$this
->
lastconnecttime
;
$host
->
application
=
$this
->
application
;
$host
->
wessoout
=
$this
->
wessoout
;
$host
->
theyssoin
=
$this
->
theyssoin
;
$hostinfo
=
get_record
(
'host'
,
'wwwroot'
,
$this
->
wwwroot
);
if
(
$this
->
initialized
==
self
::
INITIALIZED
)
{
...
...
@@ -724,20 +724,19 @@ class Peer {
if
(
empty
(
$this
->
application
))
$this
->
application
=
'moodle'
;
$this
->
wwwroot
=
$wwwroot
;
$this
->
ip
_
address
=
$ip_address
;
$this
->
ipaddress
=
$ip_address
;
if
(
empty
(
$pubkey
))
{
$this
->
public
_
key
=
new
PublicKey
(
get_public_key
(
$this
->
wwwroot
,
$this
->
application
),
$this
->
wwwroot
);
$this
->
publickey
=
new
PublicKey
(
get_public_key
(
$this
->
wwwroot
,
$this
->
application
),
$this
->
wwwroot
);
}
else
{
$this
->
public
_
key
=
new
PublicKey
(
$pubkey
,
$this
->
wwwroot
);
$this
->
publickey
=
new
PublicKey
(
$pubkey
,
$this
->
wwwroot
);
}
$this
->
public_key_expires
=
$this
->
public_key
->
expires
;
$this
->
last_connect_time
=
0
;
$this
->
last_log_id
=
0
;
$this
->
initialized
=
self
::
INITIALIZED
;
if
(
false
==
$this
->
public_key
->
expires
)
{
$this
->
public_key
==
null
;
$this
->
publickeyexpires
=
$this
->
publickey
->
expires
;
$this
->
lastconnecttime
=
0
;
$this
->
initialized
=
self
::
INITIALIZED
;
if
(
false
==
$this
->
publickey
->
expires
)
{
$this
->
publickey
==
null
;
return
false
;
}
}
...
...
htdocs/lib/db/install.xml
View file @
7af97b3e
...
...
@@ -25,6 +25,16 @@
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"name"
/>
</KEYS>
</TABLE>
<TABLE
NAME=
"application"
>
<FIELDS>
<FIELD
NAME=
"shortname"
TYPE=
"char"
LENGTH=
"20"
NOTNULL=
"true"
/>
<FIELD
NAME=
"name"
TYPE=
"char"
LENGTH=
"100"
NOTNULL=
"true"
/>
<FIELD
NAME=
"xmlrpcserverurl"
TYPE=
"char"
LENGTH=
"255"
NOTNULL=
"true"
/>
</FIELDS>
<KEYS>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"shortname"
/>
</KEYS>
</TABLE>
<TABLE
NAME=
"institution"
>
<FIELDS>
<FIELD
NAME=
"name"
TYPE=
"char"
LENGTH=
"255"
NOTNULL=
"true"
/>
...
...
@@ -98,6 +108,27 @@
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"name"
/>
</KEYS>
</TABLE>
<TABLE
NAME=
"host"
>
<FIELDS>
<FIELD
NAME=
"wwwroot"
TYPE=
"char"
LENGTH=
"255"
NOTNULL=
"true"
/>
<FIELD
NAME=
"name"
TYPE=
"char"
LENGTH=
"80"
NOTNULL=
"true"
DEFAULT=
""
/>
<FIELD
NAME=
"ipaddress"
TYPE=
"char"
LENGTH=
"39"
NOTNULL=
"true"
DEFAULT=
""
/>
<FIELD
NAME=
"deleted"
TYPE=
"int"
LENGTH=
"1"
NOTNULL=
"true"
DEFAULT=
"0"
/>
<FIELD
NAME=
"publickey"
TYPE=
"text"
NOTNULL=
"true"
DEFAULT=
""
/>
<FIELD
NAME=
"publickeyexpires"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
/>
<FIELD
NAME=
"portno"
TYPE=
"int"
LENGTH=
"2"
NOTNULL=
"true"
DEFAULT=
"80"
/>
<FIELD
NAME=
"lastconnecttime"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
DEFAULT=
"0"
/>
<FIELD
NAME=
"application"
TYPE=
"char"
LENGTH=
"20"
NOTNULL=
"true"
DEFAULT=
""
/>
<FIELD
NAME=
"theyssoin"
TYPE=
"int"
LENGTH=
"1"
NOTNULL=
"true"
DEFAULT=
"0"
/>
<FIELD
NAME=
"wessoout"
TYPE=
"int"
LENGTH=
"1"
NOTNULL=
"true"
DEFAULT=
"0"
/>
<FIELD
NAME=
"institution"
TYPE=
"char"
LENGTH=
"255"
NOTNULL=
"true"
/>
</FIELDS>
<KEYS>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"wwwroot"
/>
<KEY
NAME=
"institution"
TYPE=
"foreign"
FIELDS=
"institution"
REFTABLE=
"institution"
REFFIELDS=
"name"
/>
<KEY
NAME=
"application"
TYPE=
"foreign"
FIELDS=
"application"
REFTABLE=
"application"
REFFIELDS=
"shortname"
/>
</KEYS>
</TABLE>
<TABLE
NAME=
"cron"
>
<FIELDS>
<FIELD
NAME=
"id"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"true"
/>
...
...
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