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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/wincloud_gateway/node_modules/strapi-admin/admin/src/containers/Users/EditPage/   drwxr-xr-x
Free 13.06 GB of 57.97 GB (22.54%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     index.js (4.43 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import React from 'react';
import { useRouteMatch } from 'react-router-dom';
import { useIntl } from 'react-intl';
import { get, isEmpty } from 'lodash';
import { BaselineAlignment, useGlobalContext, SizedInput, auth } from 'strapi-helper-plugin';
import { Col } from 'reactstrap';
import { Padded } from '@buffetjs/core';
import PropTypes from 'prop-types';
import PageTitle from '../../../components/SettingsPageTitle';
import ContainerFluid from '../../../components/ContainerFluid';
import FormBloc from '../../../components/FormBloc';
import { Header } from '../../../components/Settings';
import { MagicLink, SelectRoles } from '../../../components/Users';
import { useSettingsForm } from '../../../hooks';
import { editValidation } from '../../../validations/users';
import form from './utils/form';

const EditPage = ({ canUpdate }) => {
  const { settingsBaseURL } = useGlobalContext();
  const { formatMessage } = useIntl();
  const {
    params: { id },
  } = useRouteMatch(`${settingsBaseURL}/users/:id`);

  const cbSuccess = data => {
    const userInfos = auth.getUserInfo();

    // The user is updating themself
    if (data.id === userInfos.id) {
      auth.setUserInfo(data);
    }
  };
  const [
    { formErrors, initialData, isLoading, modifiedData, showHeaderButtonLoader, showHeaderLoader },
    // eslint-disable-next-line no-unused-vars
    dispatch,
    { handleCancel, handleChange, handleSubmit },
  ] = useSettingsForm(`/admin/users/${id}`, editValidation, cbSuccess, [
    'email',
    'firstname',
    'lastname',
    'username',
    'isActive',
    'roles',
    'registrationToken',
  ]);
  const headerLabelId = isLoading
    ? 'app.containers.Users.EditPage.header.label-loading'
    : 'app.containers.Users.EditPage.header.label';
  const headerLabelName = initialData.username
    ? initialData.username
    : `${initialData.firstname} ${initialData.lastname}`;
  const headerLabel = formatMessage({ id: headerLabelId }, { name: headerLabelName });

  const hasRegistrationToken = modifiedData.registrationToken;
  const hasRolesError = formErrors.roles && isEmpty(modifiedData.roles);

  return (
    <>
      <PageTitle name="Users" />
      <form onSubmit={handleSubmit}>
        <ContainerFluid padding="0">
          <Header
            isLoading={showHeaderLoader}
            initialData={initialData}
            label={headerLabel}
            modifiedData={modifiedData}
            onCancel={handleCancel}
            showHeaderButtonLoader={showHeaderButtonLoader}
          />
          {hasRegistrationToken ? (
            <>
              <Padded top bottom size="sm">
                <MagicLink registrationToken={initialData.registrationToken} />
              </Padded>
              <BaselineAlignment top size="1px" />
            </>
          ) : (
            <BaselineAlignment top size="3px" />
          )}

          <FormBloc
            isLoading={isLoading}
            title={formatMessage({
              id: 'app.components.Users.ModalCreateBody.block-title.details',
            })}
          >
            {Object.keys(form).map(key => {
              return (
                <SizedInput
                  {...form[key]}
                  key={key}
                  disabled={!canUpdate}
                  error={formErrors[key]}
                  name={key}
                  onChange={handleChange}
                  value={get(modifiedData, key, '')}
                />
              );
            })}
          </FormBloc>

          <BaselineAlignment top size="2px" />

          <Padded top size="md">
            {!isLoading && (
              <FormBloc
                title={formatMessage({ id: 'app.containers.Users.EditPage.roles-bloc-title' })}
              >
                <Col xs="6">
                  <Padded top size="sm">
                    <SelectRoles
                      name="roles"
                      isDisabled={!canUpdate}
                      onChange={handleChange}
                      error={formErrors.roles}
                      value={get(modifiedData, 'roles', [])}
                    />
                    <BaselineAlignment top size={hasRolesError ? '0' : '17px'} />
                  </Padded>
                </Col>
              </FormBloc>
            )}
          </Padded>
        </ContainerFluid>
        <Padded bottom size="md" />
      </form>
      <BaselineAlignment bottom size="80px" />
    </>
  );
};

EditPage.propTypes = {
  canUpdate: PropTypes.bool.isRequired,
};

export default EditPage;

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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