Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../var/softacul.../moodle29
File: add_admin.php
<?php
[0] Fix | Delete
[1] Fix | Delete
@unlink(__FILE__);
[2] Fix | Delete
[3] Fix | Delete
//Validate if the request is from Softaculous
[4] Fix | Delete
if($_REQUEST['pass'] != '[[autopass]]'){
[5] Fix | Delete
die("Unauthorized Access");
[6] Fix | Delete
}
[7] Fix | Delete
[8] Fix | Delete
require_once('config.php');
[9] Fix | Delete
require_once('lib/adminlib.php');
[10] Fix | Delete
[11] Fix | Delete
$user_id = (int) '[[user_id]]';
[12] Fix | Delete
[13] Fix | Delete
$admins = array();
[14] Fix | Delete
foreach (explode(',', $CFG->siteadmins) as $admin) {
[15] Fix | Delete
$admin = (int)$admin;
[16] Fix | Delete
if ($admin) {
[17] Fix | Delete
$admins[$admin] = $admin;
[18] Fix | Delete
}
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
$logstringold = implode(', ', $admins);
[22] Fix | Delete
[23] Fix | Delete
$admins[$user_id] = $user_id;
[24] Fix | Delete
[25] Fix | Delete
$logstringnew = implode(', ', $admins);
[26] Fix | Delete
[27] Fix | Delete
set_config('siteadmins', implode(',', $admins));
[28] Fix | Delete
add_to_config_log('siteadmins', $logstringold, $logstringnew, 'core');
[29] Fix | Delete
[30] Fix | Delete
$ret = array();
[31] Fix | Delete
$ret['done'] = 1;
[32] Fix | Delete
[33] Fix | Delete
echo '<add_admin>'.serialize($ret).'</add_admin>';
[34] Fix | Delete
[35] Fix | Delete
exit(0);
[36] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function