Source for file class.KONTAKTE.php
Documentation is available at class.KONTAKTE.php
* Stellt die Verbindung zur Datenbank 'person' her.
* Stellt Methoden zum Zugriff auf eine Person zur Verfügung.
* @subpackage foundation_tables
die('This file was generated for PHP 5');
* Basisklasse aller Klassen mit Datenbankzugriff.
* stellt Methoden und Objekte zur Fehlermeldung und zum Datenbankzugriff zur
require_once('src/foundation/tables/class.PARENTTABLES.php');
* Interface für die Klassen zur Manipulation der Datenbanktabellen
* @author Kay Koch, <kay.koch@gmx.de>
require_once('src/interfaces/interface.TABLEINTERFACE.php');
/* user defined includes */
// section -64--88-122--2-1328c7a:100f136ad5a:-7ff0-includes begin
// section -64--88-122--2-1328c7a:100f136ad5a:-7ff0-includes end
/* user defined constants */
// section -64--88-122--2-1328c7a:100f136ad5a:-7ff0-constants begin
// section -64--88-122--2-1328c7a:100f136ad5a:-7ff0-constants end
* Stellt die Verbindung zur Datenbank 'person' her.
* Stellt Methoden zum Zugriff auf eine Person zur Verfügung.
* @subpackage foundation_tables
* beinhaltet einen Datensatz der zuständigen Tabelle aus der Datenbank
* index ist die Kontakt_id
* Beinhaltet den Datenbanknamen (maxfrei)
* beinhaltet einen Datensatz der zuständigen Tabelle aus der Datenbank
private $dataLogin =
array();
* liefert einen (mehrere) Datensatz die durch setzen per Parameter
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7fab begin
$returnValue =
$this->data;
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7fab end
return (array)
$returnValue;
* @author Kay Koch, <kay.koch@gmx.de>
$returnValue = (bool)
false;
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7fa9 begin
SET name = '" .
$data['name'] .
"',
vorname = '" .
$data['vorname'] .
"',
login = '" .
$data['login'] .
"',
telefon = '" .
$data['telefon'] .
"',
fax = '" .
$data['fax'] .
"',
mobil = '" .
$data['mobil'] .
"',
email = '" .
$data['email'] .
"',
isAdmin = '" .
$data['isAdmin'] .
"'
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7fa9 end
return (bool)
$returnValue;
* fügt einen neuen Datensatz ein
* @author Kay Koch, <kay.koch@gmx.de>
$returnValue = (bool)
false;
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7fa6 begin
SET name = '" .
$data['name'] .
"',
vorname = '" .
$data['vorname'] .
"',
login = '" .
$data['login'] .
"',
pwd = '" .
md5('12345').
"',
telefon = '" .
$data['telefon'] .
"',
fax = '" .
$data['fax'] .
"',
mobil = '" .
$data['mobil'] .
"',
email = '" .
$data['email'] .
"',
isAdmin = '" .
$data['isAdmin'] .
"'";
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7fa6 end
return (bool)
$returnValue;
* @author Kay Koch, <kay.koch@gmx.de>
$returnValue = (bool)
false;
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7f9e begin
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7f9e end
return (bool)
$returnValue;
* aktualisiert die Daten im gegenwertigen Objekt
* @author Kay Koch, <kay.koch@gmx.de>
$returnValue = (bool)
false;
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7f9c begin
$sql =
"SELECT * FROM $this->dbTableName ORDER by name,vorname ASC";
$arrKontakte =
$this->select($sql, true, "kontakt_id");
foreach ($arrKontakte as $kontakt_id=>
$arrKontakt)
$this->dataLogin =
$this->select($sql, true, "login");
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7f9c end
return (bool)
$returnValue;
* löscht die Parameter, die den gegenwärtigen Datensatz identifizieren
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7f97 begin
// section -64--88-122--2--3d9a0b58:1040f000f1b:-7f97 end
* überprüft ob ein Kontakt Administratorrechte besitzt
* @author Kay Koch, <kay.koch@gmx.de>
public function isAdmin($login, $pwd)
$returnValue = (bool)
false;
// section -64--88-122--2--759b93b2:10397a7591b:-7fe3 begin
if (empty ($login) OR empty ($pwd))
if (!isset
($this->dataLogin[$login]))
if (!$this->dataLogin[$login]['isAdmin'] or $this->dataLogin[$login]['pwd'] !=
md5($pwd))
// section -64--88-122--2--759b93b2:10397a7591b:-7fe3 end
return (bool)
$returnValue;
* @author Kay Koch, <kay.koch@gmx.de>
public function setPWD($login, $pwd, $newPWD)
$returnValue = (bool)
false;
// section -64--88-122--2--55b78af2:103c6aa601f:-7fad begin
$pwd =
md5($pwd); // altes Passwort verschlüsseln;
if (!isset
($this->dataLogin[$login]))
throw
new Exception("1");
if ($this->dataLogin[$login]['pwd'] !=
$pwd )
throw
new Exception("2");
$sql =
"UPDATE $this->dbTableName SET pwd=md5('$newPWD') WHERE login='$login' AND pwd='$pwd' ";
throw
new Exception("3");
// section -64--88-122--2--55b78af2:103c6aa601f:-7fad end
return (bool)
$returnValue;
* setzt die Daten für die aktuelle Bearbeitung
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2-339007d5:1043cd4e8c9:-7f98 begin
// section -64--88-122--2-339007d5:1043cd4e8c9:-7f98 end
* liefert eine Optionslist mit allen Kontakten
* @author Kay Koch, <kay.koch@gmx.de>
$returnValue = (string)
'';
// section -64--88-122--2-339007d5:1043cd4e8c9:-7f95 begin
foreach($this->data as $oEinKontakt) {
$selected =
($oEinKontakt->kontakt_id ==
$index) ?
"SELECTED" :
"";
$returnValue .=
"<option $selected value='" .
$oEinKontakt->kontakt_id .
"'>" .
$oEinKontakt->name .
", " .
$oEinKontakt->vorname .
"</option>\n";
// section -64--88-122--2-339007d5:1043cd4e8c9:-7f95 end
return (string)
$returnValue;
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2-7471698e:1046ab3b89c:-7feb begin
// section -64--88-122--2-7471698e:1046ab3b89c:-7feb end
* liefert den Inhalt eines Feldes mit Namen Index aus den Kontakten
* @author Kay Koch, <kay.koch@gmx.de>
private function __get ($index)
$returnValue = (string)
'';
$returnValue =
$this->data;
if (isset
($this->data[$index]))
$returnValue =
$this->data[$index];
} /* end of class src_foundation_tables_KONTAKTE*/
Documentation generated on Sat, 24 Mar 2007 09:59:35 +0100 by phpDocumentor 1.3.1