added more curly braces + space between "if" and brace

Signed-off-by: Roland Häder <roland@mxchange.org>

Conflicts:
	mod/admin.php
This commit is contained in:
Roland Häder 2016-12-20 17:43:46 +01:00
parent 4805aa8fdb
commit de689583e2
15 changed files with 225 additions and 167 deletions

View file

@ -94,11 +94,12 @@ function authenticate_success($user_record, $login_initial = false, $interactive
}
if($login_initial) {
if ($login_initial) {
call_hooks('logged_in', $a->user);
if(($a->module !== 'home') && isset($_SESSION['return_url']))
if (($a->module !== 'home') && isset($_SESSION['return_url'])) {
goaway(App::get_baseurl() . '/' . $_SESSION['return_url']);
}
}
}
@ -109,16 +110,17 @@ function can_write_wall(&$a,$owner) {
static $verified = 0;
if((! (local_user())) && (! (remote_user())))
if ((! (local_user())) && (! (remote_user()))) {
return false;
}
$uid = local_user();
if(($uid) && ($uid == $owner)) {
if (($uid) && ($uid == $owner)) {
return true;
}
if(remote_user()) {
if (remote_user()) {
// use remembered decision and avoid a DB lookup for each and every display item
// DO NOT use this function if there are going to be multiple owners
@ -126,25 +128,25 @@ function can_write_wall(&$a,$owner) {
// We have a contact-id for an authenticated remote user, this block determines if the contact
// belongs to this page owner, and has the necessary permissions to post content
if($verified === 2)
if ($verified === 2) {
return true;
elseif($verified === 1)
} elseif ($verified === 1) {
return false;
else {
} else {
$cid = 0;
if(is_array($_SESSION['remote'])) {
foreach($_SESSION['remote'] as $visitor) {
if($visitor['uid'] == $owner) {
if (is_array($_SESSION['remote'])) {
foreach ($_SESSION['remote'] as $visitor) {
if ($visitor['uid'] == $owner) {
$cid = $visitor['cid'];
break;
}
}
}
if(! $cid)
if (! $cid) {
return false;
}
$r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `user`.`uid` = `contact`.`uid`
WHERE `contact`.`uid` = %d AND `contact`.`id` = %d AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0