Some more formatting reverts

This commit is contained in:
Hypolite Petovan 2016-10-24 12:43:38 -04:00
parent 8787587011
commit fb75394766
1 changed files with 29 additions and 29 deletions

View File

@ -51,7 +51,7 @@ function settings_init(&$a)
if (get_features()) { if (get_features()) {
$tabs[] = array( $tabs[] = array(
'label' => t('Additional features'), 'label' => t('Additional features'),
'url' => 'settings/features', 'url' => 'settings/features',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''), 'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''),
'accesskey' => 't', 'accesskey' => 't',
); );
@ -59,49 +59,49 @@ function settings_init(&$a)
$tabs[] = array( $tabs[] = array(
'label' => t('Display'), 'label' => t('Display'),
'url' => 'settings/display', 'url' => 'settings/display',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'display') ? 'active' : ''), 'selected' => (($a->argc > 1) && ($a->argv[1] === 'display') ? 'active' : ''),
'accesskey' => 'i', 'accesskey' => 'i',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Social Networks'), 'label' => t('Social Networks'),
'url' => 'settings/connectors', 'url' => 'settings/connectors',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors') ? 'active' : ''), 'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors') ? 'active' : ''),
'accesskey' => 'w', 'accesskey' => 'w',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Plugins'), 'label' => t('Plugins'),
'url' => 'settings/addon', 'url' => 'settings/addon',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon') ? 'active' : ''), 'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon') ? 'active' : ''),
'accesskey' => 'l', 'accesskey' => 'l',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Delegations'), 'label' => t('Delegations'),
'url' => 'delegate', 'url' => 'delegate',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'delegate') ? 'active' : ''), 'selected' => (($a->argc == 1) && ($a->argv[0] === 'delegate') ? 'active' : ''),
'accesskey' => 'd', 'accesskey' => 'd',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Connected apps'), 'label' => t('Connected apps'),
'url' => 'settings/oauth', 'url' => 'settings/oauth',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth') ? 'active' : ''), 'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth') ? 'active' : ''),
'accesskey' => 'b', 'accesskey' => 'b',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Export personal data'), 'label' => t('Export personal data'),
'url' => 'uexport', 'url' => 'uexport',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'uexport') ? 'active' : ''), 'selected' => (($a->argc == 1) && ($a->argv[0] === 'uexport') ? 'active' : ''),
'accesskey' => 'e', 'accesskey' => 'e',
); );
$tabs[] = array( $tabs[] = array(
'label' => t('Remove account'), 'label' => t('Remove account'),
'url' => 'removeme', 'url' => 'removeme',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme') ? 'active' : ''), 'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme') ? 'active' : ''),
'accesskey' => 'r', 'accesskey' => 'r',
); );
@ -147,11 +147,11 @@ function settings_post(&$a)
if (($a->argc > 2) && ($a->argv[1] === 'oauth') && ($a->argv[2] === 'edit' || ($a->argv[2] === 'add')) && x($_POST, 'submit')) { if (($a->argc > 2) && ($a->argv[1] === 'oauth') && ($a->argv[2] === 'edit' || ($a->argv[2] === 'add')) && x($_POST, 'submit')) {
check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth'); check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
$name = ((x($_POST, 'name')) ? $_POST['name'] : ''); $name = ((x($_POST, 'name')) ? $_POST['name'] : '');
$key = ((x($_POST, 'key')) ? $_POST['key'] : ''); $key = ((x($_POST, 'key')) ? $_POST['key'] : '');
$secret = ((x($_POST, 'secret')) ? $_POST['secret'] : ''); $secret = ((x($_POST, 'secret')) ? $_POST['secret'] : '');
$redirect = ((x($_POST, 'redirect')) ? $_POST['redirect'] : ''); $redirect = ((x($_POST, 'redirect')) ? $_POST['redirect'] : '');
$icon = ((x($_POST, 'icon')) ? $_POST['icon'] : ''); $icon = ((x($_POST, 'icon')) ? $_POST['icon'] : '');
if ($name == '' || $key == '' || $secret == '') { if ($name == '' || $key == '' || $secret == '') {
notice(t('Missing some important data!')); notice(t('Missing some important data!'));
} else { } else {
@ -205,15 +205,15 @@ function settings_post(&$a)
set_pconfig(local_user(), 'ostatus', 'default_group', $_POST['group-selection']); set_pconfig(local_user(), 'ostatus', 'default_group', $_POST['group-selection']);
set_pconfig(local_user(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']); set_pconfig(local_user(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']);
} elseif (x($_POST, 'imap-submit')) { } elseif (x($_POST, 'imap-submit')) {
$mail_server = ((x($_POST, 'mail_server')) ? $_POST['mail_server'] : ''); $mail_server = ((x($_POST, 'mail_server')) ? $_POST['mail_server'] : '');
$mail_port = ((x($_POST, 'mail_port')) ? $_POST['mail_port'] : ''); $mail_port = ((x($_POST, 'mail_port')) ? $_POST['mail_port'] : '');
$mail_ssl = ((x($_POST, 'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : ''); $mail_ssl = ((x($_POST, 'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : '');
$mail_user = ((x($_POST, 'mail_user')) ? $_POST['mail_user'] : ''); $mail_user = ((x($_POST, 'mail_user')) ? $_POST['mail_user'] : '');
$mail_pass = ((x($_POST, 'mail_pass')) ? trim($_POST['mail_pass']) : ''); $mail_pass = ((x($_POST, 'mail_pass')) ? trim($_POST['mail_pass']) : '');
$mail_action = ((x($_POST, 'mail_action')) ? trim($_POST['mail_action']) : ''); $mail_action = ((x($_POST, 'mail_action')) ? trim($_POST['mail_action']) : '');
$mail_movetofolder = ((x($_POST, 'mail_movetofolder')) ? trim($_POST['mail_movetofolder']) : ''); $mail_movetofolder = ((x($_POST, 'mail_movetofolder')) ? trim($_POST['mail_movetofolder']) : '');
$mail_replyto = ((x($_POST, 'mail_replyto')) ? $_POST['mail_replyto'] : ''); $mail_replyto = ((x($_POST, 'mail_replyto')) ? $_POST['mail_replyto'] : '');
$mail_pubmail = ((x($_POST, 'mail_pubmail')) ? $_POST['mail_pubmail'] : ''); $mail_pubmail = ((x($_POST, 'mail_pubmail')) ? $_POST['mail_pubmail'] : '');
$mail_disabled = ((function_exists('imap_open') && (!get_config('system', 'imap_disabled'))) ? 0 : 1); $mail_disabled = ((function_exists('imap_open') && (!get_config('system', 'imap_disabled'))) ? 0 : 1);
if (get_config('system', 'dfrn_only')) { if (get_config('system', 'dfrn_only')) {
@ -222,11 +222,11 @@ function settings_post(&$a)
if (!$mail_disabled) { if (!$mail_disabled) {
$failed = false; $failed = false;
$r = q('SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1', $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval(local_user()) intval(local_user())
); );
if (!count($r)) { if (!count($r)) {
q('INSERT INTO `mailacct` (`uid`) VALUES (%d)', q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
intval(local_user()) intval(local_user())
); );
} }
@ -252,7 +252,7 @@ function settings_post(&$a)
intval(local_user()) intval(local_user())
); );
logger('mail: updating mailaccount. Response: '.print_r($r, true)); logger('mail: updating mailaccount. Response: '.print_r($r, true));
$r = q('SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1', $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval(local_user()) intval(local_user())
); );
if (count($r)) { if (count($r)) {
@ -382,7 +382,7 @@ function settings_post(&$a)
// check if the old password was supplied correctly before // check if the old password was supplied correctly before
// changing it to the new value // changing it to the new value
$r = q('SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1', intval(local_user())); $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
if ($oldpass != $r[0]['password']) { if ($oldpass != $r[0]['password']) {
notice(t('Wrong password.').EOL); notice(t('Wrong password.').EOL);
$err = true; $err = true;
@ -497,7 +497,7 @@ function settings_post(&$a)
if ($email != $a->user['email']) { if ($email != $a->user['email']) {
$email_changed = true; $email_changed = true;
// check for the correct password // check for the correct password
$r = q('SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1', intval(local_user())); $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
$password = hash('whirlpool', $_POST['mpassword']); $password = hash('whirlpool', $_POST['mpassword']);
if ($password != $r[0]['password']) { if ($password != $r[0]['password']) {
$err .= t('Wrong Password').EOL; $err .= t('Wrong Password').EOL;
@ -738,10 +738,10 @@ function settings_content(&$a)
return; return;
} }
$r = q('SELECT clients.*, tokens.id as oauth_token, (clients.uid=%d) AS my $r = q("SELECT clients.*, tokens.id as oauth_token, (clients.uid=%d) AS my
FROM clients FROM clients
LEFT JOIN tokens ON clients.client_id=tokens.client_id LEFT JOIN tokens ON clients.client_id=tokens.client_id
WHERE clients.uid IN (%d,0)', WHERE clients.uid IN (%d,0)",
local_user(), local_user(),
local_user()); local_user());
@ -866,7 +866,7 @@ function settings_content(&$a)
} }
if (!$mail_disabled) { if (!$mail_disabled) {
$r = q('SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1', $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
local_user() local_user()
); );
} else { } else {
@ -1045,7 +1045,7 @@ function settings_content(&$a)
require_once 'include/acl_selectors.php'; require_once 'include/acl_selectors.php';
$p = q('SELECT * FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1', $p = q("SELECT * FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
intval(local_user()) intval(local_user())
); );
if (count($p)) { if (count($p)) {