Hallo Leute
Wollte mal fragen, ob es ein Authentifizierungs-Template (Addon: simple_user) gibt, welches nicht von der Ebene abhänigig ist, wie das in diesem Beitrag:
http://forum.redaxo.de/ftopic1716.html
Gruß
Thomas
<?
$errorArticleId = "25";
setlocale(LC_ALL,"de_DE");
// -------------------------------------------------------------- USER AUTH
session_start();
$FORM['USR'] = false;
$user_id = 0;
$user_name = "";
if($REX['CUR_CLANG']== "0"){
$error_lang = "de";
}
else{
$error_lang = "en";
}
if ($_SESSION['UID']['rexsite'] !="" OR $FORM['loginname'] != "" OR $FORM['logout'] != "") {
$FORM['USER'] = new login();
$FORM['USER']->setSqlDb(1);
$FORM['USER']->setSysID("rexsite");
$FORM['USER']->setLanguage($error_lang);
$FORM['USER']->setSessiontime(3000);
$FORM['USER']->setLogin($FORM['loginname'],$FORM['loginpasswort']);
if ($FORM['LOGOUT'] == 1) {
$FORM['USER']->setLogout(true);
}
$FORM['USER']->setUserID("rex_2_user.id");
$FORM['USER']->setUserquery("SELECT *
FROM rex_2_user
WHERE id='USR_UID'
AND login_activation=1
AND user_status='1'
AND user_typ>'0'");
$FORM['USER']->setLoginquery("SELECT *
FROM rex_2_user
WHERE user_login='USR_LOGIN'
AND user_password='USR_PSW'
AND login_activation='1'
AND user_status='1'");
if ($FORM['USER']->checkLogin()) {
$FORM['USR'] = true;
$user_id = $FORM['USER']->getValue("rex_2_user.id");
$user_name = $FORM['USER']->getValue("rex_2_user.user_name");
$FORM['USR_ID'] = $user_id;
$FORM['USR_TYP'] = $FORM['USER']->getValue("rex_2_user.user_typ");
}
else {
$FORM['USR'] = false;
$err_msg = $FORM['USER']->message;
$FORM['USR_ID'] = 0;
$FORM['USR_TYP'] = 0;
}
}
else {
// nicht eingeloggt und kein login
$FORM['USR_ID'] = 0;
$FORM['USR_TYP'] = 0;
}
// EXPLODE PATH
$PATH = explode("|",$this->getValue("path").$this->getValue("article_id")."|");
$aid = $this->getValue("article_id");
// GET CURRENTS
$path1 = $PATH[1];
$path2 = $PATH[2];
$path3 = $PATH[3];
$lev1 = OOCategory::getCategoryById($path1);
if ($lev1->getTypeId() > 1 && $lev1->getTypeId() > $FORM['USR_TYP']) {
$hack = true;
} else {
if ($lev1->getTypeId() > 1 && !$FORM[USR]) {
$hack = true;
}
else {
if ($lev1->getId() == $aid) {
$hack = false;
}
else {
if (sizeof($lev1->getChildren()) != 0) {
$lev2 = OOCategory::getCategoryById($path2);
if ($lev2->getTypeId() > 1 && $lev2->getTypeId() > $FORM['USR_TYP']) {
$hack = true;
} else {
if ($lev2->getTypeId() >1 && !$FORM[USR]) {
$hack = true;
}
else {
if ($lev1->getId() == $aid) {
$hack = false;
}
}
}
}
}
}
}
if ($hack) {
header("Location: http://".$_SERVER['HTTP_HOST']."/index.php?article_id=".$errorArticleId."&clang=".$REX['CUR_CLANG']);
exit;
}Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste