login_as_admin.php 393 B

123456789101112131415161718
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. exit;
  4. if (PHP_SAPI != 'cli') {
  5. die('This script can only be executed from the command line');
  6. }
  7. require_once __DIR__.'/../../main/inc/global.inc.php';
  8. $userInfo = UserManager::logInAsFirstAdmin();
  9. if (api_is_platform_admin()) {
  10. echo 'Logged as admin user: '.$userInfo['complete_name'];
  11. } else {
  12. echo 'NOT logged as admin ';
  13. }