Uname:Linux woropds 5.15.0-187-generic #197-Ubuntu SMP Fri Jul 17 19:17:01 UTC 2026 x86_64

Base Dir : /var/www/sweetheart.mx/htdocs

User : root


Who Knows WP Shell uploader
Uname:Linux woropds 5.15.0-187-generic #197-Ubuntu SMP Fri Jul 17 19:17:01 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 216.238.66.20  /  Your IP : 216.73.216.199
Web Server : nginx/1.30.4
System : Linux woropds 5.15.0-187-generic #197-Ubuntu SMP Fri Jul 17 19:17:01 UTC 2026 x86_64
User : root ( 0)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/7mares-api.gamliel.mx/htdocs/seven-seas/config/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/7mares-api.gamliel.mx/htdocs/seven-seas/config/cron-tasks.ts
import dayjs from 'dayjs';
import isoWeek from 'dayjs/plugin/isoWeek';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import 'dayjs/locale/es';

dayjs.locale('es');
dayjs.extend(localizedFormat);
dayjs.extend(isoWeek);
dayjs.extend(utc);
dayjs.extend(timezone);
dayjs.tz.setDefault("America/Mexico_City");

export default {
    /**
     * Simple example.
     * Every monday at 1am.
     */

    updateTrainingsWeeks: {
      task: async ({ strapi }) => {
        try {
            let days = [];
            let users = await strapi.entityService.findMany('plugin::users-permissions.user');

            for (let user of users) {
              if (user.has_active_plan) {
                let daysActive = await strapi.entityService.findMany('api::user-training.user-training', {
                  filters: {
                    user: {
                      id: user.id
                    },
                    is_deleted: false,
                    is_active: true
                  },
                  limit: 7,
                  sort: 'id'
                });

                let activeIDs = daysActive.map(day => day.id);

                if (daysActive.length == 7) {
                  let max = daysActive[6].id;

                  let daysNextActive = await strapi.entityService.findMany('api::user-training.user-training', {
                    filters: {
                      user: {
                        id: user.id
                      },
                      is_deleted: false,
                      is_active: false,
                      id: {
                        $gt: max
                      }
                    },
                    limit: 7,
                    sort: 'id'
                  });

                  let nextIDs = daysNextActive.map(day => day.id);

                  await strapi.db.query('api::user-training.user-training').updateMany({
                    where: {
                      id: nextIDs
                    },
                    data: {
                      is_active: true
                    }
                  });

                  days.push({
                    active: daysActive,
                    next: daysNextActive
                  });
                } else {
                  days.push({
                    active: daysActive
                  });
                }

                await strapi.db.query('api::user-training.user-training').updateMany({
                  where: {
                    id: activeIDs
                  },
                  data: {
                    is_complete: true,
                    is_active: false,
                    completedAt: dayjs().format('YYYY-MM-DD')
                  }
                });
              }
            }
        } catch (err) {
            strapi.log.fatal(err);
        }
      },
      options: {
        rule: "0 0 1 * * 1", //executes every monday at 1:00 am
        tz: 'America/Mexico_City'
      },
    },
  };

Youez - 2016 - github.com/yon3zu
LinuXploit