Move the function remove_team from list_users.php to Team.class

Revoke certificates after drop all teams
This commit is contained in:
Li Chen 2013-12-01 19:40:47 +01:00
commit 31eabf84b4
4 changed files with 43 additions and 18 deletions

View file

@ -31,6 +31,13 @@ function new_client($name, $misc_dir)
return $output;
}
function revoke_client($name, $misc_dir)
{
putenv("OPENSSL_CONF=$misc_dir/openssl.cnf");
putenv("TOP_DIR=$misc_dir/pki");
$output = shell_exec("$misc_dir/CA.sh -revoke $name");
}
if (!empty($p[2]))
{
if (isset($VAR['misc_dir']))
@ -60,11 +67,9 @@ if (!empty($p[2]))
$name = $_GET['name'];
if (isset($name))
{
putenv("OPENSSL_CONF=$misc_dir/openssl.cnf");
putenv("TOP_DIR=$misc_dir/pki");
$output = shell_exec("$misc_dir/CA.sh -revoke $name");
//TODO Check revocation failed
Team::set_revoked(TRUE, $name);
$output = revoke_client($name, $misc_dir);
//TODO Check revocation failed
Team::set_revoked(TRUE, $name);
}
}
// Is new team