bug 1221: Whitespace
authorBenny Baumann <BenBE@geshi.org>
Tue, 19 Nov 2013 21:56:28 +0000 (22:56 +0100)
committerBenny Baumann <BenBE@geshi.org>
Tue, 19 Nov 2013 22:24:09 +0000 (23:24 +0100)
includes/general.php
includes/lib/account.php
includes/lib/general.php
includes/loggedin.php
pages/account/52.php
pages/account/55.php
pages/wot/1.php
pages/wot/9.php
www/api/ccsr.php
www/index.php

index af5b63e..a504d65 100644 (file)
@@ -57,7 +57,7 @@
                exit;
        }
 
-       if(array_key_exists('HTTP_HOST',$_SERVER) && 
+       if(array_key_exists('HTTP_HOST',$_SERVER) &&
                        ($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] ||
                        $_SERVER['HTTP_HOST'] == $_SESSION['_config']['tverify']))
        {
                        $points++;
 
                //echo "Points due to length and charset: $points<br/>";
-               
+
                // check for historical password proposal
                if ($pwd === "Fr3d Sm|7h") {
                        return 0;
                }
-               
+
                return $points;
        }
 
        function checkpw($pwd, $email, $fname, $mname, $lname, $suffix)
        {
                $points = checkpwlight($pwd);
-               
+
                if(@strstr(strtolower($pwd), strtolower($email)))
                        $points--;
 
        {
                $bits = explode(": ", $_SESSION['_config']['subject'], 2);
                $bits = str_replace(", ", "|", str_replace("/", "|", array_key_exists('1',$bits)?$bits['1']:""));
-               $bits = explode("|", $bits);    
+               $bits = explode("|", $bits);
 
                $_SESSION['_config']['cnc'] = $_SESSION['_config']['subaltc'] = 0;
                $_SESSION['_config']['OU'] = "";
                                $fp = @fsockopen($domain,25,$errno,$errstr,5);
                                if($fp)
                                {
-                               
+
                                        $line = fgets($fp, 4096);
                                         while(substr($line, 0, 4) == "220-")
                                                $line = fgets($fp, 4096);
                return $ticket;
        }
 
-       function sanitizeHTML($input) 
+       function sanitizeHTML($input)
        {
                return htmlentities(strip_tags($input), ENT_QUOTES);
                //In case of problems, please use the following line again:
                $text=preg_replace("/[^\w-.@]/","",$text);
                return($text);
        }
-       
+
 
        // returns text message to be shown to the user given the result of is_no_assurer
        function no_assurer_text($Status)
                        $name="../$type/$kind/".intval($id/1000)."/$kind-".intval($id).".$type";
                        if (!is_dir("../csr")) { mkdir("../csr",0777); }
                        if (!is_dir("../crt")) { mkdir("../crt",0777); }
-                       
+
                        if (!is_dir("../csr/$kind")) { mkdir("../csr/$kind",0777); }
                        if (!is_dir("../crt/$kind")) { mkdir("../crt/$kind",0777); }
                        if (!is_dir("../csr/$kind/".intval($id/1000))) { mkdir("../csr/$kind/".intval($id/1000)); }
index 46bbcee..de25b62 100644 (file)
 
 /**
  * Function to recalculate the cached Assurer status
- * 
+ *
  * @param int $userID
  *     if the user ID is not given the flag will be recalculated for all users
- * 
+ *
  * @return bool
  *     false if there was an error on fixing the flag. This does NOT return the
  *     new value of the flag
@@ -30,7 +30,7 @@
 function fix_assurer_flag($userID = NULL)
 {
        // Update Assurer-Flag on users table if 100 points and CATS passed.
-       // 
+       //
        // We may have some performance issues here if no userID is given
        // there are ~150k assurances and ~220k users currently
        // but the exists-clause on cats_passed should be a good filter
@@ -46,20 +46,20 @@ function fix_assurer_flag($userID = NULL)
                                WHERE `cp`.`variant_id` = `cv`.`id`
                                        AND `cv`.`type_id` = 1
                                        AND `cp`.`user_id` = `u`.`id`
-                       ) 
+                       )
                        AND (
                                SELECT SUM(`points`) FROM `notary` AS `n`
                                WHERE `n`.`to` = `u`.`id`
                                        AND (`n`.`expire` > now()
                                        OR `n`.`expire` IS NULL) and `n`.`deleted` = 0
                        ) >= 100';
-       
+
        $query = mysql_query($sql);
        if (!$query) {
                return false;
        }
        // Challenge has been passed and non-expired points >= 100
-       
+
        // Reset flag if requirements are not met
        //
        // Also a bit performance critical but assurer flag is only set on
@@ -88,11 +88,11 @@ function fix_assurer_flag($userID = NULL)
                                                ) and `n`.`deleted` = 0
                                ) < 100
                        )';
-       
+
        $query = mysql_query($sql);
        if (!$query) {
                return false;
        }
-       
+
        return true;
 }
\ No newline at end of file
index cb73c51..127c6b7 100644 (file)
 
 /**
  * Checks if the user may log in and retrieve the user id
- * 
+ *
  * Usually called with $_SERVER['SSL_CLIENT_M_SERIAL'] and
  *     $_SERVER['SSL_CLIENT_I_DN_CN']
- * 
+ *
  * @param $serial string
  *     usually $_SERVER['SSL_CLIENT_M_SERIAL']
  * @param $issuer_cn string
@@ -43,7 +43,7 @@ function get_user_id_from_cert($serial, $issuer_cn)
                $row = mysql_fetch_assoc($res);
                return intval($row['memid']);
        }
-       
+
        return -1;
 }
 
@@ -71,7 +71,7 @@ function failWithId($errormessage) {
 
 /**
  * Runs a command on the shell and return it's exit code and output
- * 
+ *
  * @param string $command
  *             The command to run. Make sure that you escapeshellarg() any non-constant
  *             parts as this is executed on a shell!
@@ -85,7 +85,7 @@ function failWithId($errormessage) {
  * @param string|bool $errors
  *             The output the command wrote to STDERR (this is passed as reference),
  *             if true (default) the output will be written to the real STDERR
- * 
+ *
  * @return int|bool
  *             The exit code of the command, true if the execution of the command
  *             failed (true because then
@@ -93,38 +93,38 @@ function failWithId($errormessage) {
  */
 function runCommand($command, $input = "", &$output = null, &$errors = true) {
        $descriptorspec = array();
-       
+
        if ($input !== true) {
                $descriptorspec[0] = array("pipe", "r"); // STDIN for child
        }
-       
+
        if ($output !== true) {
                $descriptorspec[1] = array("pipe", "w"); // STDOUT for child
        }
-       
+
        if ($errors !== true) {
                $descriptorspec[2] = array("pipe", "w"); // STDERR for child
        }
-       
+
        $proc = proc_open($command, $descriptorspec, $pipes);
-       
+
        if (is_resource($proc))
        {
                if ($input !== true) {
                        fwrite($pipes[0], $input);
                        fclose($pipes[0]);
                }
-               
+
                if ($output !== true) {
                        $output = stream_get_contents($pipes[1]);
                }
-               
+
                if ($errors !== true) {
                        $errors = stream_get_contents($pipes[2]);
                }
-               
+
                return proc_close($proc);
-               
+
        } else {
                return true;
        }
@@ -145,19 +145,18 @@ function runCommand($command, $input = "", &$output = null, &$errors = true) {
                {
                        $Result |= 5;
                }
-               
+
                $query = mysql_query('SELECT SUM(`points`) AS `points` FROM `notary` AS `n` WHERE `n`.`to` = \''.(int)intval($userID).'\' AND `n`.`expire` < now() and `deleted` = 0');
                $row = mysql_fetch_assoc($query);
                if ($row['points'] < 100) {
                        $Result |= 3;
                }
-               
+
                $query = mysql_query('SELECT `assurer_blocked` FROM `users` WHERE `id` = \''.(int)intval($userID).'\'');
                $row = mysql_fetch_assoc($query);
                if ($row['assurer_blocked'] > 0) {
                        $Result |= 9;
                }
-               
+
                return $Result;
        }
-       
\ No newline at end of file
index de61ee1..46f0659 100644 (file)
@@ -49,7 +49,7 @@
                else
                        unset($_SESSION['profile']);
        }
-  
+
        if($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] && ($_SESSION['profile']['id'] == 0 || $_SESSION['profile']['loggedin'] == 0))
        {
                $user_id = get_user_id_from_cert($_SERVER['SSL_CLIENT_M_SERIAL'],
index 73a8bae..ce2025f 100644 (file)
@@ -65,7 +65,7 @@
 <input type="hidden" name="oldid" value="<?=intval($_GET['id'])?>">
 <input type="hidden" name="uid" value="<?=$uid?>">
 </form>
-<? } else { 
+<? } else {
        $query = "select * from `tverify` where `id`='$uid' and `modified`=1";
        $res = mysql_query($query);
        if(mysql_num_rows($res) > 0)
@@ -74,7 +74,7 @@
        } 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);
                echo "<br/>"._("The following requests are still open:")."<br/><ul>";
                while($row = mysql_fetch_assoc($res))
                {
-                       $uid=intval($row['id']);        
+                       $uid=intval($row['id']);
                        $query3 = "select * from `tverify-vote` where `tverify`='$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
index 402b7a8..0358504 100644 (file)
@@ -23,7 +23,7 @@
   <tr>\r
     <td colspan="5" class="title"><?=_("Your passed Tests")?></td>\r
   </tr>\r
-  <tr> \r
+  <tr>
     <td class="DataTD"><?=_("The list of tests you did pass at").' <a href="https://cats.cacert.org/">https://cats.cacert.org/</a>'?></td>\r
   </tr>\r
 </table>\r
@@ -60,9 +60,9 @@
                  " FROM `cats_passed` AS CP, `cats_variant` AS CV, `cats_type` AS CT ".\r
                  " WHERE `CP`.`variant_id`=`CV`.`id` AND `CV`.`type_id`=`CT`.`id` AND `CP`.`user_id` ='".(int)$user_id."'".\r
                  " ORDER BY `CP`.`pass_date`";\r
-                 \r
+
         $res = mysql_query($query);\r
-        \r
+
         $HaveTest=0;\r
         while($row = mysql_fetch_array($res, MYSQL_NUM))\r
         {\r
     <td class="DataTD"><?=$row[1]?></td>\r
     <td class="DataTD"><?=$row[2]?></td>\r
   </tr>\r
-<?      } \r
+<?      }
 ?>\r
 </table>\r
 <br>\r
 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">\r
-  <tr> \r
+  <tr>
 <?\r
       if ($_SESSION['profile']['admin'] == 1 && array_key_exists('userid',$_REQUEST) && intval($_REQUEST['userid']) > 0) {\r
 ?>\r
index 9e5d0f5..99c2b9f 100644 (file)
     <td class="DataTD"><?=$row['assurer']?_("Yes"):("<font color=\"#ff0000\">"._("Not yet!")."</font>")?></td>
 
   </tr>
-<? } 
+<? }
         }
 ?>
 </table>
index 0d9b22d..b492ff6 100644 (file)
@@ -15,9 +15,9 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
-       
+
        require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
-       
+
 
        $res = mysql_query("select * from `users` where `id`='".intval($_REQUEST['userid'])."' and `listme`='1'");
        if(mysql_num_rows($res) <= 0)
index a0f36e2..aa33baa 100644 (file)
@@ -62,12 +62,12 @@ require_once '../../includes/lib/check_weak_key.php';
                $codesign = 1;
 
        $CSR = trim($_REQUEST['optionalCSR']);
-       
+
        if (($weakKey = checkWeakKeyCSR($CSR)) !== "")
        {
                die("403, $weakKey");
        }
-       
+
        $incsr = tempnam("/tmp", "ccsrIn");
        $checkedcsr = tempnam("/tmp", "ccsrOut");
        $fp = fopen($incsr, "w");
index d680f38..18dbed1 100644 (file)
@@ -125,7 +125,7 @@ require_once('../includes/lib/l10n.php');
                                showfooter();
                                exit;
                        }
-               }               
+               }
        }
 
        if($oldid == 5 && $process != "")
@@ -153,13 +153,13 @@ require_once('../includes/lib/l10n.php');
                include_once("../includes/lib/general.php");
                $user_id = get_user_id_from_cert($_SERVER['SSL_CLIENT_M_SERIAL'],
                                $_SERVER['SSL_CLIENT_I_DN_CN']);
-               
+
                if($user_id >= 0)
                {
                        $_SESSION['profile'] = mysql_fetch_assoc(mysql_query(
-                               "select * from `users` where 
+                               "select * from `users` where
                                `id`='$user_id' and `deleted`=0 and `locked`=0"));
-                       
+
                        if($_SESSION['profile']['id'] != 0)
                        {
                                $_SESSION['profile']['loggedin'] = 1;
@@ -499,7 +499,7 @@ require_once('../includes/lib/l10n.php');
                        if($checkemail != "OK")
                        {
                                $id = 1;
-                               if (substr($checkemail, 0, 1) == "4") 
+                               if (substr($checkemail, 0, 1) == "4")
                                {
                                        $_SESSION['_config']['errmsg'] .= _("The mail server responsible for your domain indicated a temporary failure. This may be due to anti-SPAM measures, such as greylisting. Please try again in a few minutes.");
                                } else {
@@ -566,9 +566,9 @@ require_once('../includes/lib/l10n.php');
                $subject = stripslashes($_REQUEST['subject']);
                $message = stripslashes($_REQUEST['message']);
                $secrethash = $_REQUEST['secrethash2'];
-               
+
                //check for spam via honeypot
-               if(!isset($_REQUEST['robotest']) || !empty($_REQUEST['robotest'])){ 
+               if(!isset($_REQUEST['robotest']) || !empty($_REQUEST['robotest'])){
                        echo _("Form could not be sent.");
                        showfooter();
                        exit;
@@ -641,7 +641,7 @@ require_once('../includes/lib/l10n.php');
                $newUrl = $protocol . '://wiki.cacert.org/FAQ/AboutUs';
                header('Location: '.$newUrl, true, 301); // 301 = Permanently Moved
        }
-       
+
        if ($id == 19)
        {
                $protocol = $_SERVER['HTTPS'] ? 'https' : 'http';
@@ -655,7 +655,7 @@ require_once('../includes/lib/l10n.php');
                $newUrl = $protocol . '://wiki.cacert.org/Board';
                header('Location: '.$newUrl, true, 301); // 301 = Permanently Moved
        }
-       
+
        showheader(_("Welcome to CAcert.org"));
        includeit($id);
        showfooter();