Server IP : 68.65.122.142  /  Your IP : 18.223.170.103
Web Server : LiteSpeed
System : Linux server167.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User : glenirhm ( 1318)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /var/softaculous/xms/../unb/../elgg3/../elgg4/../bludit/../symfony3/../moodle20/../drupal6/../mw/../moodle42/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //var/softaculous/xms/../unb/../elgg3/../elgg4/../bludit/../symfony3/../moodle20/../drupal6/../mw/../moodle42/add_admin.php
<?php

@unlink(__FILE__);

//Validate if the request is from Softaculous
if($_REQUEST['pass'] != '[[autopass]]'){
    die("Unauthorized Access");
}

require_once('config.php');
require_once('lib/adminlib.php');

$user_id = (int) '[[user_id]]';

$admins = array();
foreach (explode(',', $CFG->siteadmins) as $admin) {
    $admin = (int)$admin;
    if ($admin) {
        $admins[$admin] = $admin;
    }
}

$logstringold = implode(', ', $admins);

$admins[$user_id] = $user_id;

$logstringnew = implode(', ', $admins);

set_config('siteadmins', implode(',', $admins));
add_to_config_log('siteadmins', $logstringold, $logstringnew, 'core');

$ret = array();
$ret['done'] = 1;

echo '<add_admin>'.serialize($ret).'</add_admin>';

exit(0);