Server IP : 162.240.98.243 / Your IP : 3.147.89.42 Web Server : Apache System : Linux server.bti.yaw.mybluehostin.me 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : btiyawmy ( 1003) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /scripts/ |
Upload File : |
#!/usr/local/cpanel/3rdparty/bin/perl # cpanel - scripts/sync_contact_emails_to_cpanel_users_files # Copyright 2022 cPanel, L.L.C. # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited package scripts::sync_contact_emails_to_cpanel_users_files; use strict; use warnings; use parent qw( Cpanel::HelpfulScript ); use constant _OPTIONS => ('force'); =encoding utf-8 =head1 NAME sync_contact_emails_to_cpanel_users_files =head1 SYNOPSIS sync_contact_emails_to_cpanel_users_files [ --help | --force ] =head1 DESCRIPTION This command will attempt to see if there are missing notification/contact related keys in all the CPUSER files for the users on the system. If there are keys missing, it will sync data from /home/$user/.cpanel/contactinfo to the user's CPUSER file. If the --force flag is passed, the script will sync the notifications/contact settings from the user's homedir even if there aren't missing keys. =cut if ( !caller() ) { __PACKAGE__->new(@ARGV)->run(); exit 0; } sub run { my ($self) = @_; die "This must run as root!\n" if $>; if ( !$self->getopt('force') ) { require Cpanel::Config::LoadUserDomains; require Cpanel::ContactInfo; my $user_to_domains_map = Cpanel::Config::LoadUserDomains::loaduserdomains( undef, 0, 1 ); Cpanel::ContactInfo::fetch_contactinfo($user_to_domains_map); } else { require Cpanel::ContactInfo::Sync; Cpanel::ContactInfo::Sync::sync_all_users_contact_info(); } return; } 1;