bug 440: Trailing whitespace
authorMichael Tänzer <neo@nhng.de>
Wed, 6 Nov 2013 01:37:55 +0000 (02:37 +0100)
committerMichael Tänzer <neo@nhng.de>
Wed, 6 Nov 2013 01:37:55 +0000 (02:37 +0100)
Signed-off-by: Michael Tänzer <neo@nhng.de>
includes/account.php

index 9d48e73..c860263 100644 (file)
@@ -10,7 +10,7 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-  
+
     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
@@ -133,7 +133,7 @@ function buildSubjectFromSession() {
                if($checkemail != "OK")
                {
                        showheader(_("My CAcert.org Account!"));
-                       if (substr($checkemail, 0, 1) == "4") 
+                       if (substr($checkemail, 0, 1) == "4")
                        {
                                echo "<p>"._("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.")."</p>\n";
                        } else {
@@ -210,7 +210,7 @@ function buildSubjectFromSession() {
                                {
                                        $row = mysql_fetch_assoc($res);
                                        echo $row['email']."<br>\n";
-                                       $query = "select `emailcerts`.`id` 
+                                       $query = "select `emailcerts`.`id`
                                                        from `emaillink`,`emailcerts` where
                                                        `emailid`='$id' and `emaillink`.`emailcertsid`=`emailcerts`.`id` and
                                                        `revoked`=0 and UNIX_TIMESTAMP(`expire`)-UNIX_TIMESTAMP() > 0
@@ -367,7 +367,7 @@ function buildSubjectFromSession() {
                        }
 
                        $query = "insert into emailcerts set
-                                               `CN`='$defaultemail', 
+                                               `CN`='$defaultemail',
                                                `keytype`='NS',
                                                `memid`='".intval($_SESSION['profile']['id'])."',
                                                `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()),
@@ -465,8 +465,8 @@ function buildSubjectFromSession() {
                                showfooter();
                                exit;
                        }
-                       $query = "insert into emailcerts set 
-                                               `CN`='$defaultemail', 
+                       $query = "insert into emailcerts set
+                                               `CN`='$defaultemail',
                                                `keytype`='".sanitizeHTML($_REQUEST['keytype'])."',
                                                `memid`='".$_SESSION['profile']['id']."',
                                                `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()),
@@ -624,7 +624,7 @@ function buildSubjectFromSession() {
                {
                        showheader(_("My CAcert.org Account!"));
                        //echo "<p>"._("Email Address given was invalid, or a test connection couldn't be made to your server, or the server rejected the email address as invalid")."</p>\n";
-                       if (substr($checkemail, 0, 1) == "4") 
+                       if (substr($checkemail, 0, 1) == "4")
                        {
                                echo "<p>"._("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.")."</p>\n";
                        } else {
@@ -774,13 +774,13 @@ function buildSubjectFromSession() {
 
                if(array_key_exists('0',$_SESSION['_config']['rowid']) && $_SESSION['_config']['rowid']['0'] > 0)
                {
-                       $query = "insert into `domaincerts` set 
+                       $query = "insert into `domaincerts` set
                                                `CN`='".mysql_real_escape_string($_SESSION['_config']['rows']['0'])."',
                                                `domid`='".mysql_real_escape_string($_SESSION['_config']['rowid']['0'])."',
                                                `created`=NOW(),`subject`='".mysql_real_escape_string($subject)."',
                                                `rootcert`='".mysql_real_escape_string($_SESSION['_config']['rootcert'])."'";
                } elseif(array_key_exists('0',$_SESSION['_config']['altid']) && $_SESSION['_config']['altid']['0'] > 0) {
-                       $query = "insert into `domaincerts` set 
+                       $query = "insert into `domaincerts` set
                                                `CN`='".mysql_real_escape_string($_SESSION['_config']['altrows']['0'])."',
                                                `domid`='".mysql_real_escape_string($_SESSION['_config']['altid']['0'])."',
                                                `created`=NOW(),`subject`='".mysql_real_escape_string($subject)."',
@@ -856,13 +856,13 @@ function buildSubjectFromSession() {
                                }
 
                                mysql_query("update `domaincerts` set `renewed`='1' where `id`='$id'");
-                               $query = "insert into `domaincerts` set 
-                                               `domid`='".$row['domid']."', 
+                               $query = "insert into `domaincerts` set
+                                               `domid`='".$row['domid']."',
                                                `CN`='".mysql_real_escape_string($row['CN'])."',
                                                `subject`='".mysql_real_escape_string($row['subject'])."',".
                                                //`csr_name`='".$row['csr_name']."', // RACE CONDITION
                                                "`created`='".$row['created']."',
-                                               `modified`=NOW(), 
+                                               `modified`=NOW(),
                                                `rootcert`='".$row['rootcert']."',
                                                `type`='".$row['type']."',
                                                `pkhash`='".$row['pkhash']."'";
@@ -925,7 +925,7 @@ function buildSubjectFromSession() {
                        foreach($_REQUEST['revokeid'] as $id)
                        {
                                $id = intval($id);
-                               $query = "select *,UNIX_TIMESTAMP(`domaincerts`.`revoked`) as `revoke` from `domaincerts`,`domains` 
+                               $query = "select *,UNIX_TIMESTAMP(`domaincerts`.`revoked`) as `revoke` from `domaincerts`,`domains`
                                                where `domaincerts`.`id`='$id' and
                                                `domaincerts`.`domid`=`domains`.`id` and
                                                `domains`.`memid`='".$_SESSION['profile']['id']."'";
@@ -956,7 +956,7 @@ function buildSubjectFromSession() {
                        foreach($_REQUEST['delid'] as $id)
                        {
                                $id = intval($id);
-                               $query = "select *,UNIX_TIMESTAMP(`domaincerts`.`expire`) as `expired` from `domaincerts`,`domains` 
+                               $query = "select *,UNIX_TIMESTAMP(`domaincerts`.`expire`) as `expired` from `domaincerts`,`domains`
                                                where `domaincerts`.`id`='$id' and
                                                `domaincerts`.`domid`=`domains`.`id` and
                                                `domains`.`memid`='".$_SESSION['profile']['id']."'";
@@ -991,7 +991,7 @@ function buildSubjectFromSession() {
                        foreach($_REQUEST['revokeid'] as $id)
                        {
                                $id = intval($id);
-                               $query = "select *,UNIX_TIMESTAMP(`revoked`) as `revoke` from `emailcerts` 
+                               $query = "select *,UNIX_TIMESTAMP(`revoked`) as `revoke` from `emailcerts`
                                                where `id`='$id' and `memid`='".$_SESSION['profile']['id']."'";
                                $res = mysql_query($query);
                                if(mysql_num_rows($res) <= 0)
@@ -1010,13 +1010,13 @@ function buildSubjectFromSession() {
                                }
 
                                mysql_query("update `emailcerts` set `renewed`='1' where `id`='$id'");
-                               $query = "insert into emailcerts set 
-                                               `memid`='".$row['memid']."', 
+                               $query = "insert into emailcerts set
+                                               `memid`='".$row['memid']."',
                                                `CN`='".mysql_real_escape_string($row['CN'])."',
                                                `subject`='".mysql_real_escape_string($row['subject'])."',
-                                               `keytype`='".$row['keytype']."', 
-                                               `csr_name`='".$row['csr_name']."', 
-                                               `created`='".$row['created']."', 
+                                               `keytype`='".$row['keytype']."',
+                                               `csr_name`='".$row['csr_name']."',
+                                               `created`='".$row['created']."',
                                                `modified`=NOW(),
                                                `disablelogin`='".$row['disablelogin']."',
                                                `codesign`='".$row['codesign']."',
@@ -1064,7 +1064,7 @@ function buildSubjectFromSession() {
                        foreach($_REQUEST['revokeid'] as $id)
                        {
                                $id = intval($id);
-                               $query = "select *,UNIX_TIMESTAMP(`revoked`) as `revoke` from `emailcerts` 
+                               $query = "select *,UNIX_TIMESTAMP(`revoked`) as `revoke` from `emailcerts`
                                                where `id`='$id' and `memid`='".$_SESSION['profile']['id']."'";
                                $res = mysql_query($query);
                                if(mysql_num_rows($res) <= 0)
@@ -1093,7 +1093,7 @@ function buildSubjectFromSession() {
                        foreach($_REQUEST['delid'] as $id)
                        {
                                $id = intval($id);
-                               $query = "select *,UNIX_TIMESTAMP(`expire`) as `expired` from `emailcerts` 
+                               $query = "select *,UNIX_TIMESTAMP(`expire`) as `expired` from `emailcerts`
                                                where `id`='$id' and `memid`='".$_SESSION['profile']['id']."'";
                                $res = mysql_query($query);
                                if(mysql_num_rows($res) <= 0)
@@ -1260,7 +1260,7 @@ function buildSubjectFromSession() {
                                                where `id`='".$_SESSION['profile']['id']."'";
                mysql_query($query);
 
-               //!!!Should be rewritten 
+               //!!!Should be rewritten
                $_SESSION['_config']['user']['otphash'] = trim(mysql_real_escape_string(stripslashes(strip_tags($_REQUEST['otphash']))));
                $_SESSION['_config']['user']['otppin'] = trim(mysql_real_escape_string(stripslashes(strip_tags($_REQUEST['otppin']))));
                if($_SESSION['_config']['user']['otphash'] != "" && $_SESSION['_config']['user']['otppin'] != "")
@@ -1457,8 +1457,8 @@ function buildSubjectFromSession() {
                                exit;
                        }
 
-                       $query = "insert into `orgemailcerts` set 
-                                               `CN`='$defaultemail', 
+                       $query = "insert into `orgemailcerts` set
+                                               `CN`='$defaultemail',
                                                `keytype`='NS',
                                                `orgid`='".$org['orgid']."',
                                                `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()),
@@ -1546,8 +1546,8 @@ function buildSubjectFromSession() {
                        if($_SESSION['_config']['rootcert'] < 1 || $_SESSION['_config']['rootcert'] > 2)
                                $_SESSION['_config']['rootcert'] = 1;
 
-                       $query = "insert into `orgemailcerts` set 
-                                               `CN`='$defaultemail', 
+                       $query = "insert into `orgemailcerts` set
+                                               `CN`='$defaultemail',
                                                `keytype`='" . sanitizeHTML($_REQUEST['keytype']) . "',
                                                `orgid`='".$org['orgid']."',
                                                `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()),
@@ -1619,13 +1619,13 @@ function buildSubjectFromSession() {
                                        printf(_("It would seem '%s' has already been revoked. I'll skip this for now.")."<br>\n", $row['CN']);
                                        continue;
                                }
-                               $query = "insert into `orgemailcerts` set 
-                                               `orgid`='".$row['orgid']."', 
+                               $query = "insert into `orgemailcerts` set
+                                               `orgid`='".$row['orgid']."',
                                                `CN`='".$row['CN']."',
                                                `subject`='".$row['subject']."',
-                                               `keytype`='".$row['keytype']."', 
-                                               `csr_name`='".$row['csr_name']."', 
-                                               `created`='".$row['created']."', 
+                                               `keytype`='".$row['keytype']."',
+                                               `csr_name`='".$row['csr_name']."',
+                                               `created`='".$row['created']."',
                                                `modified`=NOW(),
                                                `codesign`='".$row['codesign']."',
                                                `rootcert`='".$row['rootcert']."'";
@@ -1845,7 +1845,7 @@ function buildSubjectFromSession() {
 
                 if($_SESSION['_config']['rowid']['0'] > 0)
                 {
-                        $query = "insert into `orgdomaincerts` set 
+                        $query = "insert into `orgdomaincerts` set
                                                `CN`='".$_SESSION['_config']['rows']['0']."',
                                                `orgid`='".$org['id']."',
                                                 `created`=NOW(),
@@ -1853,7 +1853,7 @@ function buildSubjectFromSession() {
                                                `rootcert`='".$_SESSION['_config']['rootcert']."',
                                                `type`='$type'";
                 } else {
-                        $query = "insert into `orgdomaincerts` set 
+                        $query = "insert into `orgdomaincerts` set
                                                `CN`='".$_SESSION['_config']['altrows']['0']."',
                                                `orgid`='".$org['id']."',
                                                 `created`=NOW(),
@@ -1927,13 +1927,13 @@ function buildSubjectFromSession() {
                                        printf(_("It would seem '%s' has already been revoked. I'll skip this for now.")."<br>\n", $row['CN']);
                                        continue;
                                }
-                               $query = "insert into `orgdomaincerts` set 
-                                               `orgid`='".$row['orgid']."', 
+                               $query = "insert into `orgdomaincerts` set
+                                               `orgid`='".$row['orgid']."',
                                                `CN`='".$row['CN']."',
-                                               `csr_name`='".$row['csr_name']."', 
+                                               `csr_name`='".$row['csr_name']."',
                                                `created`='".$row['created']."',
-                                               `modified`=NOW(), 
-                                               `subject`='".$row['subject']."', 
+                                               `modified`=NOW(),
+                                               `subject`='".$row['subject']."',
                                                `type`='".$row['type']."',
                                                `rootcert`='".$row['rootcert']."'";
                                mysql_query($query);
@@ -2147,7 +2147,7 @@ function buildSubjectFromSession() {
 
        if(($oldid == 29 || $oldid == 30) && $process != _("Cancel"))
        {
-               $query = "select `orgdomaincerts`.`id` as `id` from `orgdomlink`, `orgdomaincerts`, `orgdomains` where 
+               $query = "select `orgdomaincerts`.`id` as `id` from `orgdomlink`, `orgdomaincerts`, `orgdomains` where
                                `orgdomlink`.`orgdomid`=`orgdomains`.`id` and
                                `orgdomaincerts`.`id`=`orgdomlink`.`orgcertid` and
                                `orgdomains`.`id`='".intval($_SESSION['_config']['domid'])."'";
@@ -2155,7 +2155,7 @@ function buildSubjectFromSession() {
                while($row = mysql_fetch_assoc($res))
                        mysql_query("update `orgdomaincerts` set `revoked`='1970-01-01 10:00:01' where `id`='".$row['id']."'");
 
-               $query = "select `orgemailcerts`.`id` as `id` from `orgemailcerts`, `orgemaillink`, `orgdomains` where 
+               $query = "select `orgemailcerts`.`id` as `id` from `orgemailcerts`, `orgemaillink`, `orgdomains` where
                                `orgemaillink`.`domid`=`orgdomains`.`id` and
                                `orgemailcerts`.`id`=`orgemaillink`.`emailcertsid` and
                                `orgdomains`.`id`='".intval($_SESSION['_config']['domid'])."'";
@@ -2199,7 +2199,7 @@ function buildSubjectFromSession() {
                $dres = mysql_query($query);
                while($drow = mysql_fetch_assoc($dres))
                {
-                       $query = "select `orgdomaincerts`.`id` as `id` from `orgdomlink`, `orgdomaincerts`, `orgdomains` where 
+                       $query = "select `orgdomaincerts`.`id` as `id` from `orgdomlink`, `orgdomaincerts`, `orgdomains` where
                                        `orgdomlink`.`orgdomid`=`orgdomains`.`id` and
                                        `orgdomaincerts`.`id`=`orgdomlink`.`orgcertid` and
                                        `orgdomains`.`id`='".intval($drow['id'])."'";
@@ -2211,7 +2211,7 @@ function buildSubjectFromSession() {
                                mysql_query("delete from `orgdomlink` where `domid`='".intval($row['id'])."'");
                        }
 
-                       $query = "select `orgemailcerts`.`id` as `id` from `orgemailcerts`, `orgemaillink`, `orgdomains` where 
+                       $query = "select `orgemailcerts`.`id` as `id` from `orgemailcerts`, `orgemaillink`, `orgdomains` where
                                        `orgemaillink`.`domid`=`orgdomains`.`id` and
                                        `orgemailcerts`.`id`=`orgemaillink`.`emailcertsid` and
                                        `orgdomains`.`id`='".intval($drow['id'])."'";
@@ -2401,7 +2401,7 @@ function buildSubjectFromSession() {
                exit;
        }
 
-       if($oldid == 54 || ($id == 53 && array_key_exists('action',$_REQUEST) && $_REQUEST['action'] != "") || 
+       if($oldid == 54 || ($id == 53 && array_key_exists('action',$_REQUEST) && $_REQUEST['action'] != "") ||
                     ($id == 54 && array_key_exists('action',$_REQUEST) && $_REQUEST['action'] != "" &&
                        $_REQUEST['action'] != "aliases" && $_REQUEST['action'] != "edit" && $_REQUEST['action'] != "add"))
        {
@@ -2626,7 +2626,7 @@ function buildSubjectFromSession() {
                        exit;
                }
 
-               $query = "insert into `domaincerts` set 
+               $query = "insert into `domaincerts` set
                                                `CN`='".$_SESSION['_config']['0.CN']."',
                                                `domid`='".$_SESSION['_config']['row']['id']."',
                                                `created`=NOW()";
@@ -2690,7 +2690,7 @@ function buildSubjectFromSession() {
 
        if($id == 43 && array_key_exists('locked',$_REQUEST) && $_REQUEST['locked'] > 0)
        {
-               csrf_check('admactlock');       
+               csrf_check('admactlock');
                $memid = $_REQUEST['userid'] = intval($_REQUEST['locked']);
                $query = "select * from `users` where `id`='$memid'";
                $row = mysql_fetch_assoc(mysql_query($query));