diff options
author | Michael Tänzer <neo@nhng.de> | 2011-11-20 01:24:59 +0100 |
---|---|---|
committer | Michael Tänzer <neo@nhng.de> | 2011-11-20 01:24:59 +0100 |
commit | aee572b3fe878450371ae5696d40b98390ebe493 (patch) | |
tree | af157107323d0f08a64c816ff278ed51aa825538 /includes | |
parent | 8d0069784d4ff49ee5a73b5aa808cf9899e40f85 (diff) | |
download | cacert-aee572b3fe878450371ae5696d40b98390ebe493.tar.gz cacert-aee572b3fe878450371ae5696d40b98390ebe493.tar.xz cacert-aee572b3fe878450371ae5696d40b98390ebe493.zip |
Source code taken from cacert-20111116.tar.bz2
Diffstat (limited to 'includes')
-rw-r--r-- | includes/account.php | 8 | ||||
-rw-r--r-- | includes/general.php | 11 | ||||
-rw-r--r-- | includes/notary.inc.php | 20 | ||||
-rw-r--r-- | includes/wot.inc.php | 24 |
4 files changed, 41 insertions, 22 deletions
diff --git a/includes/account.php b/includes/account.php index 24c61d8..55c9f7a 100644 --- a/includes/account.php +++ b/includes/account.php @@ -35,6 +35,12 @@ exit; } + if ($process == _("Cancel")) + { + // General reset CANCEL process requests + $process = ""; + } + if($id == 45 || $id == 46 || $oldid == 45 || $oldid == 46) { @@ -2198,7 +2204,7 @@ $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); diff --git a/includes/general.php b/includes/general.php index ebdf20e..8481018 100644 --- a/includes/general.php +++ b/includes/general.php @@ -919,10 +919,13 @@ 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; } diff --git a/includes/notary.inc.php b/includes/notary.inc.php index 95cd889..cc0e0eb 100644 --- a/includes/notary.inc.php +++ b/includes/notary.inc.php @@ -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); } @@ -106,7 +106,8 @@ function calc_experience ($row,&$points,&$experience,&$sum_experience,&$revoked) { - $points += $row['awarded']; + $apoints = max($row['points'],$row['awarded']); + $points += $apoints; $experience = " "; $revoked = false; # to be coded later (after DB-upgrade) if ($row['method'] == "Face to Face Meeting") @@ -114,7 +115,7 @@ $sum_experience = $sum_experience +2; $experience = "2"; } - return $row['awarded']; + return $apoints; } function calc_assurances ($row,&$points,&$experience,&$sumexperience,&$awarded,&$revoked) @@ -284,9 +285,12 @@ { 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>"; + } } } ?> @@ -371,10 +375,10 @@ 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); } } diff --git a/includes/wot.inc.php b/includes/wot.inc.php index 9cc100d..884b97f 100644 --- a/includes/wot.inc.php +++ b/includes/wot.inc.php @@ -106,14 +106,17 @@ function calc_experience ($row,&$points,&$experience,&$sum_experience) { - $points += $row['awarded']; + $apoints = max($row['points'], $row['awarded']); + + $points += $apoints; + $experience = " "; 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) @@ -228,7 +231,7 @@ <? } - 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=""; @@ -239,9 +242,12 @@ { 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>"; + } } } @@ -305,9 +311,9 @@ 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); } } @@ -323,7 +329,7 @@ $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); } } |