Visualizzazione risultati 1 fino 6 di 6

Discussione: modifica a file registrazione e log

  1. #1
    Guest

    Predefinito modifica a file registrazione e log

    ciao ho un problema con i file di registrazione e login praticamenti nei campi password e nome pianeta nel file registrazione e nome utente e password nel file di login questa campi diventano gialli e devi cliccare per poterci scrivere quindi è un problema
    eccovi il file di reg:
    Codice HTML:
    <?php
    
    /**
     * reg.php
     *
     * @version 1.1
     * @copyright 2008 by Chlorel for XNova
     */
    
    define('INSIDE'  , true);
    define('INSTALL' , false);
    
    $ugamela_root_path = './';
    include($ugamela_root_path . 'extension.inc');
    include($ugamela_root_path . 'common.' . $phpEx);
    
    includeLang('reg');
    
    $wylosuj = rand(100000,9000000); 
    $kod = md5($wylosuj);
    function sendpassemail($emailaddress, $password) {
    	global $lang, $kod;
    
    	$parse['gameurl']  = GAMEURL;
    	$parse['password'] = $password;
    	$parse['kod']      = $kod;
    	$email             = parsetemplate($lang['mail_welcome'], $parse);
    	$status            = mymail($emailaddress, $lang['mail_title'], $email);
    	return $status;
    }
    
    function mymail($to, $title, $body, $from = '') {
    	$from = trim($from);
    
    	if (!$from) {
    		$from = ADMINEMAIL;
    	}
    
    	$rp     = ADMINEMAIL;
    
    	$head   = '';
    	$head  .= "Content-Type: text/plain \r\n";
    	$head  .= "Date: " . date('r') . " \r\n";
    	$head  .= "Return-Path: $rp \r\n";
    	$head  .= "From: $from \r\n";
    	$head  .= "Sender: $from \r\n";
    	$head  .= "Reply-To: $from \r\n";
    	$head  .= "Organization: $org \r\n";
    	$head  .= "X-Sender: $from \r\n";
    	$head  .= "X-Priority: 3 \r\n";
    	$body   = str_replace("\r\n", "\n", $body);
    	$body   = str_replace("\n", "\r\n", $body);
    
    	return mail($to, $title, $body, $head);
    }
    
    if ($_POST) {
    	$errors    = 0;
    	$errorlist = "";
    
    	$_POST['email'] = strip_tags($_POST['email']);
    	if (!is_email($_POST['email'])) {
    		$errorlist .= "\"" . $_POST['email'] . "\" " . $lang['error_mail'];
    		$errors++;
    	}
    
    	session_start(); 
    		$girilen = $_REQUEST["captcha"]; 
    	if($_SESSION['captcha'] == $girilen){ 
    		echo ""; 
    	}else{ 
    		$errorlist .= $lang['error_captcha']; 
    		$errors++;    
    	}
    
    	if (!$_POST['planet']) {
    		$errorlist .= $lang['error_planet'];
    		$errors++;
    	}
    
    	if (preg_match("/[^A-z0-9_\-]/", $_POST['hplanet']) == 1) {
    		$errorlist .= $lang['error_planetnum'];
    		$errors++;
    	}
    
    	if (!$_POST['character']) {
    		$errorlist .= $lang['error_character'];
    		$errors++;
    	}
    
    	if (strlen($_POST['passwrd']) < 4) {
    		$errorlist .= $lang['error_password'];
    		$errors++;
    	}
    
    	if (preg_match("/[^A-z0-9_\-]/", $_POST['character']) == 1) {
    		$errorlist .= $lang['error_charalpha'];
    		$errors++;
    	}
    
    	if ($_POST['rgt'] != 'on') {
    		$errorlist .= $lang['error_rgt'];
    		$errors++;
    	}
    
    	// Le meilleur moyen de voir si un nom d'utilisateur est pris c'est d'essayer de l'appeler !!
    	$ExistUser = doquery("SELECT `username` FROM {{table}} WHERE `username` = '". mysql_escape_string($_POST['character']) ."' LIMIT 1;", 'users', true);
    	if ($ExistUser) {
    		$errorlist .= $lang['error_userexist'];
    		$errors++;
    	}
    
    	// Si l'on verifiait que l'adresse email n'existe pas encore ???
    	$ExistMail = doquery("SELECT `email` FROM {{table}} WHERE `email` = '". mysql_escape_string($_POST['email']) ."' LIMIT 1;", 'users', true);
    	if ($ExistMail) {
    		$errorlist .= $lang['error_emailexist'];
    		$errors++;
    	}
    
    	if ($_POST['sex'] != ''  &&
    		$_POST['sex'] != 'F' &&
    		$_POST['sex'] != 'M') {
    		$errorlist .= $lang['error_sex'];
    		$errors++;
    	}
    
    	if ($_POST['langer'] != ''  &&
    		$_POST['langer'] != 'pl' &&
    		$_POST['langer'] != 'fr' &&
    		$_POST['langer'] != 'es' &&
    		$_POST['langer'] != 'de' &&
    		$_POST['langer'] != 'en' &&
    		$_POST['langer'] != 'it') {
    		$errorlist .= $lang['error_lang'];
    		$errors++;
    	}
    
    	if ($errors != 0) {
    		message ($errorlist, $lang['Register']);
    	} else {
    		$newpass        = $_POST['passwrd'];
    		$UserName       = CheckInputStrings ( $_POST['character'] );
    		$UserEmail      = CheckInputStrings ( $_POST['email'] );
    		$UserPlanet     = CheckInputStrings ( $_POST['planet'] );
    
    		$md5newpass     = md5($newpass);
    		$Killer = $game_config['aktywacjen'];
    		$killers = md5($Killer);
    		$aktywacja = time()+2678400;
    		// Creation de l'utilisateur
    		$QryInsertUser  = "INSERT INTO {{table}} SET ";
    		$QryInsertUser .= "`username` = '". mysql_escape_string(strip_tags( $UserName )) ."', ";
    		$QryInsertUser .= "`email` = '".    mysql_escape_string( $UserEmail )            ."', ";
    		$QryInsertUser .= "`email_2` = '".  mysql_escape_string( $UserEmail )            ."', ";
    		$QryInsertUser .= "`lang` = '".     mysql_escape_string( $_POST['langer'] )      ."', ";
    		$QryInsertUser .= "`sex` = '".      mysql_escape_string( $_POST['sex'] )         ."', ";
    		$QryInsertUser .= "`id_planet` = '0', ";
    		$QryInsertUser .= "`register_time` = '". time() ."', ";
    		$QryInsertUser .= "`password`='". $md5newpass ."', ";
    		$QryInsertUser .= "`aktywnosc` = '1', ";
    		$QryInsertUser .= "`kod_aktywujacy`='". mysql_escape_string( $kod )              ."', ";
    		$QryInsertUser .= "`kiler`='".          mysql_escape_string( $killers )          ."', ";
    		$QryInsertUser .= "`time_aktyw`='".     mysql_escape_string( $aktywacja )        ."';";
    		doquery( $QryInsertUser, 'users');
    
    		// On cherche le numero d'enregistrement de l'utilisateur fraichement créé
    		$NewUser        = doquery("SELECT `id` FROM {{table}} WHERE `username` = '". mysql_escape_string($_POST['character']) ."' LIMIT 1;", 'users', true);
    		$iduser         = $NewUser['id'];
    
    		// Recherche d'une place libre !
    		$LastSettedGalaxyPos  = $game_config['LastSettedGalaxyPos'];
    		$LastSettedSystemPos  = $game_config['LastSettedSystemPos'];
    		$LastSettedPlanetPos  = $game_config['LastSettedPlanetPos'];
    		while (!isset($newpos_checked)) {
    			for ($Galaxy = $LastSettedGalaxyPos; $Galaxy <= MAX_GALAXY_IN_WORLD; $Galaxy++) {
    				for ($System = $LastSettedSystemPos; $System <= MAX_SYSTEM_IN_GALAXY; $System++) {
    					for ($Posit = $LastSettedPlanetPos; $Posit <= 4; $Posit++) {
    						$Planet = round (rand ( 4, 12) );
    
    						switch ($LastSettedPlanetPos) {
    							case 1:
    								$LastSettedPlanetPos += 1;
    								break;
    							case 2:
    								$LastSettedPlanetPos += 1;
    								break;
    							case 3:
    								if ($LastSettedSystemPos == MAX_SYSTEM_IN_GALAXY) {
    									$LastSettedGalaxyPos += 1;
    									$LastSettedSystemPos  = 1;
    									$LastSettedPlanetPos  = 1;
    									break;
    								} else {
    									$LastSettedPlanetPos  = 1;
    								}
    								$LastSettedSystemPos += 1;
    								break;
    						}
    						break;
    					}
    					break;
    				}
    				break;
    			}
    
    			$QrySelectGalaxy  =	"SELECT * ";
    			$QrySelectGalaxy .= "FROM {{table}} ";
    			$QrySelectGalaxy .= "WHERE ";
    			$QrySelectGalaxy .= "`galaxy` = '". $Galaxy ."' AND ";
    			$QrySelectGalaxy .= "`system` = '". $System ."' AND ";
    			$QrySelectGalaxy .= "`planet` = '". $Planet ."' ";
    			$QrySelectGalaxy .= "LIMIT 1;";
    			$GalaxyRow = doquery( $QrySelectGalaxy, 'galaxy', true);
    
    			if ($GalaxyRow["id_planet"] == "0") {
    				$newpos_checked = true;
    			}
    
    			if (!$GalaxyRow) {
    				CreateOnePlanetRecord ($Galaxy, $System, $Planet, $NewUser['id'], $UserPlanet, true);
    				$newpos_checked = true;
    			}
    			if ($newpos_checked) {
    				doquery("UPDATE {{table}} SET `config_value` = '". $LastSettedGalaxyPos ."' WHERE `config_name` = 'LastSettedGalaxyPos';", 'config');
    				doquery("UPDATE {{table}} SET `config_value` = '". $LastSettedSystemPos ."' WHERE `config_name` = 'LastSettedSystemPos';", 'config');
    				doquery("UPDATE {{table}} SET `config_value` = '". $LastSettedPlanetPos ."' WHERE `config_name` = 'LastSettedPlanetPos';", 'config');
    			}
    		}
    		// Recherche de la reference de la nouvelle planete (qui est unique normalement !
    		$PlanetID = doquery("SELECT `id` FROM {{table}} WHERE `id_owner` = '". $NewUser['id'] ."' LIMIT 1;", 'planets', true);
    
    		// Mise a jour de l'enregistrement utilisateur avec les infos de sa planete mere
    		$QryUpdateUser  = "UPDATE {{table}} SET ";
    		$QryUpdateUser .= "`id_planet` = '". $PlanetID['id'] ."', ";
    		$QryUpdateUser .= "`current_planet` = '". $PlanetID['id'] ."', ";
    		$QryUpdateUser .= "`galaxy` = '". $Galaxy ."', ";
    		$QryUpdateUser .= "`system` = '". $System ."', ";
    		$QryUpdateUser .= "`planet` = '". $Planet ."' ";
    		$QryUpdateUser .= "WHERE ";
    		$QryUpdateUser .= "`id` = '". $NewUser['id'] ."' ";
    		$QryUpdateUser .= "LIMIT 1;";
    		doquery( $QryUpdateUser, 'users');
    
    		// Mise a jour du nombre de joueurs inscripts
    		doquery("UPDATE {{table}} SET `config_value` = `config_value` + '1' WHERE `config_name` = 'users_amount' LIMIT 1;", 'config');
    		doquery("UPDATE {{table}} SET `config_value` = `config_value` + '1' WHERE `config_name` = 'aktywacjen' LIMIT 1;", 'config');
    
    		$Message  = $lang['thanksforregistry'];
    		if (sendpassemail($_POST['email'], "$newpass")) {
    			$Message .= " (" . htmlentities($_POST["email"]) . ")";
    		} else {
    			$Message .= " (" . htmlentities($_POST["email"]) . ")";
    			$Message .= "<br><br>". $lang['error_mailsend'] ." <b>" . $newpass . "</b>";
    		}
    		message( $Message, $lang['reg_welldone']);
    	}
    } else {
    	// Afficher le formulaire d'enregistrement
    	$parse               = $lang;
    	$parse['servername'] = $game_config['game_name'];
    
    	display(parsetemplate(gettemplate('registry_form'), $parse), $lang['registry'], false);
    }
    
    // -----------------------------------------------------------------------------------------------------------
    // History version
    // 1.0 - Version originelle
    // 1.1 - Menage + rangement + utilisation fonction de creation planete nouvelle generation
    ?>

  2. #2
    Guest

    Predefinito

    e di login
    Codice HTML:
    <?php
    
    /**
     * login.php
     *
     * @version 1.0
     * @copyright 2008 by ?????? for XNova
     */
    
    define('INSIDE'  , true);
    define('INSTALL' , false);
    
    $InLogin = true;
    
    $ugamela_root_path = './';
    include($ugamela_root_path . 'extension.inc');
    include($ugamela_root_path . 'common.' . $phpEx);
    
    	includeLang('login');
    
    	if ($_POST) {
    		$login = doquery("SELECT * FROM {{table}} WHERE `username` = '" . mysql_escape_string($_POST['username']) . "' LIMIT 1", "users", true);
    
    		if ($login) {
    			if ($login['password'] == md5($_POST['password'])) {
    				if (isset($_POST["rememberme"])) {
    					$expiretime = time() + 31536000;
    					$rememberme = 1;
    				} else {
    					$expiretime = 0;
    					$rememberme = 0;
    				}
    
    				@include('config.php');
    				$cookie = $login["id"] . "/%/" . $login["username"] . "/%/" . md5($login["password"] . "--" . $dbsettings["secretword"]) . "/%/" . $rememberme;
    				setcookie($game_config['COOKIE_NAME'], $cookie, $expiretime, "/", "", 0);
    
    				unset($dbsettings);
    				header("Location: ./frames.php");
    				exit;
    			} else {
    				message($lang['Login_FailPassword'], $lang['Login_Error']);
    			}
    		} else {
    			message($lang['Login_FailUser'], $lang['Login_Error']);
    		}
    	} else {
    		$parse = $lang;
    		$query = doquery('SELECT username FROM {{table}} ORDER BY register_time DESC', 'users', true);
    		$parse['last_user'] = $query['username'];
    		$query = doquery("SELECT COUNT(DISTINCT(id)) FROM {{table}} WHERE onlinetime>" . (time()-900), 'users', true);
    		$parse['online_users'] = $query[0];
    		$parse['users_amount'] = $game_config['users_amount'];
    		$parse['servername'] = $game_config['game_name'];
    		$parse['forum_url'] = $game_config['forum_url'];
    		$parse['PasswordLost'] = $lang['PasswordLost'];
    
    		$page = parsetemplate(gettemplate('login_body'), $parse);
    		display($page, $lang['Login']);
    	}
    
    // -----------------------------------------------------------------------------------------------------------
    // History version
    ?>
    ho fatto doppio post perchè nn mi ci stavano i caratteri

  3. #3
    L'avatar di EuroSalute
    EuroSalute non è connesso AlterVistiano
    Data registrazione
    12-05-2003
    Messaggi
    969

    Predefinito

    dovresti postare l'html del form dove si inseriscono i campi per la registrazione e il login....
    LOTTO MATEMATICO-SCENTIFICO che FUNZIONA:
    Scripts di Calcolo Automatico Metodologie http://eurosalute.altervista.org

    VINCI OGNI SETTIMANA CON IL NUOVO METODO 5
    FAI IL TEST CON L'ANALISI VINCITE

  4. #4
    Guest

    Predefinito

    intendi questo?
    Codice HTML:
    var ajax = new sack();
    
    function showInfo(id) {
    	printMessage(id, 'infotext');
    	document.getElementById('statustext').innerHTML = "";
    }
    
    function wait() {
    	return;
    }
    
    checkUsername.oldname = "";
    checkUsername.lastcheck = "103";
    function checkUsername() {
    	var username = document.forms[0].elements[0].value;
    	if (username.length > 2 && username.length < 20) {
    		if (username != checkUsername.oldname) {
    			checkUsername.oldname = username;
    			remoteCheckUsername();
    			return checkUsername.lastcheck;
    		} else {
    			return checkUsername.lastcheck;
    		}
    	} else {
    		checkUsername.lastcheck = "103";
    		return "103";
    	}
    }
    
    
    checkEmail.oldmail = "";
    checkEmail.lastcheck = "104";
    function checkEmail() {
    	var email = document.forms[0].elements[1].value;
    	if (email.length >= 3 && email.length < 64) {
    		if (email != checkEmail.oldmail) {
    			checkEmail.oldmail = email;
    			m = email.match(/[a-zA-Z0-9]+@+[a-zA-Z0-9]+[.]+[a-zA-Z0-9]{2,4}/);
    			if (m) {
    				remoteCheckEmail();
    			} else {
    				checkEmail.lastcheck = "104";
    				return checkEmail.lastcheck;
    			}
    		} else {
    			return checkEmail.lastcheck;
    		}
    	} else {
    		checkEmail.lastcheck = "104";
    		return "104";
    	}
    }
    
    function remoteCheckUsername() {
    	var username = document.forms[0].elements[0].value;
    	ajax.requestFile = "check_registration.php";
    
    	// turn on its execute flag
        ajax.runResponse = whenResponse;
        ajax.execute = true;
    
        ajax.setVar("action", "check_username");
        ajax.setVar("username", username);
        ajax.runAJAX();
    }
    
    function remoteCheckEmail() {
    	var email = document.forms[0].elements[1].value;
    	ajax.requestFile = "check_registration.php";
    
    	// turn on its execute flag
        ajax.runResponse = whenResponse;
        ajax.execute = true;
    
        ajax.setVar("action", "check_email");
        ajax.setVar("email", email);
        ajax.runAJAX();
    }
    
    function checkAGB() {
    	if (document.forms[0].elements[2].checked == true) {
    		return 0;
    	} else{
    		return 1;
    	}
    }
    
    function checkData() {
    	//document.getElementById('debug').innerHTML = checkUsername() + " " + checkEmail() + " " + checkAGB();
    	if (checkUsername.lastcheck == "0"
    		&& checkEmail.lastcheck == "0"
    		&& !checkAGB()) {
    		document.forms[0].elements[4].disabled = false;
    		
    	} else {
    		document.forms[0].elements[4].disabled = true;
    			//document.write(document.forms[0].elements[3].value);
    	}
    	
    }
    
    function pollUsername() {
    	pollUsername.interval = setInterval("printMessage(checkUsername())", 1000);
    	clearInterval(pollEmail.interval);
    }
    
    function stopPollingUsername() {
    	clearInterval(pollUsername.interval);
    }
    
    function pollEmail() {
    	pollEmail.interval = setInterval("printMessage(checkEmail())", 1000);
    	clearInterval(pollUsername.interval);
    }
    
    function stopPollingEmail() {
    	clearInterval(pollEmail.interval);
    }
    
    
    function whenLoading(){
    }
          
    function whenLoaded(){
    }
          
    function whenInteractive(){
    }
    
    function whenResponse(){
    	retVals = this.response.split(" ");
    	switch (retVals[0]) {
    		case "1": // check username
    			checkUsername.lastcheck = retVals[1];
    			break;
    		case "2": // check email
    			checkEmail.lastcheck = retVals[1];
    			//checkEmail();
    			break;
    	}
    }

  5. #5
    L'avatar di EuroSalute
    EuroSalute non è connesso AlterVistiano
    Data registrazione
    12-05-2003
    Messaggi
    969

    Predefinito

    questo file è un file scritto in javascript, sono funzioni di controllo....

    io intendo il file dove si inseriscono i campi input....il <FORM per l'input dei dati....
    LOTTO MATEMATICO-SCENTIFICO che FUNZIONA:
    Scripts di Calcolo Automatico Metodologie http://eurosalute.altervista.org

    VINCI OGNI SETTIMANA CON IL NUOVO METODO 5
    FAI IL TEST CON L'ANALISI VINCITE

  6. #6
    Guest

    Predefinito

    bho aspetta che ricontrollo

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •