Skip to content

Instantly share code, notes, and snippets.

@voidvn
Last active June 2, 2023 21:25
Show Gist options
  • Save voidvn/54401a939a1def4883124d4f16a12af4 to your computer and use it in GitHub Desktop.
Save voidvn/54401a939a1def4883124d4f16a12af4 to your computer and use it in GitHub Desktop.
Bitrix auth script (if you don't know admin password). Create this file in the site root directory.
<?php
require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/header.php');
global $USER;
// auth user with id = 1
$USER->Authorize(1);
// delete this script from server
@unlink(__FILE__);
LocalRedirect('/bitrix/admin/');
require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/footer.php');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment