aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mod/register.php51
1 files changed, 26 insertions, 25 deletions
diff --git a/mod/register.php b/mod/register.php
index 407bda73e..ba6cffea0 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -206,45 +206,46 @@ function register_post(&$a) {
}
require_once('include/Photo.php');
+ $nograv = get_config('system','no_gravatar');
+ if(! $nograv) {
+ $photo = gravatar_img($email);
+ $photo_failure = false;
- $photo = gravatar_img($email);
- $photo_failure = false;
+ $filename = basename($photo);
+ $img_str = fetch_url($photo,true);
+ $img = new Photo($img_str);
+ if($img->is_valid()) {
- $filename = basename($photo);
- $img_str = fetch_url($photo,true);
- $img = new Photo($img_str);
- if($img->is_valid()) {
-
- $img->scaleImageSquare(175);
+ $img->scaleImageSquare(175);
- $hash = photo_new_resource();
+ $hash = photo_new_resource();
- $r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 4 );
+ $r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 4 );
- if($r === false)
- $photo_failure = true;
+ if($r === false)
+ $photo_failure = true;
- $img->scaleImage(80);
+ $img->scaleImage(80);
- $r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 5 );
+ $r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 5 );
- if($r === false)
- $photo_failure = true;
+ if($r === false)
+ $photo_failure = true;
- $img->scaleImage(48);
+ $img->scaleImage(48);
- $r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 6 );
+ $r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 6 );
- if($r === false)
- $photo_failure = true;
+ if($r === false)
+ $photo_failure = true;
- if(! $photo_failure) {
- q("UPDATE `photo` SET `profile` = 1 WHERE `resource-id` = '%s' ",
- dbesc($hash)
- );
+ if(! $photo_failure) {
+ q("UPDATE `photo` SET `profile` = 1 WHERE `resource-id` = '%s' ",
+ dbesc($hash)
+ );
+ }
}
}
-
if( $a->config['register_policy'] == REGISTER_OPEN ) {
$email_tpl = load_view_file("view/register_open_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(