I’ve solved it myself.
Now quick reg applies AD settings to host.
Add AD settings in web ui:
Settings - Fog Settings - Active Directory Defaults
Then replace code in /var/www/fog/lib/reg-task/registration.class.php
With this:
https://www.pastiebin.com/5d6c4867436bc
Do not forget to chown www-data:www-data /var/www/fog/lib/reg-task/registration.class.php
after.
PS
And one more thing, maybe someone needs it. If you have multiple admins in your organisation and some of them have just support rights, but not domain admins, you cant hide all ad admin passwords from viewing it in the web ui:
find this code in /var/www/fog/lib/pages/fogconfigurationpage.class.php :
default:
$type .= ‘<input type=“password” name=“${service_id}” value="’
. ‘${service_value}" autocomplete=“off” class=’
. ‘“form-control” id=“${service_name}”/>’;
and replace it with this:
default:
$type .= ‘<input type=“password” name=“${service_id}” value="’
. ‘" autocomplete=“off” class=’
. ‘“form-control” id=“${service_name}”/>’;
also find this code in /var/www/fog/lib/fog/fogpage.class.php :
) => sprintf(
‘<div class=“input-group”>’
. ‘<input id=“adPassword” class=“form-control” type=’
. '“password” ’
. ‘name=“domainpassword” value=“%s” autocomplete=“off”/>’
. ‘</div>’,
$ADPass
),
and replace with this:
) => sprintf(
‘<div class=“input-group”>’
. ‘<input id=“adPassword” class=“form-control” type=’
. '“password” ’
. ‘name=“domainpassword” value=“%s” autocomplete=“off”/>’
. ‘</div>’,
‘#hidden’//$ADPass
),
Also, do
mv /var/www/fog/lib/db/mysqldump.class.php /var/www/fog/lib/db/mysqldump.class.php.bak
to prevent from backing up whole mysql db/