bug 1138: Whitespace changes and code formatting
authorBenny Baumann <BenBE@geshi.org>
Wed, 30 Apr 2014 16:30:20 +0000 (18:30 +0200)
committerBenny Baumann <BenBE@geshi.org>
Wed, 30 Apr 2014 18:18:56 +0000 (20:18 +0200)
includes/general.php
includes/lib/account.php
includes/loggedin.php
pages/account/52.php
pages/account/55.php
pages/wot/1.php
pages/wot/9.php
www/api/cemails.php
www/wot.php

index fcd094a..9eb5060 100644 (file)
@@ -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)
index 8590213..4c4d5ac 100644 (file)
@@ -97,4 +97,4 @@ function fix_assurer_flag($userID = NULL)
        }
 
        return true;
-}
\ No newline at end of file
+}
index 33e834b..70c9674 100644 (file)
@@ -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'] = '';
                $_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");
index cb35548..6c00c26 100644 (file)
     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();
                $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>
 <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.");
-       }
-
+}
 
- } } ?>
+?>
index d110601..6793a71 100644 (file)
@@ -85,7 +85,8 @@
       if ($_SESSION['profile']['admin'] == 1 && array_key_exists('userid',$_REQUEST) && intval($_REQUEST['userid']) > 0) {\r
 ?>\r
     <tr><td colspan="3" class="DataTD"><a href="account.php?id=43&amp;userid=<?=intval($user_id)?>">back</a></td></tr>\r
-<?    } else {\r
+<?\r
+    } else {\r
         $query = 'SELECT `u`.id, `u`.`assurer`, SUM(`points`) FROM `users` AS `u`, `notary` AS `n` '.\r
                  '  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`';\r
index d6e298d..9047f27 100644 (file)
@@ -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;
     <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>
index e4fff21..a8b9413 100644 (file)
@@ -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 {
 
index 4eb7597..f937069 100644 (file)
@@ -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";
+       }
 ?>
index 7ce757d..faa8339 100644 (file)
@@ -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{