Example #1
0
$ret = $PUSER->auth("theo", "passtest");
it("wrong auth (old pass accepted, wenn nicht-OK)", $ret, false);
$ret = $PUSER->auth("theo", "testtest");
it("right auth", $ret, true);
$ret = $PUSER->auth();
#	echo "<br>session: ".session_id();
it("same auth, but with session cannot auth because of wrong auth, session is destroyed", $ret, false);
// angemeldet? und fehlerhafte wiederanmeldung
$ret = $PUSER->auth("theo", "testtest00");
it("false auth", $ret, false);
it("&nbsp; and session killed", session_id(), "");
// neu anmelden
$ret = $PUSER->auth("theo", "testtest");
it("right auth", $ret, true);
// abmeldung
$ret = $PUSER->logout();
it("logout", $ret, true);
$ret = $PUSER->logout();
it("2nd logout (should fail)", $ret, false);
/*	*/
// endeUSER
/* * * * sites * * * */
echo "<h2>SITES</h2>";
$t1 = count($PSITES->show_all());
it("show all, count=0", $t1, 0);
$t2name = "eins";
$kuerzel1 = "AA";
$kuerzel2 = "BB";
$t2 = $PSITES->add($t2name, $kuerzel1);
it("create 1st", $t2, 1);
// id=1