Source code taken from cacert-20111116.tar.bz2
authorMichael Tänzer <neo@nhng.de>
Sun, 20 Nov 2011 00:24:59 +0000 (01:24 +0100)
committerMichael Tänzer <neo@nhng.de>
Sun, 20 Nov 2011 00:24:59 +0000 (01:24 +0100)
includes/account.php
includes/general.php
includes/notary.inc.php
includes/wot.inc.php
pages/account/16.php
pages/account/30.php
pages/account/31.php
pages/account/34.php

index 24c61d8..55c9f7a 100644 (file)
                exit;
        }
 
+       if ($process == _("Cancel"))
+       {
+               // General reset CANCEL process requests
+               $process = "";
+       }
+
 
        if($id == 45 || $id == 46 || $oldid == 45 || $oldid == 46)
        {
                $orgid = 0;
        }
 
-       if($oldid == 31 && $process != _("Cancel"))
+       if($oldid == 31 && $process != "")
        {
                $query = "select * from `orgdomains` where `orgid`='".intval($_SESSION['_config']['orgid'])."'";
                $dres = mysql_query($query);
index ebdf20e..8481018 100644 (file)
                if($newlayout)
                {
                        $name="../$type/$kind/".intval($id/1000)."/$kind-".intval($id).".$type";
-                       mkdir("../csr/$kind",0777);
-                       mkdir("../crt/$kind",0777);
-                       mkdir("../csr/$kind/".intval($id/1000));
-                       mkdir("../crt/$kind/".intval($id/1000));
+                       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)); }
+                       if (!is_dir("../crt/$kind/".intval($id/1000))) { mkdir("../crt/$kind/".intval($id/1000)); }
                }
                return $name;
        }
index 95cd889..cc0e0eb 100644 (file)
@@ -62,7 +62,7 @@
        {
                $res = query_init ("SELECT count(*) AS `list` FROM `notary`
                        WHERE `method` = 'Face to Face Meeting'
-                       GROUP BY .`to` HAVING count(*) > '".intval($no_of_assurees)."'");
+                       GROUP BY `to` HAVING count(*) > '".intval($no_of_assurees)."'");
                return intval(query_get_number_of_rows($res)+1);
        }
 
 
        function calc_experience ($row,&$points,&$experience,&$sum_experience,&$revoked)
        {
-               $points += $row['awarded'];
+                $apoints = max($row['points'],$row['awarded']);
+               $points += $apoints;
                $experience = "&nbsp;";
                $revoked = false;                               # to be coded later (after DB-upgrade)
                if ($row['method'] == "Face to Face Meeting")
                        $sum_experience = $sum_experience +2;
                        $experience = "2";
                }
-               return $row['awarded'];
+               return $apoints;
        }
 
        function calc_assurances ($row,&$points,&$experience,&$sumexperience,&$awarded,&$revoked)
        {
                if ($awarded == "0")
                {
-                       $tdstyle="style='background-color: #ffff80'";
-                       $emopen="<em>";
-                       $emclose="</em>";
+                       if ($when < "2006-09-01")
+                       {
+                               $tdstyle="style='background-color: #ffff80'";
+                               $emopen="<em>";
+                               $emclose="</em>";
+                       }
                }
        }
 ?>
                while($row = mysql_fetch_assoc($res))
                {
                        $fromuser = get_user (intval($row['to'])); 
-                       calc_experience ($row,$points,$experience,$sum_experience,$revoked);
+                       $apoints = calc_experience ($row,$points,$experience,$sum_experience,$revoked);
                        $name = show_user_link ($fromuser['fname']." ".$fromuser['lname'],intval($row['to']));
                        $email = show_email_link ($fromuser['email'],intval($row['to']));
-                       output_assurances_row (intval($row['id']),$row['date'],$row['when'],$email,$name,intval($row['awarded']),intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience,$userid,$support,$revoked);
+                       output_assurances_row (intval($row['id']),$row['date'],$row['when'],$email,$name,$apoints,intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience,$userid,$support,$revoked);
                }
        }
 
index 9cc100d..884b97f 100644 (file)
 
        function calc_experience ($row,&$points,&$experience,&$sum_experience)
        {
-               $points += $row['awarded'];
+               $apoints = max($row['points'], $row['awarded']);
+
+               $points += $apoints;
+
                $experience = "&nbsp;";
                if ($row['method'] == "Face to Face Meeting")
                {
                        $sum_experience = $sum_experience +2;
                        $experience = "2";
                }
-               return $row['awarded'];
+               return $apoints;
        }
 
        function calc_assurances ($row,&$points,&$experience,&$sumexperience,&$awarded)
 <?
        }
 
-       function output_assurances_row($assuranceid,$date,$name,$awarded,$points,$location,$method,$experience)
+       function output_assurances_row($assuranceid,$date,$when,$name,$awarded,$points,$location,$method,$experience)
        {
 
        $tdstyle="";
        {
                if ($awarded == "0")
                {
-                       $tdstyle="style='background-color: #ffff80'";
-                       $emopen="<em>";
-                       $emclose="</em>";
+                       if ($when < "2006-09-01")
+                       {
+                               $tdstyle="style='background-color: #ffff80'";
+                               $emopen="<em>";
+                               $emclose="</em>";
+                       }
                }
        }
 
                while($row = mysql_fetch_assoc($res))
                {
                        $fromuser = get_user (intval($row['to'])); 
-                       calc_experience ($row,$points,$experience,$sum_experience);
+                       $apoints = calc_experience ($row,$points,$experience,$sum_experience);
                        $name = show_user_link ($fromuser['fname']." ".$fromuser['lname'],intval($row['to']));
-                       output_assurances_row (intval($row['id']),$row['date'],$name,intval($row['awarded']),intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience);
+                       output_assurances_row (intval($row['id']),$row['date'],$row['when'],$name,$apoints,intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience);
                }
        }
 
                        $fromuser = get_user (intval($row['from']));
                        calc_assurances ($row,$points,$experience,$sum_experience,$awarded);
                        $name = show_user_link ($fromuser['fname']." ".$fromuser['lname'],intval($row['from']));
-                       output_assurances_row (intval($row['id']),$row['date'],$name,$awarded,intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience);
+                       output_assurances_row (intval($row['id']),$row['date'],$row['when'],$name,$awarded,intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience);
                }
        }
 
index 3e582e3..514ecfd 100644 (file)
@@ -57,7 +57,7 @@
   </tr>
 <? } ?>
   <tr>
-    <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Another Email")?>">
+    <td class="DataTD" colspan="2"><input type="submit" name="add_email" value="<?=_("Another Email")?>">
                        <input type="submit" name="process" value="<?=_("Next")?>"></td>
   </tr>
 </table>
index 30c86f3..33eeca8 100644 (file)
@@ -34,7 +34,7 @@
     <td class="DataTD" colspan="2"><? printf(_("Are you really sure you want to remove %s and all certificates issued under this domain?"), sanitizeHTML($row['domain'])); ?></td>
   </tr>
   <tr>
-    <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Cancel")?>">
+    <td class="DataTD" colspan="2"><input type="submit" name="cancel" value="<?=_("Cancel")?>">
                <input type="submit" name="process" value="<?=_("Delete")?>"></td>
   </tr>
 </table>
index d91a77a..9f3d27e 100644 (file)
@@ -29,7 +29,7 @@
     <td class="DataTD" colspan="2"><? printf(_("Are you really sure you want to remove %s and all certificates issued under this organisation?"), sanitizeHTML($org['O'])); ?></td>
   </tr>
   <tr>
-    <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Cancel")?>">
+    <td class="DataTD" colspan="2"><input type="submit" name="cancel" value="<?=_("Cancel")?>">
                <input type="submit" name="process" value="<?=_("Delete")?>"></td>
   </tr>
 </table>
index 25ad1db..b11bc7d 100644 (file)
@@ -35,7 +35,7 @@
     <td class="DataTD" colspan="2"><? printf(_("Are you really sure you want to remove %s from administering this organisation?"), sanitizeHTML($user['fname'])." ".sanitizeHTML($user['lname'])); ?></td>
   </tr>
   <tr>
-    <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Cancel")?>">
+    <td class="DataTD" colspan="2"><input type="submit" name="cancel" value="<?=_("Cancel")?>">
                <input type="submit" name="process" value="<?=_("Delete")?>"></td>
   </tr>
 </table>