aboutsummaryrefslogtreecommitdiffstats
path: root/mod/register.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-23 20:56:20 -0800
committerFriendika <info@friendika.com>2010-11-23 20:56:20 -0800
commitdd52aec243cd16f7ff05026b91f984788cafad56 (patch)
tree8823efcfb060082503baac004d7f4d0133e7c7c8 /mod/register.php
parentf9f08b435589ea10dca2db6891ae885a66e831e4 (diff)
downloadvolse-hubzilla-dd52aec243cd16f7ff05026b91f984788cafad56.tar.gz
volse-hubzilla-dd52aec243cd16f7ff05026b91f984788cafad56.tar.bz2
volse-hubzilla-dd52aec243cd16f7ff05026b91f984788cafad56.zip
use optional openid photo for registration - if supplied
Diffstat (limited to 'mod/register.php')
-rw-r--r--mod/register.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/mod/register.php b/mod/register.php
index 69c34f8e9..20ea0175a 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -39,6 +39,8 @@ function register_post(&$a) {
if(x($_POST,'openid_url'))
$openid_url = notags(trim($_POST['openid_url']));
+ $photo = ((x($_POST,'photo')) ? notags(trim($_POST['photo'])) : '');
+
if((! x($username)) || (! x($email)) || (! x($nickname))) {
if($openid_url) {
@@ -49,7 +51,7 @@ function register_post(&$a) {
$openid->identity = $openid_url;
$openid->returnUrl = $a->get_baseurl() . '/openid';
$openid->required = array('namePerson/friendly', 'contact/email', 'namePerson');
- $openid->optional = array('namePerson/first','media/image/aspect11');
+ $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default');
goaway($openid->authUrl());
// NOTREACHED
}
@@ -206,11 +208,16 @@ function register_post(&$a) {
}
$use_gravatar = ((get_config('system','no_gravatar')) ? false : true);
- if($use_gravatar) {
+
+ // if we have an openid photo use it.
+ // otherwise unless it is disabled, use gravatar
+
+ if($use_gravatar || strlen($photo)) {
require_once('include/Photo.php');
- $photo = gravatar_img($email);
+ if(($use_gravatar) && (! strlen($photo)))
+ $photo = gravatar_img($email);
$photo_failure = false;
$filename = basename($photo);
@@ -327,10 +334,11 @@ function register_content(&$a) {
return;
}
- $username = ((x($_POST,'username')) ? $_POST['username'] : ((x($_GET,'username')) ? $_GET['username'] : ''));
- $email = ((x($_POST,'email')) ? $_POST['email'] : ((x($_GET,'email')) ? $_GET['email'] : ''));
- $openid_url = ((x($_POST,'openid_url')) ? $_POST['openid_url'] : ((x($_GET,'openid_url')) ? $_GET['openid_url'] : ''));
- $nickname = ((x($_POST,'nickname')) ? $_POST['nickname'] : ((x($_GET,'nickname')) ? $_GET['nickname'] : ''));
+ $username = ((x($_POST,'username')) ? $_POST['username'] : ((x($_GET,'username')) ? $_GET['username'] : ''));
+ $email = ((x($_POST,'email')) ? $_POST['email'] : ((x($_GET,'email')) ? $_GET['email'] : ''));
+ $openid_url = ((x($_POST,'openid_url')) ? $_POST['openid_url'] : ((x($_GET,'openid_url')) ? $_GET['openid_url'] : ''));
+ $nickname = ((x($_POST,'nickname')) ? $_POST['nickname'] : ((x($_GET,'nickname')) ? $_GET['nickname'] : ''));
+ $photo = ((x($_POST,'photo')) ? $_POST['photo'] : ((x($_GET,'photo')) ? hex2bin($_GET['photo']) : ''));
$o = load_view_file("view/register.tpl");
$o = replace_macros($o, array(
@@ -346,6 +354,7 @@ function register_content(&$a) {
'$addrlabel' => t('Your Email Address: '),
'$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your global profile locator will then be \'<strong>nickname@$sitename</strong>\'.'),
'$nicklabel' => t('Choose a nickname: '),
+ '$photo' => $photo,
'$regbutt' => t('Register'),
'$username' => $username,
'$email' => $email,