diff --git a/includes/account.php b/includes/account.php index f9ddb85..e180a0f 100644 --- a/includes/account.php +++ b/includes/account.php @@ -2041,6 +2041,24 @@ mysql_query("update `users` set `codesign`='$ver' where `id`='$memid'"); } + if($id == 43 && $_GET['ttpadmin'] > 0) + { + $memid = $_GET['userid'] = intval($_GET['ttpadmin']); + $query = "select * from `users` where `id`='$memid'"; + $row = mysql_fetch_assoc(mysql_query($query)); + $ver = !$row['ttpadmin']; + mysql_query("update `users` set `ttpadmin`='$ver' where `id`='$memid'"); + } + + if($id == 43 && $_GET['locadmin'] > 0) + { + $memid = $_GET['userid'] = intval($_GET['locadmin']); + $query = "select * from `users` where `id`='$memid'"; + $row = mysql_fetch_assoc(mysql_query($query)); + $ver = !$row['locadmin']; + mysql_query("update `users` set `locadmin`='$ver' where `id`='$memid'"); + } + if($id == 50) { if($_GET['userid'] != "") diff --git a/includes/account_stuff.php b/includes/account_stuff.php index 5f9c214..50e00ea 100644 --- a/includes/account_stuff.php +++ b/includes/account_stuff.php @@ -84,7 +84,8 @@ case 47: case 48: case 49: - case 50: $expand = " explode('sysadmin');"; break; + case 50: + case 53: $expand = " explode('sysadmin');"; break; case 500: case 501: case 502: @@ -210,10 +211,10 @@ function hideall() { - + \n
\n"; + } elseif(intval($_GET['regid']) <= 0) { + echo "\n\n\n\n\n
\n"; + } elseif(intval($_GET['locid']) <= 0) { + echo "\n\n\n\n\n
\n"; + $rc = mysql_num_rows(mysql_query("select * from `locations` where `regid`='".$_GET['regid']."'")); + if($start > 0) + { + $prev = $start - $limit; + if($prev < 0) + $prev = 0; + + $st = "[ << Start ] "; + $prev = "[ < Previous $limit ] "; + } + if($start < $rc - $limit) + { + $next = $start + $limit; + $last = $rc - $limit; + + $next = "[ Next $limit > ] "; + $end = "[ End >> ]"; + } + echo "
$st
$end
\n"; + echo "
$prev
$next
\n"; +?> +
+
+ + + + + + + + + + + +
:
">
+ + +
+
+ diff --git a/scripts/clientcerts.php b/scripts/clientcerts.php index 598cd38..c8c33f9 100755 --- a/scripts/clientcerts.php +++ b/scripts/clientcerts.php @@ -43,9 +43,9 @@ $opensslcnf = "/etc/ssl/class3-client-codesign.cnf"; $days = 365; -//echo "echo \"/usr/bin/openssl ca -config $opensslcnf -spkac $row[csr_name] -out $row[crt_name].der -days $days -key test -batch\"\n"; - $do = `echo "/usr/bin/openssl ca -config $opensslcnf -spkac $row[csr_name] -out $row[crt_name].der -days $days -key test -batch" > /tmp/test`; - $do = `/usr/bin/openssl ca -config $opensslcnf -spkac $row[csr_name] -out $row[crt_name].der -days $days -key test -batch > /dev/null 2>&1`; +//echo "echo \"/usr/bin/openssl ca -md $row[md] -config $opensslcnf -spkac $row[csr_name] -out $row[crt_name].der -days $days -key test -batch\"\n"; + $do = `echo "/usr/bin/openssl ca -md $row[md] -config $opensslcnf -spkac $row[csr_name] -out $row[crt_name].der -days $days -key test -batch" > /tmp/test`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -spkac $row[csr_name] -out $row[crt_name].der -days $days -key test -batch > /dev/null 2>&1`; $do = `/usr/bin/openssl x509 -inform DER -in $row[crt_name].der -outform PEM -out $row[crt_name] -text > /dev/null 2>&1`; $user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='$row[memid]'")); if($user['language'] != "") @@ -108,8 +108,8 @@ $opensslcnf = "/etc/ssl/class3-client-codesign.cnf"; $days = 365; -echo "/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$row[subject]'\n"; - $do = `/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$row[subject]' > /dev/null 2>&1`; +// echo "/usr/bin/openssl ca -md $row[md] -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$row[subject]'\n"; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$row[subject]' > /dev/null 2>&1`; $user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='$row[memid]'")); if($user['language'] != "") { @@ -168,8 +168,8 @@ echo "/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_n $revokecrl = "/www/www/revoke.crl"; } - $do = `/usr/bin/openssl ca -config $opensslcnf -key test -batch -revoke $row[crt_name] > /dev/null 2>&1`; - $do = `/usr/bin/openssl ca -config $opensslcnf -key test -batch -gencrl -crldays 7 -crlexts crl_ext -out /tmp/cacert-revoke.crl > /dev/null 2>&1`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -key test -batch -revoke $row[crt_name] > /dev/null 2>&1`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -key test -batch -gencrl -crldays 7 -crlexts crl_ext -out /tmp/cacert-revoke.crl > /dev/null 2>&1`; $do = `/usr/bin/openssl crl -in /tmp/cacert-revoke.crl -outform DER -out $revokecrl > /dev/null 2>&1`; $user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='$row[memid]'")); if($user['language'] != "") @@ -205,9 +205,9 @@ echo "/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_n else if($row['codesign'] != 0 && $row['rootcert'] == 2) $opensslcnf = "/etc/ssl/class3-client-codesign.cnf"; $days = 365; -// echo "/usr/bin/openssl ca -config $opensslcnf -spkac $row[csr_name] -out $row[crt_name].der -days $days -key test -batch\n"; +// echo "/usr/bin/openssl ca -md $row[md] -config $opensslcnf -spkac $row[csr_name] -out $row[crt_name].der -days $days -key test -batch\n"; // echo "/usr/bin/openssl x509 -inform DER -in $row[crt_name].der -outform PEM -out $row[crt_name] -text\n";die; - $do = `/usr/bin/openssl ca -config $opensslcnf -spkac $row[csr_name] -out $row[crt_name].der -days $days -key test -batch > /dev/null 2>&1`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -spkac $row[csr_name] -out $row[crt_name].der -days $days -key test -batch > /dev/null 2>&1`; $do = `/usr/bin/openssl x509 -inform DER -in $row[crt_name].der -outform PEM -out $row[crt_name] -text > /dev/null 2>&1`; if(filesize($row[crt_name]) > 0) { @@ -255,7 +255,7 @@ echo "/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_n $opensslcnf = "/etc/ssl/class3-client-codesign.cnf"; $days = 365; - $do = `/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$row[subject]' > /dev/null 2>&1`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$row[subject]' > /dev/null 2>&1`; if(filesize($row[crt_name]) > 0) { $end = trim(`/usr/bin/openssl x509 -in $row[crt_name] -noout -enddate`); @@ -299,8 +299,8 @@ echo "/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_n $revokecrl = "/www/www/revoke.crl"; } - $do = `/usr/bin/openssl ca -config $opensslcnf -key test -batch -revoke $row[crt_name] > /dev/null 2>&1`; - $do = `/usr/bin/openssl ca -config $opensslcnf -key test -batch -gencrl -crldays 7 -crlexts crl_ext -out /tmp/cacert-revoke.crl > /dev/null 2>&1`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -key test -batch -revoke $row[crt_name] > /dev/null 2>&1`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -key test -batch -gencrl -crldays 7 -crlexts crl_ext -out /tmp/cacert-revoke.crl > /dev/null 2>&1`; $do = `/usr/bin/openssl crl -in /tmp/cacert-revoke.crl -outform DER -out $revokecrl > /dev/null 2>&1`; $user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='$row[memid]'")); if($user['language'] != "") diff --git a/scripts/servercerts.php b/scripts/servercerts.php index 71184cc..6e85fed 100755 --- a/scripts/servercerts.php +++ b/scripts/servercerts.php @@ -88,9 +88,9 @@ else $opensslcnf = "/etc/ssl/openssl-server.cnf"; - $do = `echo "/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$newsubject' -extfile '$tmpname'" >> /tmp/openssl.tmp`; - $do = `/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$newsubject' -extfile '$tmpname' 2>&1`; -// unlink($tmpname); + $do = `echo "/usr/bin/openssl ca -md $row[md] -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$newsubject' -extfile '$tmpname'" >> /tmp/openssl.tmp`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$newsubject' -extfile '$tmpname' 2>&1`; + unlink($tmpname); $dom = mysql_fetch_assoc(mysql_query("select * from `domains` where `id`='$row[domid]'")); $user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='$dom[memid]'")); if(filesize($row['crt_name']) > 0 && intval($user['id']) > 0) @@ -138,8 +138,8 @@ else $opensslcnf = "/etc/ssl/openssl-server.cnf"; - $do = `/usr/bin/openssl ca -config $opensslcnf -key test -batch -revoke $row[crt_name] > /dev/null 2>&1`; - $do = `/usr/bin/openssl ca -config $opensslcnf -key test -batch -gencrl -crldays 7 -crlexts crl_ext -out /tmp/cacert-revoke.crl > /dev/null 2>&1`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -key test -batch -revoke $row[crt_name] > /dev/null 2>&1`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -key test -batch -gencrl -crldays 7 -crlexts crl_ext -out /tmp/cacert-revoke.crl > /dev/null 2>&1`; $do = `/usr/bin/openssl crl -in /tmp/cacert-revoke.crl -outform DER -out ../www/revoke.crl > /dev/null 2>&1`; $dom = mysql_fetch_assoc(mysql_query("select * from `domains` where `id`='".$row['domid']."'")); $user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$dom['memid']."'")); @@ -196,8 +196,8 @@ else $opensslcnf = "/etc/ssl/openssl-server.cnf"; - $do = `echo "/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$newsubject' -extfile '$tmpname'" >> /tmp/openssl.tmp`; - $do = `/usr/bin/openssl ca -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$newsubject' -extfile '$tmpname' > /dev/null 2>&1`; + $do = `echo "/usr/bin/openssl ca -md $row[md] -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$newsubject' -extfile '$tmpname'" >> /tmp/openssl.tmp`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -in $row[csr_name] -out $row[crt_name] -days $days -key test -batch -subj '$newsubject' -extfile '$tmpname' > /dev/null 2>&1`; unlink($tmpname); if(filesize($row['crt_name']) > 0) { @@ -239,8 +239,8 @@ else $opensslcnf = "/etc/ssl/openssl-server.cnf"; - $do = `/usr/bin/openssl ca -config $opensslcnf -key test -batch -revoke $row[crt_name] > /dev/null 2>&1`; - $do = `/usr/bin/openssl ca -config $opensslcnf -key test -batch -gencrl -crldays 7 -crlexts crl_ext -out /tmp/cacert-revoke.crl > /dev/null 2>&1`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -key test -batch -revoke $row[crt_name] > /dev/null 2>&1`; + $do = `/usr/bin/openssl ca -md $row[md] -config $opensslcnf -key test -batch -gencrl -crldays 7 -crlexts crl_ext -out /tmp/cacert-revoke.crl > /dev/null 2>&1`; $do = `/usr/bin/openssl crl -in /tmp/cacert-revoke.crl -outform DER -out ../www/revoke.crl > /dev/null 2>&1`; mysql_query("update `orgdomaincerts` set `revoked`=FROM_UNIXTIME(UNIX_TIMESTAMP()) where `id`='$row[id]'"); } diff --git a/www/api/ccsr.php b/www/api/ccsr.php index 6d3bf65..6bbbfbe 100644 --- a/www/api/ccsr.php +++ b/www/api/ccsr.php @@ -1,6 +1,6 @@ = 50) { - if($_POST['name'] == $user['fname']." ".$user['lname'] || - $_POST['name'] == $user['fname']." ".$user['mname']." ".$user['lname'] || - $_POST['name'] == $user['fname']." ".$user['lname']." ".$user['suffix'] || - $_POST['name'] == $user['fname']." ".$user['mname']." ".$user['lname']." ".$user['suffix']) - $name = $_POST['name']; + if($_REQUEST['name'] == $user['fname']." ".$user['lname'] || + $_REQUEST['name'] == $user['fname']." ".$user['mname']." ".$user['lname'] || + $_REQUEST['name'] == $user['fname']." ".$user['lname']." ".$user['suffix'] || + $_REQUEST['name'] == $user['fname']." ".$user['mname']." ".$user['lname']." ".$user['suffix']) + $name = $_REQUEST['name']; } $codesign = 0; - if($user['codesign'] == "1" && $_POST['codesign'] == "1" && $points >= 100) + if($user['codesign'] == "1" && $_REQUEST['codesign'] == "1" && $points >= 100) $codesign = 1; - $CSR = trim($_POST['optionalCSR']); + $CSR = trim($_REQUEST['optionalCSR']); $tmpname = tempnam("/tmp", "CSR"); $tempnam = tempnam("/tmp", "CSR"); $fp = fopen($tmpname, "w"); diff --git a/www/api/cemails.php b/www/api/cemails.php index 4ab94af..6ee2662 100644 --- a/www/api/cemails.php +++ b/www/api/cemails.php @@ -1,6 +1,6 @@