Skip to content
GitLab
Menu
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
1489e11c
Commit
1489e11c
authored
May 03, 2011
by
Richard Mansfield
Committed by
Gerrit Code Review
May 03, 2011
Browse files
Merge "Revert "Add upgrade/postinst script to selectively enable Gravatar support""
parents
0234b014
54891e1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
1489e11c
...
...
@@ -1376,38 +1376,6 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if
(
$oldversion
<
2010021600
)
{
// Set remoteavatars defaults
// Check if the site is using https
$urlprotocol
=
substr
(
get_config
(
'wwwroot'
),
0
,
5
);
if
(
strtolower
(
$urlprotocol
)
==
'https'
)
{
// Avoid mix of secure and insecure contents
set_config
(
'remoteavatars'
,
0
);
}
else
{
// Check to see if we can reach gravatar.com
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_FAILONERROR
,
true
);
curl_setopt
(
$ch
,
CURLOPT_FRESH_CONNECT
,
true
);
curl_setopt
(
$ch
,
CURLOPT_HEADER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_VERBOSE
,
false
);
curl_setopt
(
$ch
,
CURLOPT_NOBODY
,
true
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
5
);
// timeout in seconds
curl_setopt
(
$ch
,
CURLOPT_COOKIE
,
''
);
curl_setopt
(
$ch
,
CURLOPT_REFERER
,
''
);
// for privacy
curl_setopt
(
$ch
,
CURLOPT_URL
,
'http://www.gravatar.com/'
);
if
(
curl_exec
(
$ch
))
{
// By default, turn it on
set_config
(
'remoteavatars'
,
1
);
}
else
{
// Can't reach gravatar.com in a timely fashion
set_config
(
'remoteavatars'
,
0
);
}
curl_close
(
$ch
);
}
}
if
(
$oldversion
<
2010031000
)
{
// For existing sites, preserve current user search behaviour:
// Users are only searchable by their display names.
...
...
htdocs/lib/upgrade.php
View file @
1489e11c
...
...
@@ -614,7 +614,6 @@ function core_postinst() {
)'
);
set_antispam_defaults
();
set_remoteavatars_default
();
reload_html_filters
();
return
$status
;
}
...
...
@@ -1058,40 +1057,6 @@ function reload_html_filters() {
log_info
(
'Enabled '
.
count
(
$filters
)
.
' HTML filters.'
);
}
/**
* Use a meaningful default for the 'remoteavatars' setting.
*/
function
set_remoteavatars_default
()
{
// Check if the site is using https
$urlprotocol
=
substr
(
get_config
(
'wwwroot'
),
0
,
5
);
if
(
strtolower
(
$urlprotocol
)
==
'https'
)
{
// Avoid mix of secure and insecure contents
set_config
(
'remoteavatars'
,
0
);
}
else
{
// Check to see if we can reach gravatar.com
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_FAILONERROR
,
true
);
curl_setopt
(
$ch
,
CURLOPT_FRESH_CONNECT
,
true
);
curl_setopt
(
$ch
,
CURLOPT_HEADER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_VERBOSE
,
false
);
curl_setopt
(
$ch
,
CURLOPT_NOBODY
,
true
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
5
);
// timeout in seconds
curl_setopt
(
$ch
,
CURLOPT_COOKIE
,
''
);
curl_setopt
(
$ch
,
CURLOPT_REFERER
,
''
);
// for privacy
curl_setopt
(
$ch
,
CURLOPT_URL
,
'http://www.gravatar.com/'
);
if
(
curl_exec
(
$ch
))
{
// By default, turn it on
set_config
(
'remoteavatars'
,
1
);
}
else
{
// Can't reach gravatar.com in a timely fashion
set_config
(
'remoteavatars'
,
0
);
}
curl_close
(
$ch
);
}
}
/**
* Use meaningful defaults for the antispam settings.
*/
...
...
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