Changeset 895 for trunk/Modules/User


Ignore:
Timestamp:
Jan 12, 2021, 10:29:50 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Setup is now AppModule and it is installed and stated as first module.
  • Modified: Improved modular system.
Location:
trunk/Modules/User
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/User/User.php

    r894 r895  
    2929  }
    3030
     31  function DoInstall(): void
     32  {
     33    $this->Database->insert('PermissionGroup', array('Id' => 1, 'Description' => 'Ostatní'));
     34    $this->Database->insert('PermissionGroup', array('Id' => 2, 'Description' => 'Registrovaní uživatelé'));
     35    $this->Database->insert('PermissionGroup', array('Id' => 3, 'Description' => 'Zákazníci'));
     36    $this->Database->insert('PermissionGroup', array('Id' => 4, 'Description' => 'Správci sítě'));
     37    $this->Database->insert('PermissionGroup', array('Id' => 5, 'Description' => 'Systémoví správci'));
     38  }
     39
    3140  function DoStart(): void
    3241  {
     
    181190    $Output = 'Uživatelů: '.$DbRow['0'].'<br/>';
    182191    return $Output;
    183   }
    184 
    185   function DoStop(): void
    186   {
    187192  }
    188193
  • trunk/Modules/User/UserModel.php

    r894 r895  
    7575    $Desc->AddString('Salt');
    7676    $Desc->AddString('Email');
    77     $Desc->AddString('LastIpAddress');
    78     $Desc->AddString('LastLoginTime');
     77    $Column = $Desc->AddString('LastIpAddress');
     78    $Column->HasDefault = true;
     79    $Column->Nullable = true;
     80    $Column = $Desc->AddDateTime('LastLoginTime');
     81    $Column->Nullable = true;
     82    $Column->HasDefault = true;
    7983    $Desc->AddDateTime('RegistrationTime');
    8084    $Desc->AddBoolean('Locked');
    81     $Desc->AddString('InitPassword');
     85    $Column = $Desc->AddString('InitPassword');
     86    $Column->Nullable = true;
     87    $Column->HasDefault = true;
    8288    return $Desc;
    8389  }
     
    118124    if ($Row['User'] != '')
    119125    {
    120       $Query = $this->Database->query('SELECT `User`.*, `UserCustomerRel`.`Customer` AS `Member` FROM `User` '.
    121         ' LEFT JOIN `UserCustomerRel` ON `UserCustomerRel`.`User`=`User`.`Id` WHERE `User`.`Id`='.$Row['User']);
     126      $Query = $this->Database->query('SELECT `User`.* FROM `User` WHERE `User`.`Id`='.$Row['User']);
    122127      $this->User = $Query->fetch_assoc();
    123128      $Result = USER_LOGGED;
     
    500505  {
    501506    $Desc = new ModelDesc(self::GetClassName());
    502     $Desc->AddReference('Module', Module::GetClassName());
     507    //$Desc->AddReference('Module', Module::GetClassName());
    503508    $Desc->AddString('Operation');
    504509    $Desc->AddString('Item');
  • trunk/Modules/User/UserPage.php

    r887 r895  
    2121  function ShowContacts(): string
    2222  {
     23    if (!$this->System->ModuleManager->ModuleRunning('Subject')) return '';
     24
    2325    $Query = 'SELECT `Contact`.`Value`, `Contact`.`Description`, (SELECT `Name` FROM `ContactCategory` WHERE `ContactCategory`.`Id` = `Contact`.`Category`) AS `Category` '.
    2426      'FROM `Contact` WHERE `User` = '.
     
    3941    $Order = GetOrderTableHeader('Contacts', $TableColumns, 'Value', 0);
    4042    $Output .= $Order['Output'];
    41 
    4243    $Query = $Query.' '.$Order['SQL'].$PageList['SQLLimit'];
    43 
    4444    $DbResult = $this->Database->query($Query);
    4545    while ($Contact = $DbResult->fetch_assoc())
     
    4949      '<td>'.$Contact['Value'].'</td>'.
    5050      '<td>'.$Contact['Description'].'</td>'.
    51       '</tr>';
     51        '</tr>';
    5252    }
    5353    $Output .= '</table>';
Note: See TracChangeset for help on using the changeset viewer.