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
|
skipped_with_points += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if (user.get('post_count') or 0) > 0:
|
||||||
|
# Pomijamy użytkownika, który dodał treści
|
||||||
|
continue
|
||||||
|
|
||||||
# Pomijanie aktywnych "weteranów"
|
# Pomijanie aktywnych "weteranów"
|
||||||
created_year = datetime.datetime.fromtimestamp(user['created']).year if user.get('created') else None
|
created_year = datetime.datetime.fromtimestamp(user['created']).year if user.get('created') else None
|
||||||
recent_login_threshold = now_ts - (args.recent_login_days * 86400)
|
recent_login_threshold = now_ts - (args.recent_login_days * 86400)
|
||||||
|
@ -1,28 +1,26 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($argc < 3) {
|
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);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$uid = (int) $argv[1];
|
$uid = (int) $argv[1];
|
||||||
$drupal_path = rtrim($argv[2], '/');
|
$drupal_path = $argv[2];
|
||||||
|
|
||||||
if (!file_exists($drupal_path . '/includes/bootstrap.inc')) {
|
|
||||||
echo "❌ Nie znaleziono bootstrap.inc w: $drupal_path\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Bootstrap Drupala
|
||||||
define('DRUPAL_ROOT', $drupal_path);
|
define('DRUPAL_ROOT', $drupal_path);
|
||||||
chdir(DRUPAL_ROOT);
|
chdir(DRUPAL_ROOT);
|
||||||
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
|
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
|
||||||
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
|
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
|
||||||
|
|
||||||
if ($uid <= 0) {
|
// Załaduj użytkownika
|
||||||
echo "❌ UID musi być większy niż 0.\n";
|
$account = user_load(array('uid' => $uid));
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
user_delete(array('uid' => $uid));
|
if ($account) {
|
||||||
echo "✅ Próba usunięcia użytkownika $uid.\n";
|
user_delete(array('uid' => $uid));
|
||||||
?>
|
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