drematom
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору censssored Ну, незнаю даже как сказать.. Я бы тя прям да расцеловал бы, мужик))))))))) У сё у порядке, кроме: Цитата: else заменить на if, после него добавить else - который и будет отвечать за регистрацию админом. Т.е. вся переделка - это проверки расширить. | вот это не доходит до длинной шейи жераФФа ) Там есть строки их всех заменит на ИФ? Покаж как кодом заменить, уж потом я им такой замен устрою! ) P.S. Ценсоред, ну Веть Бог создал этот мир с 4удесными людьми, Дай Бог тебе всего самого наилучшего, заглядывай, помогай Нам, поверь ОСТАЮТСЯ от человека это Дела и память! Спасибо большое, думаю со мной многие согласятся здесь! Добавлено: <?php //======================================================= // CMS Koobi 6.0 Pro Shop [rus] [xx] //======================================================= // censored! [antichat.ru] // Arcanum [overdoze.ru] // Master Daemon [overdoze.ru] //======================================================= if(!defined("BASEDIR")) exit; $sql = $db->Query("SELECT regtype_choice FROM " . PREFIX . "_settings WHERE id = '1'"); $row = $sql->fetchrow(); $sql->close(); $RegSofort = ($row->regtype_choice == 'now') ? 1 : ""; $StandLand = 'RU'; // wenn kein Shop, dann bitte hier das vorselektierte Ldnderkuerzel angeben $use_securecode = false; //================================================================ // Kann Sicherheitscode verwendet werden? //================================================================ $use_securecode = (SecureUse()) ? true : false; if($use_securecode) { $tmpl->assign('use_code', 1); if(!isset($_REQUEST['send']) && $_REQUEST['send']=="") { giveSecure(); } elseif (isset($_REQUEST['send']) && $_REQUEST['send']=='1') { $scode_form = $_REQUEST['scode']; $scode_ses = $_SESSION['scode']; //================================================================ // Wichtig: Sicherheitscode in der Session berschreiben //================================================================ $secureCode = rand_string(4); $_SESSION['scode'] = $secureCode; $tmpl->assign('secureCode', $secureCode); $tmpl->assign('use_code', 1); $tmpl->assign('secureIMG', (!extension_loaded('gd')) ? '<h1>'.$secureCode.'</h1>' : '<img class="absmiddle" src="inc/secure/secure.php?'.time().'" alt="" />'); } } if( $use_securecode == true ) { $use_securecode = true; $tmpl->assign('use_code', 1); } $mtime = time()-1800; //================================================================ // Seitenname //================================================================ $sname = simpletitle($lang['register']); //================================================================ // Welche Felder muessen ausgefuellt werden? //================================================================ $sql_r = $db->Query("SELECT * FROM ".PREFIX."_requiredfields"); while($row_r = $sql_r->fetchrow()) { if($row_r->required_field == 1 || $row_r->name == 'country') { $tmpl->assign('show_' . strtolower($row_r->name), 1); define("REQUIRED_" . strtoupper($row_r->name) . "", 1); } else { $tmpl->assign('show_' . strtolower($row_r->name), $row_r->show_field); define("REQUIRED_" . strtoupper($row_r->name) . "", $row_r->required_field); } } $tmpl->assign('StandLand', $StandLand); $tmpl->assign('page', $HTTP_SERVER_VARS['HTTP_REFERER']); if(!checkactive('register')) { $EOUT = msg("error_once","notactive_newreg", str_replace("__URL__", "index.php", $lang['redirect']), "index.php",0,7) ; $NOOUT = 1; } if(ISLOGGED==1) header("Location:index.php"); //================================================================ // Registrierung absenden //================================================================ if($_REQUEST['send']==1) { $ok = true; if($_REQUEST['signup']==1) { if( (REQUIRED_COMPANY==1) && (($_REQUEST['person']=="company") && ($_REQUEST['company']=="") ) ) { $error = emsg("shop_no_company_name"); $ok = false; } //================================================================ // Sicherheitscode pruefen //================================================================ if($scode_form != $scode_ses && ($use_securecode)) { $tmpl->assign('secureError', 1); $error .= emsg("securecodeiswrong"); $tmpl->assign('codeerror',1); $tmpl->assign('codeerror_t', emsg_reg("securecodeiswrong")); $ok = false; } //================================================================ // Wenn Regeln nicht akzeptiert... //================================================================ if( (REQUIRED_AGB==1) && ($_REQUEST['accept_agb']!=1) ) { $error .= emsg("shop_error_agb_notaccept"); $tmpl->assign('agberror',1); $tmpl->assign('agerror_t', emsg_reg("shop_error_agb_notaccept")); $ok = false; } //================================================================ // Wenn Shop, weitere Felder pruefen //================================================================ if(ISSHOP==1) { //================================================================ // Vorname //================================================================ $name = $_REQUEST['name']; if( (REQUIRED_FIRSTNAME==1) && ($name =='' || strlen($name) < 3 || @ereg("[^ ._A-Za-z - - 0-9-]", $name)) ) { $error .= emsg("shop_error_name"); $tmpl->assign('nameerror',1); $tmpl->assign('nameerror_t', emsg_reg("shop_error_name")); $ok = false; } //================================================================ // Nachname //================================================================ $lastname = $_REQUEST['lastname']; if( (REQUIRED_LASTNAME==1) && ($lastname =='' || strlen($lastname) < 3 || @ereg("[^ ._A-Za-z - - 0-9-]", $lastname)) ) { $error .= emsg("shop_lastnameerror_t"); $tmpl->assign('nameerror2',1); $tmpl->assign('lastnameerror_t', emsg_reg("shop_lastnameerror_t")); $ok = false; } //================================================================ // Strasse //================================================================ $street = $_REQUEST['street']; if( (REQUIRED_STREET==1) && ($street =='' || strlen($street) < 3 || @ereg("[^ ._A-Za-z - - 0-9-]", $street)) ) { $error .= emsg("shop_streeterror_t"); $tmpl->assign('streeterror',1); $tmpl->assign('streeterror_t', emsg_reg("shop_streeterror_t")); $ok = false; } //================================================================ // Postleitzahl //================================================================ if( (REQUIRED_ZIP==1) && (@ereg("[^0-9]", $_REQUEST['zip']) || empty($_REQUEST['zip'])) ) { $error .= emsg("shop_ziperror_t"); $tmpl->assign('ziperror',1); $tmpl->assign('ziperror_t', emsg_reg("shop_ziperror_t")); $ok = false; } //================================================================ // Wohnort //================================================================ $ufrom = $_REQUEST['user_from']; if( (REQUIRED_USERFROM==1) && ($ufrom =='' || strlen($ufrom) < 3 || @ereg("[^ ._A-Za-z - - 0-9-]", $ufrom)) ) { $error .= emsg("shop_fromerror_t"); $tmpl->assign('fromerror',1); $tmpl->assign('fromerror_t', emsg_reg("shop_fromerror_t")); $ok = false; } //================================================================ // Telefon //================================================================ $phone = $_REQUEST['phone']; if( (REQUIRED_PHONE==1) && ($phone == '' || strlen($phone) < 5 || @ereg("[^ /)(+._A-Za-z - - 0-9-]", $phone)) ) { $error .= emsg("shop_phoneerror_t"); $tmpl->assign('phoneerror',1); $tmpl->assign('phoneerror_t', emsg_reg("shop_phoneerror_t")); $ok = false; } } //================================================================ // Wenn Geburtstag nicht angegeben... //================================================================ if((isset($_REQUEST['d_b'])) && (REQUIRED_BIRTHDAY==1) && ((empty($_REQUEST['d_b'])) || (empty($_REQUEST['m_b'])) || (empty($_REQUEST['y_b']))) ) { if(ISSHOP==1) { $error .= emsg("shop_birtherror_t"); $tmpl->assign('birtherror',1); $tmpl->assign('birtherror_t', emsg_reg("shop_birtherror_t")); $ok = false; } } } $puname = str_replace(array("[","]",":","(",")","="), "", $_REQUEST['uname']); if(@ereg("[^ ._A-Za-z - - 0-9-]", $puname)) { $error .= emsg("shop_unameerror_t"); $tmpl->assign('unameerror',1); $tmpl->assign('unameerror_t', emsg_reg("shop_unameerror_t")); $ok = false; } if(strlen($puname)<3){ $error .= emsg("shop_unameerror_t"); $tmpl->assign('unameerror',1); $tmpl->assign('unameerror_t', emsg_reg("shop_unameerror_t")); $ok = false; } //================================================================ // Ist Benutzername in Bannliste eingetragen? //================================================================ if( (!empty($_REQUEST['uname'])) && (bannedname($puname)) ) { $error .= emsg("shop_unameerror2_t"); $tmpl->assign('unameerror',1); $tmpl->assign('unameerror_t', emsg_reg("shop_unameerror2_t")); $ok = false; } //================================================================ // Wenn kein Fehler, pruefen, ob dieser Name schon existiert //================================================================ if($ok) { $sql = $db->Query("SELECT uid FROM " . PREFIX . "_user WHERE uname='".escs($_REQUEST['uname'])."'"); $c= $sql->numrows(); if($c > 0) { $error .= emsg("shop_unameinuse_t"); $tmpl->assign('unameerror',1); $tmpl->assign('unameerror_t', emsg_reg("shop_unameinuse_t")); $ok = false; } if($ok) { $adminuname = "uname='".escs(iform($_REQUEST['uname'],"65",""))."',"; } } //================================================================ // Stimmen beide Email-Adressen ueberein? // Sind beide Emai-Adressen korrekt? //================================================================ $email = $_REQUEST['email']; $email2 = $_REQUEST['email2']; if( (!empty($_REQUEST['email'])) && (bannedemail($email)) ) { $error .= emsg("shop_emailinuse_t"); $tmpl->assign('emailerror',1); $tmpl->assign('emailerror_t', emsg_reg("shop_emailinuse_t")); $tmpl->assign('emailerror2_t', emsg_reg("shop_emailinuse_t")); $ok = false; } if(!@ereg("^[ -._A-Za-z - - 0-9-]+(\.[_A-Za-z - - 0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,4})$", $email)) { $error .= emsg("emailerror"); $tmpl->assign('emailerror',1); $tmpl->assign('emailerror_t', emsg_reg("shop_emailerror_t")); $ok = false; } if(!@ereg("^[ -._A-Za-z - - 0-9-]+(\.[_A-Za-z - - 0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,4})$", $email2)) { $error .= emsg("emailerror"); $tmpl->assign('emailerror',1); $tmpl->assign('emailerror2_t', emsg_reg("shop_emailerror_t")); $ok = false; } if($email != $email2){ $error .= emsg("emailerror"); $tmpl->assign('emailerror',1); $tmpl->assign('emailerror_t', emsg_reg("emailnotmatch")); $tmpl->assign('emailerror2_t', emsg_reg("emailnotmatch")); $ok = false; } //================================================================ // Wurden beide Kennwvrter ausgefuellt, ist es mind. 5 Zeichen lang // und stimmen sie ueberein? //================================================================ if(empty($_REQUEST['pass'])) { $error .= emsg("error_nopw"); $tmpl->assign('pwerror',1); $tmpl->assign('passworderror_t', emsg_reg("shop_pwerror_t")); $ok = false; } //================================================================ // Wenn Kennwort nicht wiederholt wird... //================================================================ if(empty($_REQUEST['pass2'])) { $error .= emsg("error_nopw2"); $tmpl->assign('pwerror',1); $tmpl->assign('passworderror2_t', emsg_reg("shop_pwerror2_t")); $ok = false; } //================================================================ // Werden Sonderzeichen verwendet? //================================================================ if($ok) { if(isset($_REQUEST['pass']) && $_REQUEST['pass']!="") { $pwcheck = str_replace(array("[","]",":","(",")","="), "", $_REQUEST['pass']); if(@ereg("[^ _A-Za-z - - 0-9-]", $pwcheck)) { $error .= emsg("error_pnospecial"); $tmpl->assign('pwerror1',1); $tmpl->assign('passworderror_t', emsg_reg("shop_pwerror3_t")); $tmpl->assign('passworderror2_t', emsg_reg("shop_pwerror3_t")); $ok = false; } } } $pw1 = iform($_REQUEST['pass'],"35",""); $pw2 = iform($_REQUEST['pass2'],"35",""); //================================================================ // Stimmen beide Kennwoerter ueberein? //================================================================ if($ok) { if((isset($_REQUEST['pass']) && isset($_REQUEST['pass2'])) && ($pw1 != $pw2)) { $error .= emsg("error_reg_pw"); $tmpl->assign('pwerror',1); $tmpl->assign('passworderror_t', emsg_reg("shop_pwerror4_t")); $tmpl->assign('passworderror2_t', emsg_reg("shop_pwerror4_t")); $ok = false; } } //================================================================ // Ist Kennwort kuerzer als 5 Zeichen? //================================================================ if($ok) { if(isset($_REQUEST['pass']) && ($_REQUEST['pass']!="") && (strlen($pw1) <5) ) { $error .= emsg("error_ptoshort"); $tmpl->assign('pwerror',1); $tmpl->assign('passworderror_t', emsg_reg("shop_pwerror5_t")); $ok = false; } } $sql = $db->Query("SELECT email FROM " . PREFIX . "_user WHERE email='".escs($email)."'"); $num = $sql->numrows(); if($num == 1) { $error .= emsg("emailerror"); $tmpl->assign('emailerror',1); $tmpl->assign('emailerror_t', emsg_reg("shop_emailinuse_t")); $tmpl->assign('emailerror2_t', emsg_reg("shop_emailinuse_t")); $ok = false; } //================================================================ // Wenn Fehler vorhanden sind, Fehlerroutine ausgeben... //================================================================ if((!$ok) && (isset($_REQUEST['send']))) { $tmpl->assign('title_error', $lang['error']); $tmpl->assign('iserror', 1); $tmpl->assign('error_p', $error); } } //================================================================ // Alles in Ordnung... //================================================================ if($ok==true) { if( $_REQUEST['email']!= '' ) { $Status = ($RegSofort == 1) ? 1 : 0; $dbq = "'" . $_REQUEST['d_b'] . "." . $_REQUEST['m_b'] . "." . $_REQUEST['y_b'] . "'"; $q = "INSERT INTO ".PREFIX."_user ( user_canpn, user_viewemail, recieve_newsletter, uid, ugroup, uname, name, lastname, zip, street, email, pass, status, user_regdate, user_from, country, person, phone, fax, title, show_public, user_birthday, company, ustid, user_icq, user_aim, user_skype, url ) VALUES ( 'yes', 'yes', '1', '', '3', '$_REQUEST[uname]', '$_REQUEST[name]', '$_REQUEST[lastname]', '$_REQUEST[zip]', '$_REQUEST[street]', '$_REQUEST[email]', '".md5(md5($_REQUEST['pass']))."', '".$Status."', '".time()."', '$_REQUEST[user_from]', '$_REQUEST[country]', '$_REQUEST[person]', '$_REQUEST[phone]', '$_REQUEST[fax]', '$_REQUEST[title]', '1', ". $dbq . ", '".escs($_REQUEST['company'])."', '".escs($_REQUEST['ustid'])."', '".addslashes($_REQUEST['user_icq'])."', '".addslashes($_REQUEST['user_aim'])."', '".addslashes($_REQUEST['user_skype'])."', '".addslashes($_REQUEST['user_url'])."' )"; $sql = $db->Query($q); $the_uid = $db->InsertId(); $the_code = makepass(); $sql = $db->Query("INSERT INTO ".PREFIX."_activation (code,uid) VALUES ('$the_code','$the_uid')"); //================================================================ // Wenn User sich sofort registrieren darf, Cookie setzen //================================================================ if($RegSofort==1) { @setcookie("kuid", $the_uid, time()+365*24*3600, '/'); @setcookie("kpass",md5(md5($_REQUEST['pass'])),time()+365*24*3600, '/'); } putlog("NEW USER: $_REQUEST[email]",2); //================================================================ // Registrierungs-E-Mail senden //================================================================ $subject_user = str_replace("__HOMEPAGENAME__", $pref['hpname'], $lang['shop_new_registration_subject']); $subject_admin = str_replace("__HOMEPAGENAME__", $pref['hpname'], $lang['shop_new_registration_subject_admin']); $message = str_replace("__PASS__", $_REQUEST['pass'], $message); $message = str_replace("__HOMEPAGENAME__", $pref['hpname'], $message); if(ISSHOP==1) { $preheader = ($_REQUEST['title']==1) ? $lang['shop_prefmail_header_male'] : $lang['shop_prefmail_header_female']; } else { $preheader = $lang['header_mail_nonshop']; } if($_REQUEST['title']==3) $preheader = $lang['shop_prefmail_header_company']; $prefl = (SSLMODE==1) ? "https://" : "http://"; $link = $prefl . $_SERVER['HTTP_HOST'].str_replace("/index.php","",$_SERVER['PHP_SELF']); $preheader2 = ($_REQUEST['title']==3) ? "" : " $_REQUEST[firstname] $_REQUEST[lastname]"; //================================================================ // Mail an Neukunde //================================================================ $isfromshop = (ISSHOP==1) ? '&redirto=shop' : ''; $rd_url = (ISSHOP==1 && (isset($_REQUEST['redir']) && $_REQUEST['redir']!='') ) ? $_REQUEST['redir'] : "index.php?p=index&area=" . $_REQUEST['area']; $preheader3 = str_replace('__ALINK__', $link . "/index.php?p=activate&code=$the_code&uid=$the_uid" . "$isfromshop", ( (ISSHOP==1) ? $lang['the_activation_text_shopreg'] : $lang['the_activation_text']) ); $preheader3 = str_replace('__BLINK__', $link . "/index.php?p=activate",$preheader3); $preheader3 = str_replace('__CODE__',$the_code,$preheader3); $preheader3 = str_replace('__BASKETLINK__', "{$link}/{$rd_url}&action=showbasket", $preheader3); $message = $preheader . $preheader2 .",\n"; $message .= $preheader3; $message .= str_replace('__HOMEPAGENAME__', $pref['hpname'], $lang['shop_new_registration_emailbody']); $message = str_replace('__EMAIL__', $_REQUEST['email'], $message); $message = str_replace('__USERNAME__', $_REQUEST['uname'], $message); $message = str_replace('__PASSWORD__', $_REQUEST['pass'], $message); $message = str_replace('__LINK__', $link, $message); $message = str_replace('__EMAILFOOTER__', SHOPADRESS, $message); //============================================================== // Wenn Sofortregistrierung, keine Freischaltungs-E-Mail senden! //============================================================== if($RegSofort!=1) { $thismail = new MIMEMail(); $thismail->from_name = $pref['hpname']; $thismail->from_email = (ISSHOP==1) ? SHOPMAILERREPLY : $pref['sendemail']; $thismail->subject = $subject_user; $thismail->to = $_REQUEST['email']; $thismail->headers(); $thismail->addtextpart( false, $message); $thismail->finish(); $thismail->send(); } else { $subject_user_regemail = $lang['reg_new_usersubject']; $message2 = $lang['shop_new_registration_emailbody_user']; $message2 = str_replace('__HOMEPAGENAME__', $pref['hpname'], $message2); $message2 = str_replace('__EMAIL__', $_REQUEST['email'], $message2); $message2 = str_replace('__USERNAME__', $_REQUEST['uname'], $message2); $message2 = str_replace('__PASS__', $_REQUEST['pass'], $message2); $message2 = str_replace('__NAME__',$_REQUEST['name'], $message2); $message2 = str_replace('__LASTNAME__', $_REQUEST['lastname'], $message2); $message2 = str_replace('__STREET__', $_REQUEST['street'], $message2); $message2 = str_replace('__ZIP__', $_REQUEST['zip'], $message2); $message2 = str_replace('__COUNTRY__', $_REQUEST['country'], $message2); $message2 = str_replace('__CITY__', $_REQUEST['user_from'], $message2); $message2 = str_replace('__PHONE__', $_REQUEST['phone'], $message2); $message2 = str_replace('__FAX__', $_REQUEST['fax'], $message2); $message2 = str_replace('__BIRTH__', str_replace('\'','', $dbq), $message2); $message2 = str_replace('__EMAILFOOTER__', SHOPADRESS, $message2); $thismail = new MIMEMail(); $thismail->from_name = $pref['hpname']; $thismail->from_email = $pref['sendemail']; $thismail->subject = $subject_user_regemail; $thismail->to = $_REQUEST['email']; $thismail->headers(); $thismail->addtextpart( false, $message2); $thismail->finish(); $thismail->send(); } //============================================================== // Mail an Admin //============================================================== $message = ''; $message2 = $lang['shop_new_registration_emailbody_admin']; $message2 = str_replace('__HOMEPAGENAME__', $pref['hpname'], $message2); $message2 = str_replace('__EMAIL__', $_REQUEST['email'], $message2); $message2 = str_replace('__USERNAME__', $_REQUEST['uname'], $message2); $message2 = str_replace('__PASSLAST2__', substr($_REQUEST['pass'], -2), $message2); $message2 = str_replace('__NAME__',$_REQUEST['name'], $message2); $message2 = str_replace('__LASTNAME__', $_REQUEST['lastname'], $message2); $message2 = str_replace('__STREET__', $_REQUEST['street'], $message2); $message2 = str_replace('__ZIP__', $_REQUEST['zip'], $message2); $message2 = str_replace('__COUNTRY__', $_REQUEST['country'], $message2); $message2 = str_replace('__CITY__', $_REQUEST['user_from'], $message2); $message2 = str_replace('__PHONE__', $_REQUEST['phone'], $message2); $message2 = str_replace('__FAX__', $_REQUEST['fax'], $message2); $message2 = str_replace('__BIRTH__', str_replace('\'','', $dbq), $message2); $message2 = str_replace('__EMAILFOOTER__', SHOPADRESS, $message2); $thismail = new MIMEMail(); $thismail->from_name = $pref['hpname']; $thismail->from_email = (ISSHOP==1) ? SHOPMAILERREPLY : $pref['sendemail']; $thismail->subject = $subject_admin; $thismail->to = $pref['sendemail']; $thismail->headers(); $thismail->addtextpart( false, $message2); $thismail->finish(); $thismail->send(); if($RegSofort!=1) { $EOUT = msg("register", "the_activation_textaftersignup", str_replace("__URL__", "index.php?p=activate&area=$_REQUEST[area]", $lang['redirect']), "index.php?p=activate&area=$_REQUEST[area]"); $NOOUT = 1; } else { $rd_url = (ISSHOP==1 && (isset($_REQUEST['redir']) && $_REQUEST['redir']!='') ) ? $_REQUEST['redir'] : "index.php?p=index&area=" . $_REQUEST['area']; $EOUT = msg("register", "reg_new_usermessagepop", str_replace("__URL__", $rd_url , $lang['redirect']), $rd_url); $NOOUT = 1; } } } if(ISSHOP!=1) $tmpl->assign('is_optional', 1); $tmpl->assign('startyear', date("Y")-75); $tmpl->assign('endyear', date("Y")-14); $tmpl->assign('content', parsetrue('container/'.container('profile'), $lang['register'], $tmpl->fetch('user/signup.tpl'))); ?> Прошу не обесудьте за этот код, это не ОФФТОП.. просто Цесореду не искать и не рыться, чтобы он мог тыкнуть или прописать код.. я непонимаю, именно о какой он говорит ( |