Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
91bd3891
Commit
91bd3891
authored
Jun 30, 2007
by
Donal McMullan
Browse files
Replace 'if(' with 'if (' in introduced code
parent
525bcf22
Changes
6
Hide whitespace changes
Inline
Side-by-side
htdocs/api/xmlrpc/server.php
View file @
91bd3891
...
...
@@ -72,7 +72,7 @@ if (empty($networkenabled)) {
// Content type for output is never html:
header
(
'Content-type: text/xml; charset=utf-8'
);
ini_set
(
'display_errors'
,
0
);
if
(
!
empty
(
$errors
))
throw
new
XmlrpcServerException
(
'Initialization failed. Non-recoverable error.'
,
6000
);
if
(
!
empty
(
$errors
))
throw
new
XmlrpcServerException
(
'Initialization failed. Non-recoverable error.'
,
6000
);
// PHP 5.2.2: $HTTP_RAW_POST_DATA not populated bug:
// http://bugs.php.net/bug.php?id=41293
...
...
@@ -93,7 +93,7 @@ try {
}
// Cascading switch. Kinda.
if
(
$xml
->
getName
()
==
'encryptedMessage'
)
{
if
(
$xml
->
getName
()
==
'encryptedMessage'
)
{
// The IP address for the hostname supplied by the client.
// This hostname can't be trusted.
...
...
@@ -116,7 +116,7 @@ if($xml->getName() == 'encryptedMessage') {
$payload
=
xmlenc_envelope_strip
(
$xml
);
}
if
(
$xml
->
getName
()
==
'signedMessage'
)
{
if
(
$xml
->
getName
()
==
'signedMessage'
)
{
// The IP address for the hostname supplied by the client.
// This hostname can't be trusted.
...
...
@@ -139,9 +139,9 @@ if($xml->getName() == 'signedMessage') {
$payload
=
xmldsig_envelope_strip
(
$xml
);
}
if
(
$xml
->
getName
()
==
'methodCall'
)
{
if
(
$xml
->
getName
()
==
'methodCall'
)
{
// $payload ?
if
(
empty
(
$xml
->
methodName
))
{
if
(
empty
(
$xml
->
methodName
))
{
throw
new
XmlrpcServerException
(
'Payload is not an XML-RPC document'
,
6008
);
}
...
...
htdocs/auth/imap/lib.php
View file @
91bd3891
...
...
@@ -42,7 +42,7 @@ class AuthImap extends Auth {
$this
->
config
[
'protocol'
]
=
'/imap'
;
$this
->
config
[
'changepasswordurl'
]
=
''
;
if
(
!
empty
(
$id
))
{
if
(
!
empty
(
$id
))
{
return
$this
->
init
(
$id
);
}
return
true
;
...
...
@@ -122,18 +122,18 @@ class PluginAuthImap extends PluginAuth {
if
(
$instance
>
0
)
{
$current
=
get_records_array
(
'auth_instance'
,
'id'
,
$instance
,
'priority ASC'
);
if
(
$current
==
false
)
{
if
(
$current
==
false
)
{
throw
new
Exception
(
'Could not find data for auth instance '
.
$instance
);
}
$default
=
$current
[
0
];
$current_config
=
get_records_menu
(
'auth_instance_config'
,
'instance'
,
$instance
,
''
,
'field, value'
);
if
(
$current_config
==
false
)
{
if
(
$current_config
==
false
)
{
$current_config
=
array
();
}
foreach
(
self
::
$default_config
as
$key
=>
$value
)
{
if
(
array_key_exists
(
$key
,
$current_config
))
{
if
(
array_key_exists
(
$key
,
$current_config
))
{
self
::
$default_config
[
$key
]
=
$current_config
[
$key
];
}
}
...
...
htdocs/auth/internal/lib.php
View file @
91bd3891
...
...
@@ -36,7 +36,7 @@ class AuthInternal extends Auth {
public
function
__construct
(
$id
=
null
)
{
$this
->
has_config
=
false
;
$this
->
type
=
'internal'
;
if
(
!
empty
(
$id
))
{
if
(
!
empty
(
$id
))
{
return
$this
->
init
(
$id
);
}
return
true
;
...
...
htdocs/auth/lib.php
View file @
91bd3891
...
...
@@ -390,7 +390,7 @@ function auth_setup () {
function
auth_get_auth_instances_for_institution
(
$institution
=
null
)
{
static
$cache
=
array
();
if
(
null
==
$institution
)
{
if
(
null
==
$institution
)
{
return
array
();
}
...
...
@@ -422,7 +422,7 @@ function auth_get_auth_instances_for_institution($institution=null) {
$cache
[
$institution
]
=
get_records_sql_array
(
$sql
,
array
());
if
(
empty
(
$cache
[
$institution
]))
{
if
(
empty
(
$cache
[
$institution
]))
{
return
false
;
}
}
...
...
@@ -500,7 +500,7 @@ function auth_get_auth_instances_for_username($institution, $username) {
$cache
[
$institution
][
$username
]
=
get_records_sql_array
(
$sql
,
array
(
array
(
'institution'
=>
$institution
),
array
(
'username'
=>
$username
)));
if
(
empty
(
$cache
[
$institution
]))
{
if
(
empty
(
$cache
[
$institution
]))
{
return
false
;
}
}
...
...
@@ -949,7 +949,7 @@ function login_submit(Pieform $form, $values) {
$USER
->
authinstance
=
$authinstance
->
id
;
if
(
$auth
->
authenticate_user_account
(
$username
,
$password
,
$institution
))
{
if
(
$auth
->
authenticate_user_account
(
$username
,
$password
,
$institution
))
{
$userdata
=
$auth
->
get_user_info
();
if
(
empty
(
$userdata
)
||
...
...
htdocs/auth/session.php
View file @
91bd3891
...
...
@@ -98,7 +98,7 @@ class Session {
static
$instance
;
//if we don't have the single instance, create one
if
(
!
isset
(
$instance
))
{
if
(
!
isset
(
$instance
))
{
$instance
=
new
Session
();
}
return
(
$instance
);
...
...
htdocs/auth/xmlrpc/lib.php
View file @
91bd3891
...
...
@@ -64,7 +64,7 @@ class AuthXmlrpc extends Auth {
$this
->
config
[
'theyssoin'
]
=
0
;
$this
->
config
[
'parent'
]
=
null
;
$this
->
file
=
fopen
(
'/tmp/out.txt'
,
'w'
);
if
(
!
empty
(
$id
))
{
if
(
!
empty
(
$id
))
{
return
$this
->
init
(
$id
);
}
return
true
;
...
...
@@ -104,7 +104,7 @@ class AuthXmlrpc extends Auth {
$this
->
must_be_ready
();
$peer
=
get_peer
(
$remotewwwroot
);
if
(
$peer
->
deleted
!=
0
||
$this
->
config
[
'theyssoin'
]
!=
1
)
{
if
(
$peer
->
deleted
!=
0
||
$this
->
config
[
'theyssoin'
]
!=
1
)
{
throw
new
MaharaException
(
'We don\'t accept SSO connections from '
.
$peer
->
name
);
}
...
...
@@ -405,17 +405,17 @@ class PluginAuthXmlrpc extends PluginAuth {
// Get the current data (if any exists) for this auth instance
if
(
$instance
>
0
)
{
$default
=
get_record
(
'auth_instance'
,
'id'
,
$instance
);
if
(
$default
==
false
)
{
if
(
$default
==
false
)
{
throw
new
Exception
(
get_string
(
'nodataforinstance'
,
'auth'
)
.
$instance
);
}
$current_config
=
get_records_menu
(
'auth_instance_config'
,
'instance'
,
$instance
,
''
,
'field, value'
);
if
(
$current_config
==
false
)
{
if
(
$current_config
==
false
)
{
throw
new
Exception
(
'No config data for instance: '
.
$instance
);
}
foreach
(
self
::
$default_config
as
$key
=>
$value
)
{
if
(
array_key_exists
(
$key
,
$current_config
))
{
if
(
array_key_exists
(
$key
,
$current_config
))
{
self
::
$default_config
[
$key
]
=
$current_config
[
$key
];
// We can use the wwwroot to create a Peer object
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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