Continued with coding convention:

- added curly braces around conditional code blocks
- added space between if/foreach/... and brace
- rewrote a code block so if dbm::is_result() fails it will abort, else the id
  is fetched from INSERT statement
- made some SQL keywords upper-cased and added back-ticks to columns/table names

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Haeder 2016-12-20 21:15:53 +01:00
parent 6c0c9d542a
commit 52f14ffa5f
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
31 changed files with 173 additions and 127 deletions

View file

@ -56,7 +56,7 @@ function openid_content(&$a) {
// Successful OpenID login - but we can't match it to an existing account.
// New registration?
if($a->config['register_policy'] == REGISTER_CLOSED) {
if ($a->config['register_policy'] == REGISTER_CLOSED) {
notice( t('Account not found and OpenID registration is not permitted on this site.') . EOL);
goaway(z_root());
}
@ -64,31 +64,41 @@ function openid_content(&$a) {
unset($_SESSION['register']);
$args = '';
$attr = $openid->getAttributes();
if(is_array($attr) && count($attr)) {
foreach($attr as $k => $v) {
if($k === 'namePerson/friendly')
if (is_array($attr) && count($attr)) {
foreach ($attr as $k => $v) {
if ($k === 'namePerson/friendly') {
$nick = notags(trim($v));
if($k === 'namePerson/first')
}
if($k === 'namePerson/first') {
$first = notags(trim($v));
if($k === 'namePerson')
}
if($k === 'namePerson') {
$args .= '&username=' . notags(trim($v));
if($k === 'contact/email')
}
if ($k === 'contact/email') {
$args .= '&email=' . notags(trim($v));
if($k === 'media/image/aspect11')
}
if ($k === 'media/image/aspect11') {
$photosq = bin2hex(trim($v));
if($k === 'media/image/default')
}
if ($k === 'media/image/default') {
$photo = bin2hex(trim($v));
}
}
}
if($nick)
if ($nick) {
$args .= '&nickname=' . $nick;
elseif($first)
}
elseif ($first) {
$args .= '&nickname=' . $first;
}
if($photosq)
if ($photosq) {
$args .= '&photo=' . $photosq;
elseif($photo)
}
elseif ($photo) {
$args .= '&photo=' . $photo;
}
$args .= '&openid_url=' . notags(trim($authid));