Fix formatting all around

This commit is contained in:
Hypolite Petovan 2017-12-09 13:42:02 -05:00
parent 669c7dea59
commit fe89e7760e
7 changed files with 29 additions and 25 deletions

View File

@ -4674,7 +4674,9 @@ function api_friendica_group_delete($type)
{ {
$a = get_app(); $a = get_app();
if (api_user() === false) throw new ForbiddenException(); if (api_user() === false) {
throw new ForbiddenException();
}
// params // params
$user_info = api_get_user($a); $user_info = api_get_user($a);
@ -4683,8 +4685,9 @@ function api_friendica_group_delete($type)
$uid = $user_info['uid']; $uid = $user_info['uid'];
// error if no gid specified // error if no gid specified
if ($gid == 0 || $name == "") if ($gid == 0 || $name == "") {
throw new BadRequestException('gid or name not specified'); throw new BadRequestException('gid or name not specified');
}
// get data of the specified group id // get data of the specified group id
$r = q( $r = q(
@ -4693,8 +4696,9 @@ function api_friendica_group_delete($type)
intval($gid) intval($gid)
); );
// error message if specified gid is not in database // error message if specified gid is not in database
if (!DBM::is_result($r)) if (!DBM::is_result($r)) {
throw new BadRequestException('gid not available'); throw new BadRequestException('gid not available');
}
// get data of the specified group id and group name // get data of the specified group id and group name
$rname = q( $rname = q(
@ -4704,8 +4708,9 @@ function api_friendica_group_delete($type)
dbesc($name) dbesc($name)
); );
// error message if specified gid is not in database // error message if specified gid is not in database
if (!DBM::is_result($rname)) if (!DBM::is_result($rname)) {
throw new BadRequestException('wrong group name'); throw new BadRequestException('wrong group name');
}
// delete group // delete group
$ret = group_rmv($uid, $name); $ret = group_rmv($uid, $name);

View File

@ -5,36 +5,38 @@ use Friendica\Database\DBM;
require_once('include/group.php'); require_once('include/group.php');
function contactgroup_content(App $a) { function contactgroup_content(App $a)
if (! local_user()) { {
if (!local_user()) {
killme(); killme();
} }
if(($a->argc > 2) && intval($a->argv[1]) && intval($a->argv[2])) { if (($a->argc > 2) && intval($a->argv[1]) && intval($a->argv[2])) {
$r = q("SELECT `id` FROM `contact` WHERE `id` = %d AND `uid` = %d and `self` = 0 and `blocked` = 0 AND `pending` = 0 LIMIT 1", $r = q("SELECT `id` FROM `contact` WHERE `id` = %d AND `uid` = %d and `self` = 0 and `blocked` = 0 AND `pending` = 0 LIMIT 1",
intval($a->argv[2]), intval($a->argv[2]),
intval(local_user()) intval(local_user())
); );
if (DBM::is_result($r)) if (DBM::is_result($r)) {
$change = intval($a->argv[2]); $change = intval($a->argv[2]);
}
} }
if(($a->argc > 1) && (intval($a->argv[1]))) { if (($a->argc > 1) && (intval($a->argv[1]))) {
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d AND `deleted` = 0 LIMIT 1", $r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d AND `deleted` = 0 LIMIT 1",
intval($a->argv[1]), intval($a->argv[1]),
intval(local_user()) intval(local_user())
); );
if (! DBM::is_result($r)) { if (!DBM::is_result($r)) {
killme(); killme();
} }
$group = $r[0]; $group = $r[0];
$members = group_get_members($group['id']); $members = group_get_members($group['id']);
$preselected = array(); $preselected = array();
if(count($members)) { if (count($members)) {
foreach($members as $member) foreach ($members as $member) {
$preselected[] = $member['id']; $preselected[] = $member['id'];
}
} }
if($change) { if($change) {

View File

@ -508,7 +508,6 @@ function dfrn_confirm_post(App $a, $handsfree = null) {
// Let's send our user to the contact editor in case they want to // Let's send our user to the contact editor in case they want to
// do anything special with this new friend. // do anything special with this new friend.
if ($handsfree === null) { if ($handsfree === null) {
goaway(System::baseUrl() . '/contacts/' . intval($contact_id)); goaway(System::baseUrl() . '/contacts/' . intval($contact_id));
} else { } else {

View File

@ -194,8 +194,9 @@ function dfrn_request_post(App $a) {
if(intval($def_gid)) if(intval($def_gid))
group_add_member(local_user(), '', $r[0]['id'], $def_gid); group_add_member(local_user(), '', $r[0]['id'], $def_gid);
if (isset($photo)) if (isset($photo)) {
Contact::updateAvatar($photo, local_user(), $r[0]["id"], true); Contact::updateAvatar($photo, local_user(), $r[0]["id"], true);
}
$forwardurl = System::baseUrl()."/contacts/".$r[0]['id']; $forwardurl = System::baseUrl()."/contacts/".$r[0]['id'];
} else { } else {

View File

@ -5,19 +5,18 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
require_once("mod/display.php");
require_once("include/group.php"); require_once("include/group.php");
require_once "mod/display.php";
function update_display_content(App $a) { function update_display_content(App $a)
{
$profile_uid = intval($_GET["p"]); $profile_uid = intval($_GET["p"]);
header("Content-type: text/html"); header("Content-type: text/html");
echo "<!DOCTYPE html><html><body>\r\n"; echo "<!DOCTYPE html><html><body>\r\n";
echo "<section>"; echo "<section>";
$text = display_content($a, $profile_uid);
$text = display_content($a,$profile_uid);
$pattern = "/<img([^>]*) src=\"([^\"]*)\"/"; $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
$replace = "<img\${1} dst=\"\${2}\""; $replace = "<img\${1} dst=\"\${2}\"";
$text = preg_replace($pattern, $replace, $text); $text = preg_replace($pattern, $replace, $text);

View File

@ -5,11 +5,11 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
require_once("mod/network.php");
require_once("include/group.php"); require_once("include/group.php");
require_once "mod/network.php";
function update_network_content(App $a) { function update_network_content(App $a)
{
$profile_uid = intval($_GET["p"]); $profile_uid = intval($_GET["p"]);
header("Content-type: text/html"); header("Content-type: text/html");

View File

@ -225,7 +225,6 @@ class User
} }
// So now we are just looking for a space in the full name. // So now we are just looking for a space in the full name.
$loose_reg = Config::get('system', 'no_regfullname'); $loose_reg = Config::get('system', 'no_regfullname');
if (!$loose_reg) { if (!$loose_reg) {
$username = mb_convert_case($username, MB_CASE_TITLE, 'UTF-8'); $username = mb_convert_case($username, MB_CASE_TITLE, 'UTF-8');
@ -234,7 +233,6 @@ class User
} }
} }
if (!allowed_email($email)) { if (!allowed_email($email)) {
$result['message'] .= t('Your email domain is not among those allowed on this site.') . EOL; $result['message'] .= t('Your email domain is not among those allowed on this site.') . EOL;
} }