Ignore:
Timestamp:
Dec 1, 2025, 10:11:09 PM (3 hours ago)
Author:
chronos
Message:
  • Fixed: Check if system user is logged in modules page.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Modules/Setup.php

    r912 r981  
    1515    $this->License = 'GNU/GPLv3';
    1616    $this->Description = 'Base setup module';
    17     $this->Revision = 1;
    1817    $this->Type = ModuleType::System;
    1918
     
    5958    $Output = $this->UpdateManager->Upgrade();
    6059    return $Output;
     60  }
     61
     62  function UserLogged(): bool
     63  {
     64    if (!array_key_exists('SystemPassword', $_SESSION)) $_SESSION['SystemPassword'] = '';
     65    if (array_key_exists('login', $_POST)) $_SESSION['SystemPassword'] = $_POST['SystemPassword'];
     66    return sha1($_SESSION['SystemPassword']) == Core::Cast($this->System)->Config['SystemPassword'];
    6167  }
    6268}
     
    125131  function Show(): string
    126132  {
    127     global $ConfigDefinition, $DatabaseRevision, $Config, $Updates;
     133    global $DatabaseRevision, $Config;
    128134
    129135    $this->UpdateManager = ModuleSetup::Cast($this->System->GetModule('Setup'))->UpdateManager;
     
    136142    if (isset($this->Config))
    137143    {
    138       if (!array_key_exists('SystemPassword', $_SESSION)) $_SESSION['SystemPassword'] = '';
    139       if (array_key_exists('login', $_POST)) $_SESSION['SystemPassword'] = $_POST['SystemPassword'];
    140       if (sha1($_SESSION['SystemPassword']) != $this->Config['SystemPassword'])
     144      if (!ModuleSetup::Cast($this->System->GetModule('Setup'))->UserLogged())
    141145      {
    142146        $Output .= $this->LoginPanel();
     
    153157        else if ($Action == 'models')
    154158        {
    155           $this->System->FormManager->UpdateSQLMeta();
     159          Core::Cast($this->System)->FormManager->UpdateSQLMeta();
    156160        }
    157161        else if ($Action == 'upgrade')
Note: See TracChangeset for help on using the changeset viewer.