public function Delete()
{
// Remove User
$revised_array = array();
foreach ($this->users as $user => $data) {
if ($data['username'] != $this->username) {
$revised_array[] = array("username" => $data['username'], "password" => $data['password'], "project" => $data['project']);
}
}
// Save array back to JSON
saveJSON('users.php', $revised_array);
// Remove any active files
foreach ($this->actives as $active => $data) {
if ($this->username == $data['username']) {
unset($this->actives[$active]);
}
}
saveJSON('active.php', $this->actives);
// Remove access control list (if exists)
if (file_exists(BASE_PATH . "/data/" . $this->username . '_acl.php')) {
unlink(BASE_PATH . "/data/" . $this->username . '_acl.php');
}
// Response
echo formatJSEND("success", null);
}