Changeset 484 for trunk/Common/Types


Ignore:
Timestamp:
Feb 10, 2013, 11:31:12 AM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Formulářový typ RandomHash pro zajištění funkčnosti generování vlastnosti Salt pro generování hesel.
  • Opraveno: Změna hesla uživatele nyní funguje správně i přes obecnou Správu dat.
Location:
trunk/Common/Types
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Types/Base.php

    r442 r484  
    55  var $System;
    66  var $DatabaseCompareOperators = array();
     7  var $Hidden;
    78
    89  function __construct($System)
    910  {
    10     $this->System = $System;
     11    $this->System = &$System;
     12    $this->Hidden = false;
    1113  }
    1214
  • trunk/Common/Types/Hidden.php

    r428 r484  
    55class TypeHidden extends TypeBase
    66{
     7  function __construct($System)
     8  {
     9    parent::__construct($System);
     10    $this->Hidden = true;
     11  }
     12 
    713  function OnView($Item)
    814  {
  • trunk/Common/Types/Password.php

    r442 r484  
    4141    return($Result);
    4242  }
     43 
     44  function OnSaveDb($Item)
     45  {
     46    if($Item['Value'] == '') return('');
     47    else {
     48      $PasswordHash = new PasswordHash();
     49      return($PasswordHash->Hash($Item['Value'], $Item['Values']['Salt']));
     50    }
     51  }
    4352   
    4453  function OnLoadDb($Item)
  • trunk/Common/Types/Type.php

    r430 r484  
    2020include(dirname(__FILE__).'/IPv4Address.php');
    2121include(dirname(__FILE__).'/Color.php');
     22include(dirname(__FILE__).'/RandomHash.php');
    2223
    2324class Type
     
    2526  var $System;
    2627  var $TypeDefinitionList;
     28  var $Values;
    2729
    2830  function __construct($System)
     
    4951      'OneToMany' => array('Name' => 'OneToMany', 'Class' => 'OneToMany', 'ParentType' => '', 'Parameters' => array()),
    5052      'Color' => array('Name' => 'Color', 'Class' => 'Color', 'ParentType' => '', 'Parameters' => array()),
     53      'RandomHash' => array('Name' => 'RandomHash', 'Class' => 'RandomHash', 'ParentType' => '', 'Parameters' => array()),
    5154    );
    5255  }
     
    6265        else return($TypeName.'->'.$Event.'('.serialize($Parameters).')');
    6366    } else return($TypeName);
     67  }
     68 
     69  function IsHidden($TypeName)
     70  {
     71    if(array_key_exists($TypeName, $this->TypeDefinitionList))
     72    {
     73      $Type = $this->TypeDefinitionList[$TypeName];
     74      $TypeClass = 'Type'.$Type['Class'];
     75      $TypeObject = new $TypeClass($this->System);
     76      return($TypeObject->Hidden);
     77    } else return(false);
    6478  }
    6579
Note: See TracChangeset for help on using the changeset viewer.