summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2014-04-30 18:30:20 +0200
committerBenny Baumann <BenBE@geshi.org>2014-04-30 20:18:56 +0200
commit346899e832bd91f16733e197f592e7dae0173f70 (patch)
treeb106ac272adc4bb0740fdbb0ab33e684e4eea1fd
parent7f02d479140d2c47e9359191ed2a7d687c6b9a33 (diff)
downloadcacert-devel-346899e832bd91f16733e197f592e7dae0173f70.tar.gz
cacert-devel-346899e832bd91f16733e197f592e7dae0173f70.tar.xz
cacert-devel-346899e832bd91f16733e197f592e7dae0173f70.zip
bug 1138: Whitespace changes and code formatting
-rw-r--r--includes/general.php2
-rw-r--r--includes/lib/account.php2
-rw-r--r--includes/loggedin.php24
-rw-r--r--pages/account/52.php87
-rw-r--r--pages/account/55.php3
-rw-r--r--pages/wot/1.php16
-rw-r--r--pages/wot/9.php3
-rw-r--r--www/api/cemails.php3
-rw-r--r--www/wot.php6
9 files changed, 75 insertions, 71 deletions
diff --git a/includes/general.php b/includes/general.php
index fcd094a..9eb5060 100644
--- a/includes/general.php
+++ b/includes/general.php
@@ -77,7 +77,7 @@
L10n::detect_language();
L10n::init_gettext();
- if(array_key_exists('profile',$_SESSION) && is_array($_SESSION['profile']) && array_key_exists('id',$_SESSION['profile']) && $_SESSION['profile']['id'] > 0)
+ if(array_key_exists('profile',$_SESSION) && is_array($_SESSION['profile']) && array_key_exists('id',$_SESSION['profile']) && $_SESSION['profile']['id'] > 0)
{
$locked = mysql_fetch_assoc(mysql_query("select `locked` from `users` where `id`='".intval($_SESSION['profile']['id'])."'"));
if($locked['locked'] == 0)
diff --git a/includes/lib/account.php b/includes/lib/account.php
index 8590213..4c4d5ac 100644
--- a/includes/lib/account.php
+++ b/includes/lib/account.php
@@ -97,4 +97,4 @@ function fix_assurer_flag($userID = NULL)
}
return true;
-} \ No newline at end of file
+}
diff --git a/includes/loggedin.php b/includes/loggedin.php
index 33e834b..70c9674 100644
--- a/includes/loggedin.php
+++ b/includes/loggedin.php
@@ -38,9 +38,9 @@
if($key == '_config' || $key == 'mconn' || 'csrf_' == substr($key, 0, 5))
continue;
if(is_int($key) || is_string($key))
- unset($_SESSION[$key]);
- unset($$key);
- //session_unregister($key);
+ unset($_SESSION[$key]);
+ unset($$key);
+ //session_unregister($key);
}
$_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($uid)."'"));
@@ -64,9 +64,9 @@
if($key == '_config' || $key == 'mconn' || 'csrf_' == substr($key, 0, 5))
continue;
if(is_int($key) || is_string($key))
- unset($_SESSION[$key]);
- unset($$key);
- //session_unregister($key);
+ unset($_SESSION[$key]);
+ unset($$key);
+ //session_unregister($key);
}
$_SESSION['profile'] = mysql_fetch_assoc(mysql_query(
@@ -82,9 +82,9 @@
{
if($key == '_config' || $key == 'mconn' || 'csrf_' == substr($key, 0, 5))
continue;
- unset($_SESSION[$key]);
- unset($$key);
- //session_unregister($key);
+ unset($_SESSION[$key]);
+ unset($$key);
+ //session_unregister($key);
}
$_SESSION['_config']['oldlocation'] = '';
@@ -136,9 +136,9 @@
$_SESSION['profile'] = "";
foreach($_SESSION as $key => $value)
{
- unset($_SESSION[$key]);
- unset($$key);
- //session_unregister($key);
+ unset($_SESSION[$key]);
+ unset($$key);
+ //session_unregister($key);
}
header("location: https://".$normalhost."/index.php");
diff --git a/pages/account/52.php b/pages/account/52.php
index cb35548..6c00c26 100644
--- a/pages/account/52.php
+++ b/pages/account/52.php
@@ -14,21 +14,21 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/ ?>
-<? if($_SESSION['profile']['tverify'] <= 0) { echo _("You don't have access to this area."); } else { ?>
-<?
+*/
+
+if($_SESSION['profile']['tverify'] <= 0) {
+ echo _("You don't have access to this area.");
+} else {
$uid = intval($_GET['uid']);
$query = "select * from `tverify` where `id`='".intval($uid)."' and `modified`=0";
$res = mysql_query($query);
- if(mysql_num_rows($res) > 0)
- {
+ if(mysql_num_rows($res) > 0) {
$row = mysql_fetch_assoc($res);
$memid = intval($row['memid']);
$query2 = "select * from `tverify-vote` where `tverify`='".intval($uid)."' and `memid`='".intval($_SESSION['profile']['id'])."'";
- $rc2 = mysql_num_rows(mysql_query($query2));
- if($rc2 > 0)
- {
+ $rc2 = mysql_num_rows(mysql_query($query2));
+ if($rc2 > 0) {
showheader(_("My CAcert.org Account!"));
echo _("You have already voted on this request.");
showfooter();
@@ -40,19 +40,25 @@
$query = "select * from `users` where `id`='".intval($memid)."'";
$user = mysql_fetch_assoc(mysql_query($query));
$tobe = 50 - $notary['points'];
- if($row['URL'] != '' && $row['photoid'] != '')
+ if($row['URL'] != '' && $row['photoid'] != '') {
$tobe = 150 - $notary['points'];
- else if($row['URL'] != '')
+ } else if($row['URL'] != '') {
$tobe = 90 - $notary['points'];
- if(intval($tobe) <= 0)
+ }
+ if(intval($tobe) <= 0) {
$tobe = 0;
+ }
?>
<?=_("Request Details")?>:<br>
<?=_("Name on file")?>: <?=sanitizeHTML($user['fname']." ".$user['mname']." ".$user['lname']." ".$user['suffix'])?><br>
<?=_("Primary email address")?>: <?=sanitizeHTML($user['email'])." (".intval($user['id']).")"?><br>
<?=_("Certificate Subject")?>: <?=sanitizeHTML($row['CN'])?><br>
-<? if($row['URL'] != '') { ?><?=_("Notary URL")?>: <a href="<?=$row['URL']?>"><?=$row['URL']?></a><br><? } ?>
-<? if($row['photoid'] != '') { ?><?=_("Photo ID URL")?>: <a href="/account.php?id=51&amp;photoid=<?=intval($row['id'])?>"><?=_("Here")?></a><br><? } ?>
+<? if($row['URL'] != '') { ?>
+<?=_("Notary URL")?>: <a href="<?=$row['URL']?>"><?=$row['URL']?></a><br>
+<? } ?>
+<? if($row['photoid'] != '') { ?>
+<?=_("Photo ID URL")?>: <a href="/account.php?id=51&amp;photoid=<?=intval($row['id'])?>"><?=_("Here")?></a><br>
+<? } ?>
<?=_("Current Points")?>: <?=intval($notary['points'])?><br>
<?=_("Potential Points")?>: <?=intval($tobe)?><br>
<?=_("Date of Birth")?>: <?=$user['dob']?> (YYYY-MM-DD)<br>
@@ -65,38 +71,35 @@
<input type="hidden" name="oldid" value="<?=intval($_GET['id'])?>">
<input type="hidden" name="uid" value="<?=intval($uid)?>">
</form>
-<? } else {
- $query = "select * from `tverify` where `id`='".intval($uid)."' and `modified`=1";
- $res = mysql_query($query);
- if(mysql_num_rows($res) > 0)
- {
- echo _("This UID has already been voted on.")."<br/>";
+<?
} else {
- if($uid) echo _("Unable to locate a valid request for that UID.")."<br/>";
- }
+ $query = "select * from `tverify` where `id`='".intval($uid)."' and `modified`=1";
+ $res = mysql_query($query);
+ if(mysql_num_rows($res) > 0) {
+ echo _("This UID has already been voted on.")."<br/>";
+ } else {
+ if($uid) echo _("Unable to locate a valid request for that UID.")."<br/>";
+ }
- // Search for open requests:
- $query = "select * from `tverify` where `modified`=0";
- $res = mysql_query($query);
- if(mysql_num_rows($res) > 0)
- {
- echo "<br/>"._("The following requests are still open:")."<br/><ul>";
- while($row = mysql_fetch_assoc($res))
- {
- $uid=intval($row['id']);
- $query3 = "select * from `tverify-vote` where `tverify`='".intval($uid)."' and `memid`='".intval($_SESSION['profile']['id'])."'";
- $rc3 = mysql_num_rows(mysql_query($query3));
- if($rc3 <= 0)
- {
- echo "<li><a href='account.php?id=52&amp;uid=".intval($row['id'])."'>".intval($row['id'])."</a></li>\n";
+ // Search for open requests:
+ $query = "select * from `tverify` where `modified`=0";
+ $res = mysql_query($query);
+ if(mysql_num_rows($res) > 0) {
+ echo "<br/>"._("The following requests are still open:")."<br/><ul>";
+ while($row = mysql_fetch_assoc($res)) {
+ $uid=intval($row['id']);
+ $query3 = "select * from `tverify-vote` where `tverify`='".intval($uid)."' and `memid`='".intval($_SESSION['profile']['id'])."'";
+ $rc3 = mysql_num_rows(mysql_query($query3));
+ if($rc3 <= 0)
+ {
+ echo "<li><a href='account.php?id=52&amp;uid=".intval($row['id'])."'>".intval($row['id'])."</a></li>\n";
+ }
}
+ echo "</ul>\n<br>\n";
+ } else {
+ echo "<br/>"._("There are no pending requests where you haven't voted yet.");
}
- echo "</ul>\n<br>\n";
}
- else
- {
- echo "<br/>"._("There are no pending requests where you haven't voted yet.");
- }
-
+}
- } } ?>
+?>
diff --git a/pages/account/55.php b/pages/account/55.php
index d110601..6793a71 100644
--- a/pages/account/55.php
+++ b/pages/account/55.php
@@ -85,7 +85,8 @@
if ($_SESSION['profile']['admin'] == 1 && array_key_exists('userid',$_REQUEST) && intval($_REQUEST['userid']) > 0) {
?>
<tr><td colspan="3" class="DataTD"><a href="account.php?id=43&amp;userid=<?=intval($user_id)?>">back</a></td></tr>
-<? } else {
+<?
+ } else {
$query = 'SELECT `u`.id, `u`.`assurer`, SUM(`points`) FROM `users` AS `u`, `notary` AS `n` '.
' WHERE `u`.`id` = \''.(int)intval($_SESSION['profile']['id']).'\' AND `n`.`to` = `u`.`id` AND `expire` < now() and and `n`.`deleted` = 0'.
' GROUP BY `u`.id, `u`.`assurer`';
diff --git a/pages/wot/1.php b/pages/wot/1.php
index d6e298d..9047f27 100644
--- a/pages/wot/1.php
+++ b/pages/wot/1.php
@@ -14,9 +14,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/ ?>
-<?
- $res=mysql_fetch_assoc(mysql_query("select sum(acount) as summe from countries"));
+*/
+
+ $res=mysql_fetch_assoc(mysql_query("select sum(acount) as summe from countries"));
$total1 =$res['summe'];
$locid=array_key_exists('locid',$_REQUEST)?intval($_REQUEST['locid']):0;
@@ -104,19 +104,19 @@
<td class="title"><?=_("Contact Details")?></td>
<td class="title"><?=_("Email Assurer")?></td>
<td class="title"><?=_("Assurer Challenge")?></td>
-
</tr>
-<? while($row = mysql_fetch_assoc($list)) { ?>
+
+<? while($row = mysql_fetch_assoc($list)) { ?>
<tr>
<td class="DataTD" width="100"><nobr><?=sanitizeHTML($row['fname'])?> <?=substr($row['lname'], 0, 1)?>.</nobr></td>
<td class="DataTD"><?=maxpoints($row['id'])?></td>
<td class="DataTD"><?=sanitizeHTML($row['contactinfo'])?></td>
<td class="DataTD"><a href="wot.php?id=9&amp;userid=<?=intval($row['id'])?>"><?=_("Email Me")?></a></td>
<td class="DataTD"><?=$row['assurer']?_("Yes"):("<font color=\"#ff0000\">"._("Not yet!")."</font>")?></td>
-
</tr>
-<? }
- }
+<?
+ }
+ }
?>
</table>
<br>
diff --git a/pages/wot/9.php b/pages/wot/9.php
index e4fff21..a8b9413 100644
--- a/pages/wot/9.php
+++ b/pages/wot/9.php
@@ -29,8 +29,7 @@
$userlang = $user['language'];
$points = mysql_num_rows(mysql_query("select sum(`points`) as `total` from `notary`
where `to`='".intval($user['id'])."' and `deleted`=0 group by `to` HAVING SUM(`points`) > 0"));
- if($points <= 0)
- {
+ if($points <= 0) {
echo _("Sorry, I was unable to locate that user.");
} else {
diff --git a/www/api/cemails.php b/www/api/cemails.php
index 4eb7597..f937069 100644
--- a/www/api/cemails.php
+++ b/www/api/cemails.php
@@ -42,6 +42,7 @@
}
$query = "select * from `email` where `memid`='".intval($memid)."' and `hash`='' and `deleted`=0";
$res = mysql_query($query);
- while($row = mysql_fetch_assoc($res))
+ while($row = mysql_fetch_assoc($res)) {
echo "EMAIL=".sanitizeHTML($row['email'])."\n";
+ }
?>
diff --git a/www/wot.php b/www/wot.php
index 7ce757d..faa8339 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -133,9 +133,9 @@ function send_reminder()
//This mail does not need to be translated
$body = "Hi TTP adminstrators,\n\n";
$body .= "User ".$_SESSION['profile']['fname']." ".
- $_SESSION['profile']['lname']." with email address '".
- $_SESSION['profile']['email']."' is requesting a TTP assurances for ".
- mysql_escape_string(stripslashes($_POST['country'])).".\n\n";
+ $_SESSION['profile']['lname']." with email address '".
+ $_SESSION['profile']['email']."' is requesting a TTP assurances for ".
+ mysql_escape_string(stripslashes($_POST['country'])).".\n\n";
if ($_POST['ttptopup']=='1') {
$body .= "The user is also requesting TTP TOPUP.\n\n";
}else{