Bevor ihr mich steinigt, ich weiß es ist ein alter Thread. Wollte mal den Coder für das Modul Pflichtfelder 1.3 (wagsch) mal was fragen.
In deinem Modul Pflichtfelder 1.3 fehlt die Datei includes/func/user.php.
Ich verzweifle mittlerweilen, da mir die Daten nicht in die userchecks geschrieben werden.
Hier meine user.php
function user_regist ($name, $mail, $pass) {
global $allgAr, $lang;
if ( !CheckMail($mail) ) {
$_SESSION['CheckMail'] = false;
return false;
}
$erg = db_query("SELECT id FROM prefix_user WHERE name = BINARY '".$name."'");
if (db_num_rows($erg) > 0) {
return (false);
}
if ( $allgAr['forum_regist_user_pass'] == 0 ) {
$new_pass = genkey(8);
} else {
$new_pass = $pass;
}
$md5_pass = md5($new_pass);
$confirmlinktext = '';
# confirm insert in confirm tb not confirm insert in user tb
if ( $allgAr['forum_regist_confirm_link'] == 1 ) {
# confirm link + text ... bit of shit put it in languages file
$page = $_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"];
$id = md5 (uniqid (rand()));
$confirmlinktext = "\n".$lang['registconfirm']."\n\n".sprintf($lang['registconfirmlink'], $page, $id );
db_query("INSERT INTO prefix_usercheck (`check`,name,email,pass,datime,ak)
VALUES ('".$id."','".$name."','".$mail."','".$md5_pass."',NOW(),1)");
} else {
db_query("INSERT INTO prefix_user (name,pass,recht,regist,llogin,email,status,opt_mail,opt_pm)
VALUES('".$name."','".$md5_pass."',-1,'".time()."','".time()."','".$mail."',1,1,1)");
$userid = db_last_id();
}
$regmail = sprintf($lang['registemail'],$name, $confirmlinktext, $name, $new_pass);
icmail($mail,'Anmeldung',$regmail); # email an user
return (true);
}
function user_remove($uid){
$row = @db_fetch_object(db_query("SELECT recht,avatar FROM prefix_user WHERE id = ".$uid));
if ( $uid <> 1 AND ($_SESSION['authid'] == $uid OR $_SESSION['authid'] == 1 OR (is_coadmin() AND $_SESSION['authright'] < $row->recht))) {
db_query("DELETE FROM prefix_user WHERE id = ".$uid);
db_query("DELETE FROM prefix_userfields WHERE uid = ".$uid);
db_query("DELETE FROM prefix_groupusers WHERE uid = ".$uid);
db_query("DELETE FROM prefix_modulerights WHERE uid = ".$uid);
db_query("DELETE FROM prefix_pm WHERE eid = ".$uid);
db_query("DELETE FROM prefix_online WHERE uid = ".$uid);
//Usergallery entfernen
$sql = db_query("SELECT id,endung FROM prefix_usergallery WHERE uid = ".$uid);
while( $r = db_fetch_object($sql) ){
@unlink("include/images/usergallery/img_$r->id.$r->endung");
@unlink("include/images/usergallery/img_thumb_$r->id.$r->endung");
}
db_query("DELETE FROM prefix_usergallery WHERE uid = ".$uid);
//Avatar
@unlink($row->avatar);
}
}
function sendpm ($sid,$eid,$ti,$te,$status = 0) {
db_query("INSERT INTO `prefix_pm` (sid,eid,time,titel,txt,status) VALUES (".$sid.",".$eid.",'".time()."','".$ti."','".$te."',".$status.")");
}
function sendpm1 ($sid,$eid,$ti,$te,$status = 0) {
db_query("INSERT INTO `prefix_pm_protest` (sid,eid,time,titel,txt,status) VALUES (".$sid.",".$eid.",'".time()."','".$ti."','".$te."',".$status.")");
}
?>
Und hier die confirm.php
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
$title = $allgAr['title'].' :: User :: Confirm';
$hmenu = $extented_forum_menu.'<a class="smalfont" href="?user">User</a><b> » </b>Confirm'.$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1);
$design->header();
$abgelaufen = time() - 2592000; # 30 tage
$abgelaufen = date('Y-m-d H:i:s',$abgelaufen);
db_query("DELETE FROM prefix_usercheck WHERE datime < '".$abgelaufen."'");
$erg = db_query("SELECT * FROM prefix_usercheck WHERE `check` = '".escape($_GET['check'], 'string')."'");
if ( db_num_rows($erg) == 1 ) {
$row = db_fetch_assoc($erg);
switch ( $row['ak'] ) {
# confirm regist
case 1 :
if ( 0 == db_count_query("SELECT COUNT(*) FROM prefix_user WHERE name = BINARY '".$row['name']."'") ) {
db_query("INSERT INTO prefix_user (name,pass,recht,regist,llogin,email,opt_pm,opt_pm_popup,opt_mail,status,geschlecht,gebdatum,wohnort,xbox,staat,icq,skype,msn,sig)
VALUES('".$row['name']."','".$row['pass']."',-1,'".time()."','".time()."','".$row['email']."','".$row['opt_pm']."','".$row['opt_pm_popup']."','".$row['opt_mail']."',1,'".$row['geschlecht']."','".$row['geburtstag']."','".$row['ort']."','".$row['xbox']."','".$row['staat']."','".$row['icq']."','".$row['skype']."','".$row['msn']."','".$row['sig']."')");
echo $lang['confirmregist'];
} else {
echo $lang['confirmregistfailed'];
}
break;
# confirm new pass
case 2 :
db_query("UPDATE prefix_user SET pass = '".$row['pass']."' WHERE name = BINARY '".$row['name']."'");
echo $lang['confirmpassword'];
break;
# confirm new email
case 3 :
list ($id, $muell) = explode('||', $row['check']);
db_query("UPDATE prefix_user SET email = '".$row['email']."' WHERE id = ". escape($id, 'integer'));
echo $lang['confirmemail'];
break;
# ak 4 wurde besetzt fuer joinus anfragen...
case 4 : break;
}
db_query("DELETE FROM prefix_usercheck WHERE `check` = '".$row['check']."'");
} else {
echo $lang['confirmfailure'];
}
$design->footer();
?>