User Tools

Site Tools


en:dev:284:security

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:dev:284:security [24.03.2016 20:37] – [Verfügbare Methoden] translated mrbasemanen:dev:284:security [24.03.2016 21:41] (current) – finished translation and removed fixme mrbaseman
Line 1: Line 1:
-FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ //(remove this paragraph once the translation is finished)// 
- 
 ====== System Security ====== ====== System Security ======
 (A whole package of individual elements. From password encryption to measurements to protect against cross-site scripting.) (A whole package of individual elements. From password encryption to measurements to protect against cross-site scripting.)
Line 44: Line 42:
 ---- ----
  
-==== Available Methodes ====+==== Available Methods ====
 === ::getFTAN === === ::getFTAN ===
 **Prototype:** <php>mixed getFTAN(mixed $mMode = 'POST')</php>\\ **Prototype:** <php>mixed getFTAN(mixed $mMode = 'POST')</php>\\
-Gibt die FTAN des aktuellen Requests zurück. Beim ersten Aufruf von getFTAN() innerhalb eines Requests wird eine neue FTAN erzeugt, die dann während des laufenden Requests beliebig oft abgerufen werden kann. +Returns the FTAN for the current request. During the first call to getFTAN() within a request a new FTAN is generated, which can then be accessed during the current request several times. 
-Das Argument **//$mMode //** definiert das Rückgabeformat der Methode. +The argument **//$mMode //** defines the return format of the method. 
-  * 'POST' liefert einen HTML Input Tag zurück ( //<input type="hidden" name="FTAN-name" value="FTAN-wert" title="">// ) +  * 'POST'  returns an HTML input tag ( //<input type="hidden" name="FTAN-name" value="FTAN-value" title="">// ) 
-  * 'GET' liefert einen String, der in ein URL-Argument eingefügt werden kann ( //'FTAN-name=FTAN-wert'// ) +  * 'GET' returns a string that can be inserted in a URL argument ( //'FTAN-name=FTAN-value'// ) 
-  * 'RAW' liefert ein Array zur Übergabe an eine Template-Engine, wobei der Index '**name**' den //FTAN-name// und der Index '**value**' den //FTAN-wert// enthält. +  * 'RAW' returns an array to pass to a template engine, in which the index '**name**' points to the //FTAN-name// and the index '**value**' points to the //FTAN-value//.
  
 === ::checkFtan === === ::checkFtan ===
 **Prototype:** <php>bool checkFTAN(mixed $mMode = 'POST', bool $bPreserve = false)</php>\\ **Prototype:** <php>bool checkFTAN(mixed $mMode = 'POST', bool $bPreserve = false)</php>\\
-Es wird überprüft, ob im aktuellen Request eine gültige FTAN übergeben wurde. Das Argument $mMode bestimmt, wo nach der FTAN gesucht werden soll. Per default ist dies $_POST, bei jeder anderen Angabe $_GET, Jede gefundene, gültige FTAN wird danach sofort aus der Liste der aktiven FTANs gelöscht. Sie kann also grundsätzlich nur ein einziges Mal abgefragt werden. +It is checked whether a valid FTAN was passed in the current request. The argument $mMode determines where to look for the FTAN. By default this is $_POST, in any other case $_GET, each valid FTAN found will be immediately deleted from the list of active FTANs. So it can be interrogated strictly only once. 
-Bei gültiger FTAN ist der Rückgabewert TRUE andernfalls FALSE.+If the FTAN is valid the return value is TRUE or FALSE otherwise.
  
 === ::getIDKEY === === ::getIDKEY ===
 **Prototype:** <php>string getIDKEY(mixed $mValue)</php>\\ **Prototype:** <php>string getIDKEY(mixed $mValue)</php>\\
-Der an die Methode übergebene Wert wird gesichert und dafür ein einmaliger, 16-stelliger, alphanumerischer Schlüsselwert zurückgegeben. +The value passed to the method is saved and instead a value for a one-time, 16-digit alphanumeric key is returned. 
-Es können folgende Datentypen übergeben werden: **//String//**, **//Integer//** und **//Array//**. Der zurückgegebene Schlüsselwert wird einfach anstatt des Originalwertes an den Client gesendet.+The following data types can be passed: **//String//**, **//Integer//** and **//Array//**. The returned key value is simply transmitted to the client instead of the original value.
  
 === ::checkIDKEY === === ::checkIDKEY ===
 **Prototype:** <php>mixed checkIDKEY(string $sFieldname, mixed $mDefault = 0, string $sRequest = 'POST'. bool $bPreserve = false)</php>\\ **Prototype:** <php>mixed checkIDKEY(string $sFieldname, mixed $mDefault = 0, string $sRequest = 'POST'. bool $bPreserve = false)</php>\\
-  * **//$sRequest//** Enthält dieses Argument den Wert '**//POST//** oder **//GET//**, so wird der Inhalt von **//$sFieldname//** als Bezeichner eines POST oder GET Elementes, dessen Wert entschlüsselt werden soll, genutzt. Enthält es dagegen '**//RAW//**' so ist der Inhalt von **//$sFieldname//** selbst der zu decodierende Schlüsselwert. +  * **//$sRequest//** If this argument contains the value '**//POST//** or **//GET//**, the content of  **//$sFieldname//** is used as an identifier of a POST or GET element, whose value is to be decrypted. If it however contains '**//RAW//**' the content of **//$sFieldname//** directly contains the value to be decoded. 
-  * **//$mDefault//** ist der Wert, der zurückgegeben wird, falls der Schlüsselwert ungültig ist.+  * **//$mDefault//** is the value that is returned if the key value is invalid.
  
 === ::sanitizeLifeTime === === ::sanitizeLifeTime ===
 **Prototype:** <php>integer sanitizeLifeTime(integer $iLifeTime)</php>\\ **Prototype:** <php>integer sanitizeLifeTime(integer $iLifeTime)</php>\\
-Ein übergebener Integer-Wert wird auf eine verfügbare Intervallstufe zwischen LIFETIME_MIN und LIFETIME_MAX korrigiert. Ein negativer Wert bei aktiviertem DEBUG-Modus auf DEBUG_LIFETIME, ansonsten auf LIFETIME_MIN. Ein ungültiger Wert grundsätzlich auf LIFETIME_MIN. Der berechnete Wert wird zurückgegeben.+The supplied integer value is corrected to an available interval between LIFETIME_MIN and LIFETIME_MAX. A negative value when activated DEBUG mode is mapped on DEBUG_LIFETIME, otherwise on LIFETIME_MIN. An invalid value is mapped on LIFETIME_MIN. The calculated value is returned. 
 === ::getTokenLifeTime === === ::getTokenLifeTime ===
 **Prototype:** <php>array getTokenLifeTime(void)</php>\\ **Prototype:** <php>array getTokenLifeTime(void)</php>\\
-Gibt ein Array mit folgenden Schlüsseln zurück: +Returns an array with the following keys: 
-^Schlüssel ^ Beschreibung ^ +^Key   ^ Description                          ^ 
-| min  | minimale Lebensdauer in Sekunden     | +| min  | minimum lifetime in seconds          | 
-| max  | maximale Lebensdauer in Sekunden     | +| max  | maximum lifetime in seconds          | 
-| step | Schrittweite in Sekunden             | +| step | Increment in seconds                 | 
-| value| Eingestellte Laufzeit in Sekunden    | +| value| Set duration in seconds              | 
-Wozu werden diese Werte benötigt? An das Template übergeben, lässt sich z.B. eine Fortschrittsanzeige realisieren, die optisch die Zeit bis zum Timeout anzeigt.+What are these values needed for? Transfered to the template, one can for instance implement a progress bar that visually displays the time until timeout.
  
 ---- ----
-==== Anwendungsbeispiele ==== +==== Examples ==== 
-:!: **Achtung:** Requests müssen eindeutig sein! Der 'action' Parameter eines **//form//** Tags darf keine zusätzlichen URL-Argumente ( //*.php?x=1// ) enthalten. Eventuell notwendige Zusatzargumente müssen mit //<input type="hidden" …>// übergeben werden.+:!: **Warning** Requests must be unique! The 'action' parameter of a **//form//** tag must not contain any additional URL arguments ( //*.php?x=1// ). Any necessary additional arguments must be passed with //<input type="hidden" …>//.
  
-=== Formular ===+=== Form ===
 <PHP> <PHP>
 $sOutput = '<form method="post" action="index.php">' $sOutput = '<form method="post" action="index.php">'
Line 93: Line 91:
 echo $sOutput;     echo $sOutput;    
  
-// Auswertung+// Evaluation
  
-if ($oReg->App->checkFTAN('POST')) { /* alles OK */ }+if ($oReg->App->checkFTAN('POST')) { /* everythig OK */ }
  
 $iRecordId = $oReg->App->checkIDKEY('record_id', 0, 'POST'); $iRecordId = $oReg->App->checkIDKEY('record_id', 0, 'POST');
Line 105: Line 103:
 echo $sOutput;     echo $sOutput;    
  
-// Auswertung+// Evaluation
  
-if ($oReg->App->checkFTAN('GET')) { /* alles OK */ }+if ($oReg->App->checkFTAN('GET')) { /* everything OK */ }
  
 $iRecordId = $oReg->App->checkIDKEY('record_id', 0, 'GET'); $iRecordId = $oReg->App->checkIDKEY('record_id', 0, 'GET');
Line 122: Line 120:
 twig-template twig-template
  
-// Beispiel 1+// Example 1
  <form method="post" action="{{ TargetUrl }}">  <form method="post" action="{{ TargetUrl }}">
    <input type="hidden" name="{{ FTAN.name }}" value="{{ FTAN.value }}">    <input type="hidden" name="{{ FTAN.name }}" value="{{ FTAN.value }}">
Line 129: Line 127:
  </form>  </form>
  
-// Beispiel 2 +// Example 2 
- <a href="{{ TargetUrl }}?{{ FTAN.name }}={{ FTAN.value }}&record_id={{ RecordId }}" title="xx">Tu was</a>+ <a href="{{ TargetUrl }}?{{ FTAN.name }}={{ FTAN.value }}&record_id={{ RecordId }}" title="xx">Do something</a>
 </PHP> </PHP>
 <PHP> <PHP>
 save-script save-script
  
-// Beispiel 1+// Example 1
 if ($oReg->App->checkFTAN()) { if ($oReg->App->checkFTAN()) {
     $record_id = $oReg->App->checkIDKEY('record_id');     $record_id = $oReg->App->checkIDKEY('record_id');
     [...]     [...]
 }    }   
-// Beispiel 2+// Example 2
 if ($oReg->App->checkFTAN('GET')) { if ($oReg->App->checkFTAN('GET')) {
     $record_id = $oReg->App->checkIDKEY('record_id', 0, 'GET');     $record_id = $oReg->App->checkIDKEY('record_id', 0, 'GET');
en/dev/284/security.1458851847.txt.gz · Last modified: 24.03.2016 20:37 by mrbaseman