aboutsummaryrefslogtreecommitdiffstats
path: root/mod/register.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-17 23:24:43 -0800
committerFriendika <info@friendika.com>2010-11-17 23:24:43 -0800
commitb4c277da22442cdb2d424490eee9ed9fcedf2c76 (patch)
treec02957bf4fe7eb532d6e49ae81d879ae17fea7af /mod/register.php
parent6516de06df6bd3c52665eb3f0fc9d31095541915 (diff)
downloadvolse-hubzilla-b4c277da22442cdb2d424490eee9ed9fcedf2c76.tar.gz
volse-hubzilla-b4c277da22442cdb2d424490eee9ed9fcedf2c76.tar.bz2
volse-hubzilla-b4c277da22442cdb2d424490eee9ed9fcedf2c76.zip
provide config option to not use gravatar during registration
Diffstat (limited to 'mod/register.php')
-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(