zmiany
This commit is contained in:
parent
bad138b96a
commit
4d640c526e
4
app.py
4
app.py
@ -233,6 +233,10 @@ def main():
|
||||
skipped_with_points += 1
|
||||
continue
|
||||
|
||||
if (user.get('post_count') or 0) > 0:
|
||||
# Pomijamy użytkownika, który dodał treści
|
||||
continue
|
||||
|
||||
# Pomijanie aktywnych "weteranów"
|
||||
created_year = datetime.datetime.fromtimestamp(user['created']).year if user.get('created') else None
|
||||
recent_login_threshold = now_ts - (args.recent_login_days * 86400)
|
||||
|
@ -1,28 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
if ($argc < 3) {
|
||||
echo "Usage: php delete_user.php <UID> <DRUPAL_PATH>\n";
|
||||
echo "❌ Użycie: php delete_user.php UID /sciezka/do/drupala\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$uid = (int) $argv[1];
|
||||
$drupal_path = rtrim($argv[2], '/');
|
||||
|
||||
if (!file_exists($drupal_path . '/includes/bootstrap.inc')) {
|
||||
echo "❌ Nie znaleziono bootstrap.inc w: $drupal_path\n";
|
||||
exit(1);
|
||||
}
|
||||
$drupal_path = $argv[2];
|
||||
|
||||
// Bootstrap Drupala
|
||||
define('DRUPAL_ROOT', $drupal_path);
|
||||
chdir(DRUPAL_ROOT);
|
||||
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
|
||||
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
|
||||
|
||||
if ($uid <= 0) {
|
||||
echo "❌ UID musi być większy niż 0.\n";
|
||||
exit(1);
|
||||
}
|
||||
// Załaduj użytkownika
|
||||
$account = user_load(array('uid' => $uid));
|
||||
|
||||
if ($account) {
|
||||
user_delete(array('uid' => $uid));
|
||||
echo "✅ Próba usunięcia użytkownika $uid.\n";
|
||||
?>
|
||||
echo "✅ Użytkownik $uid został usunięty.\n";
|
||||
} else {
|
||||
echo "⚠️ Użytkownik $uid nie istnieje.\n";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user