So lets get to the point.
1) modify index.php
uncomment on line 34
Code: Select all
session_start();
Code: Select all
<?php
if(isset($_POST['form_aktion']) && $_POST['form_aktion'] == 'login') {
$login_passed = 0;
$wcs_user = slweg(trim($_POST['form_loginname']));
$wcs_pass = slweg(trim($_POST['form_password']));
$sql_query = "SELECT * FROM ".DB_PREPEND."phpwcms_user WHERE usr_login='".
aporeplace($wcs_user)."' AND (usr_pass=PASSWORD('".
aporeplace($wcs_pass)."') OR usr_pass='".
aporeplace(md5($wcs_pass))."') AND usr_aktiv=1;";
if($result = mysql_query($sql_query)) {
if($row = mysql_fetch_array($result)) {
$_SESSION["wcs_user"] = $wcs_user;
$_SESSION["wcs_pass"] = $wcs_pass;
$_SESSION["wcs_user_name"] = ($row["usr_name"]) ? $row["usr_name"] : $wcs_user;
$_SESSION["wcs_user_id"] = $row["usr_id"];
$_SESSION["wcs_user_aktiv"] = $row["usr_aktiv"];
$_SESSION["wcs_user_rechte"] = $row["usr_rechte"];
$_SESSION["wcs_user_email"] = $row["usr_email"];
$_SESSION["wcs_user_avatar"] = $row["usr_avatar"];
$_SESSION["wcs_user_logtime"] = time();
$_SESSION["wcs_user_admin"] = $row["usr_admin"];
$_SESSION["wcs_user_thumb"] = 1;
if($row["usr_lang"]) {
$_SESSION["wcs_user_lang"] = $row["usr_lang"];
}
$_SESSION["structure"] = unserialize($row["usr_var_structure"]);
$_SESSION["klapp"] = unserialize($row["usr_var_privatefile"]);
$_SESSION["pklapp"] = unserialize($row["usr_var_publicfile"]);
$login_passed = 1;
$_SESSION["frontend_user_in"]=true; //changed this one
}
mysql_free_result($result);
}
}
?>
Then I made a custom form and named it frm_Login.php (also borrowed from login.php, just removed things I fought I don't need:? )
Code: Select all
<table border="0" cellpadding="0" cellspacing="0">
<form name="login_formular" method="post" action="<?php echo $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'] ?>" autocomplete="off">
<tr><td width="389" class="title"><?php echo $GLOBALS["template_default"]["login_text"]; ?></td></tr>
<?php
if($err) {
echo '<tr><td><img src="img/leer.gif" width="1" height="10"></td></tr>';
echo '<tr><td class="error"><strong>'.$GLOBALS["template_default"]["login_error"].'</strong></td></tr>';
}
?>
<tr><td><img src="img/leer.gif" width="1" height="12"></td></tr>
<tr><td class="v10"><?php echo $GLOBALS["template_default"]["login_username"] ?>:</td></tr>
<tr><td><input name="form_loginname" type="text" id="form_loginname" class="f11b" style="width:250px;" size="30" maxlength="30" value="<?php echo html_specialchars($wcs_user); ?>"></td></tr>
<tr><td><img src="img/leer.gif" width="1" height="3"></td></tr>
<tr><td class="v10"><?php echo $GLOBALS["template_default"]["login_userpass"] ?>:</td></tr>
<tr><td><input name="form_password" type="password" id="form_password" class="f11b" style="width:250px;" size="30" maxlength="20"></td></tr>
<tr><td><img src="img/leer.gif" width="1" height="3"></td></tr>
<tr><td><img src="img/leer.gif" width="1" height="18"></td></tr>
<tr><td><input name="Submit" type="submit" class="button10" value="<?php echo $GLOBALS["template_default"]["login_button"] ?>"><input name="form_aktion" type="hidden" id="form_aktion" value="login"></td></tr>
</form>
</table>
Code: Select all
// login form template
$template_default["login_text"] = "Please Log in";
$template_default["login_error"] ="Wrong password";
$template_default["login_username"] ="Username";
$template_default["login_userpass"] ="Password";
$template_default["login_button"] ="Login";
I had to change include\inc_front\content_func.inc.php
Find out code like
Code: Select all
$content["all"] = str_replace('{CONTENT}', $content["main"], $content["all"]);
Code: Select all
$cat=$content["cat_id"];
if($content["struct"][$cat]["acat_regonly"]==1)
{
//echo "Private area!!!";
include_once("authorize.php");
if(!$_SESSION["frontend_user_in"]) {
//show log in form, instead of page content";
$content["main"]="{PHP:frm_Login.php}";
}
}
$content["all"] = str_replace('{CONTENT}', $content["main"], $content["all"]);
well I hope this helped someone