#!/usr/bin/perl
# cpanel - autofixer/userdir_enable_fix           Copyright(c) 2010 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

BEGIN { unshift @INC, '/usr/local/cpanel'; }

use Cpanel::AdvConfig::apache();
my ( $is_ok, $message ) = Cpanel::AdvConfig::apache::check_syntax();
if ( !$is_ok ) {
    if ( $message =~ /userdir.*keyword\s*requires\s*a\s*list\s*of\s*usernames/i ) {
        print "Detected broken UserDir directive, forcing conf rebuild!\n";
        system '/scripts/rebuildhttpdconf';
    }
}

