Merge branch 'master' of git://github.com/friendika/friendika

This commit is contained in:
root 2011-01-05 18:06:35 +01:00
commit 011e0c3f81
8 changed files with 28 additions and 6 deletions

View file

@ -15,8 +15,12 @@
$a->page['nav'] .= "<span id=\"nav-link-wrapper\" >\r\n"; $a->page['nav'] .= "<span id=\"nav-link-wrapper\" >\r\n";
// This should take you home from a remote profile connection
$homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : '');
if(($a->module != 'home') && (! (local_user()))) if(($a->module != 'home') && (! (local_user())))
$a->page['nav'] .= '<a id="nav-home-link" class="nav-commlink" href="">' . t('Home') . "</a>\r\n"; $a->page['nav'] .= '<a id="nav-home-link" class="nav-commlink" href="' . $homelink . '">' . t('Home') . "</a>\r\n";
if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user())) if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
$a->page['nav'] .= '<a id="nav-register-link" class="nav-commlink" href="register" >' $a->page['nav'] .= '<a id="nav-register-link" class="nav-commlink" href="register" >'
. t('Register') . "</a>\r\n"; . t('Register') . "</a>\r\n";

View file

@ -183,6 +183,9 @@ elseif(local_user())
if(isset($homebase)) if(isset($homebase))
$a->page['content'] .= '<script>var homebase="' . $homebase . '" ; </script>'; $a->page['content'] .= '<script>var homebase="' . $homebase . '" ; </script>';
// now that we've been through the module content, see if the page reported
// a permission problem and if so, a 403 response would seem to be in order.
if(stristr($_SESSION['sysmsg'], t('Permission denied'))) { if(stristr($_SESSION['sysmsg'], t('Permission denied'))) {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . t('Permission denied.')); header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . t('Permission denied.'));
} }

View file

@ -363,7 +363,7 @@ function dfrn_notify_post(&$a) {
'$username' => $importer['username'], '$username' => $importer['username'],
'$email' => $importer['email'], '$email' => $importer['email'],
'$from' => $from, '$from' => $from,
'$display' => $a->get_baseurl() . '/display/' . $r, '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r,
'$body' => strip_tags(bbcode(stripslashes($datarray['body']))) '$body' => strip_tags(bbcode(stripslashes($datarray['body'])))
)); ));

View file

@ -126,7 +126,7 @@ function notifications_content(&$a) {
else else
notice( t('No notifications.') . EOL); notice( t('No notifications.') . EOL);
if ($a->config['register_policy'] = REGISTER_APPROVE && if ($a->config['register_policy'] == REGISTER_APPROVE &&
$a->config['admin_email'] === $a->user['email']){ $a->config['admin_email'] === $a->user['email']){
$o .= load_view_file('view/registrations-top.tpl'); $o .= load_view_file('view/registrations-top.tpl');

View file

@ -25,8 +25,8 @@ function ping_init(&$a) {
); );
$intro = $r[0]['total']; $intro = $r[0]['total'];
if ($a->config['register_policy'] = REGISTER_APPROVE && if ($a->config['register_policy'] == REGISTER_APPROVE &&
$a->config['admin_email'] = $a->user['email']){ $a->config['admin_email'] === $a->user['email']){
$r = q("SELECT COUNT(*) AS `total` FROM `register`"); $r = q("SELECT COUNT(*) AS `total` FROM `register`");
$register = $r[0]['total']; $register = $r[0]['total'];
} else { } else {

View file

@ -37,8 +37,13 @@ function register_post(&$a) {
$openid_url = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : ''); $openid_url = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : '');
$photo = ((x($_POST,'photo')) ? notags(trim($_POST['photo'])) : ''); $photo = ((x($_POST,'photo')) ? notags(trim($_POST['photo'])) : '');
$tmp_str = $openid_url;
if((! x($username)) || (! x($email)) || (! x($nickname))) { if((! x($username)) || (! x($email)) || (! x($nickname))) {
if($openid_url) { if($openid_url) {
if(! validate_url($tmp_str)) {
notice( t('Invalid OpenID url') . EOL);
return;
}
$_SESSION['register'] = 1; $_SESSION['register'] = 1;
$_SESSION['openid'] = $openid_url; $_SESSION['openid'] = $openid_url;
require_once('library/openid.php'); require_once('library/openid.php');
@ -82,6 +87,12 @@ function register_post(&$a) {
if((! valid_email($email)) || (! validate_email($email))) if((! valid_email($email)) || (! validate_email($email)))
$err .= t('Not a valid email address.') . EOL; $err .= t('Not a valid email address.') . EOL;
// Disallow somebody creating an account using openid that uses the admin email address,
// since openid bypasses email verification.
if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0) && strlen($openid_url))
$err .= t('Cannot use that email.') . EOL;
$nickname = $_POST['nickname'] = strtolower($nickname); $nickname = $_POST['nickname'] = strtolower($nickname);
if(! preg_match("/^[a-z][a-z0-9\-\_]*$/",$nickname)) if(! preg_match("/^[a-z][a-z0-9\-\_]*$/",$nickname))

View file

@ -1,7 +1,7 @@
if(navigator.geolocation) { if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) { navigator.geolocation.getCurrentPosition(function(position) {
$('#jot-coord').val(position.coords.latitude + position.coords.longitude); $('#jot-coord').val(position.coords.latitude + ' ' + position.coords.longitude);
$('#profile-nolocation-wrapper').show(); $('#profile-nolocation-wrapper').show();
}); });
} }

View file

@ -1826,3 +1826,7 @@ a.mail-list-link {
/* end from defautlt */ /* end from defautlt */
.fn {
padding: 0px 0px 5px 0px;
font-size: 120%;
}