ingreso/ 0040755 0001136 0001130 00000000000 10507124245 013227 5 ustar sgap_adm webmasters ingreso/access_user_class.php 0100644 0001136 0001130 00000074056 10507126457 017444 0 ustar sgap_adm webmasters connect_db(); $this->login_page = LOGIN_PAGE; $this->main_page = START_PAGE; $this->password_page = ACTIVE_PASS_PAGE; $this->deny_access_page = DENY_ACCESS_PAGE; $this->admin_page = ADMIN_PAGE; } function check_user($pass = "") { switch ($pass) { case "new": $sql = sprintf("SELECT COUNT(*) AS test FROM %s WHERE email = '%s' OR login = '%s'", $this->table_name, $this->user_email, $this->user); break; case "lost": $sql = sprintf("SELECT COUNT(*) AS test FROM %s WHERE email = '%s' AND active = 'y'", $this->table_name, $this->user_email); break; case "new_pass": $sql = sprintf("SELECT COUNT(*) AS test FROM %s WHERE pw = '%s' AND id = %d", $this->table_name, $this->user_pw, $this->id); break; case "active": $sql = sprintf("SELECT COUNT(*) AS test FROM %s WHERE id = %d AND active = 'n'", $this->table_name, $this->id); break; case "validate": $sql = sprintf("SELECT COUNT(*) AS test FROM %s WHERE id = %d AND tmp_mail <> ''", $this->table_name, $this->id); break; default: $password = (strlen($this->user_pw) < 32) ? md5($this->user_pw) : $this->user_pw; $sql = sprintf("SELECT COUNT(*) AS test FROM %s WHERE BINARY login = '%s' AND pw = '%s' AND active = 'y'", $this->table_name, $this->user, $password); } $result = mysql_query($sql) or die(mysql_error()); if (mysql_result($result, 0, "test") == 1) { return true; } else { return false; } } // New methods to handle the access level function get_access_level() { $sql = sprintf("SELECT access_level FROM %s WHERE login = '%s' AND active = 'y'", $this->table_name, $this->user); if (!$result = mysql_query($sql)) { $this->the_msg = $this->messages(14); } else { return mysql_result($result, 0, "access_level"); } } function set_user() { $_SESSION['user'] = $this->user; $_SESSION['pw'] = $this->user_pw; if (!empty($_SESSION['referer'])) { $next_page = $_SESSION['referer']; unset($_SESSION['referer']); } else { $next_page = $this->main_page; } header("Location: ".$next_page); } function connect_db() { $conn_str = mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD); mysql_select_db(DB_NAME); // if there are problems with the tablenames inside the config file use this row } function login_user($user, $password) { if ($user != "" && $password != "") { $this->user = $user; $this->user_pw = $password; if ($this->check_user()) { $this->login_saver(); if ($this->count_visit) { $this->reg_visit($user, $password); } $this->set_user(); } else { $this->the_msg = $this->messages(10); } } else { $this->the_msg = $this->messages(11); } } function login_saver() { if ($this->save_login == "no") { if (isset($_COOKIE[$this->cookie_name])) { $expire = time()-3600; } else { return; } } else { $expire = time()+2592000; } $cookie_str = $this->user.chr(31).base64_encode($this->user_pw); setcookie($this->cookie_name, $cookie_str, $expire, $this->cookie_path); } function login_reader() { if (isset($_COOKIE[$this->cookie_name])) { $cookie_parts = explode(chr(31), $_COOKIE[$this->cookie_name]); $this->user = $cookie_parts[0]; $this->user_pw = base64_decode($cookie_parts[1]); $this->is_cookie = true; } } function reg_visit($login, $pass) { $visit_sql = sprintf("UPDATE %s SET last_login = '%s' WHERE login = '%s' AND pw = '%s'", $this->table_name, date("Y-m-d H:i:s"), $login, md5($pass)); mysql_query($visit_sql); } function log_out() { unset($_SESSION['user']); unset($_SESSION['pw']); header("Location: ".$this->login_page); } function access_page($refer = "", $qs = "", $level = DEFAULT_ACCESS_LEVEL) { $refer_qs = $refer; $refer_qs .= ($qs != "") ? "?".$qs : ""; if (isset($_SESSION['user']) && isset($_SESSION['pw'])) { $this->user = $_SESSION['user']; $this->user_pw = $_SESSION['pw']; if (!$this->check_user()) { $_SESSION['referer'] = $refer_qs; header("Location: ".$this->login_page); } if ($this->get_access_level() < $level) { header("Location: ".$this->deny_access_page); } } else { $_SESSION['referer'] = $refer_qs; header("Location: ".$this->login_page); } } function get_user_info() { $sql_info = sprintf("SELECT name, lastname, t_doc, n_doc, fec_nac, nac, email, last_login, id FROM %s WHERE login = '%s' AND pw = '%s'", $this->table_name, $this->user, md5($this->user_pw)); $res_info = mysql_query($sql_info); $this->id = mysql_result($res_info, 0, "id"); $this->user_name = mysql_result($res_info, 0, "name"); $this->user_lastname = mysql_result($res_info, 0, "lastname"); $this->user_t_doc = mysql_result($res_info, 0, "t_doc"); $this->user_n_doc = mysql_result($res_info, 0, "n_doc"); $this->user_fec_nac = mysql_result($res_info, 0, "fec_nac"); $this->user_nac = mysql_result($res_info, 0, "nac"); $this->user_email = mysql_result($res_info, 0, "email"); $this->user_last_login = mysql_result($res_info, 0, "last_login"); } function update_user($new_password, $new_confirm, /*$new_name, /*$new_last_login, */$new_mail) { if ($new_password != "") { if ($this->check_new_password($new_password, $new_confirm)) { $ins_password = $new_password; $update_pw = true; } else { return; } } else { $ins_password = $this->user_pw; $update_pw = false; } if (trim($new_mail) <> $this->user_email) { if ($this->check_email($new_mail)) { $this->user_email = $new_mail; if (!$this->check_user("lost")) { $update_email = true; } else { $this->the_msg = $this->messages(31); return; } } else { $this->the_msg = $this->messages(16); return; } } else { $update_email = false; $new_mail = ""; } $upd_sql = sprintf("UPDATE %s SET pw = %s, tmp_mail = %s WHERE id = %d", // $upd_sql = sprintf("UPDATE %s SET pw = %s, name = %s, last_login = %s, tmp_mail = %s WHERE id = %d", $this->table_name, $this->ins_string(md5($ins_password)), // $this->ins_string($new_name), // $this->ins_string($new_last_login), $this->ins_string($new_mail), $this->id); $upd_res = mysql_query($upd_sql); if ($upd_res) { if ($update_pw) { $_SESSION['pw'] = $this->user_pw = $ins_password; if (isset($_COOKIE[$this->cookie_name])) { $this->save_login = "yes"; $this->login_saver(); } } $this->the_msg = $this->messages(30); if ($update_email) { if ($this->send_mail($new_mail, 33)) { $this->the_msg = $this->messages(27); } else { mysql_query(sprintf("UPDATE %s SET tmp_mail = ''", $this->table_name)); $this->the_msg = $this->messages(14); } } } else { $this->the_msg = $this->messages(15); } } function check_new_password($pass, $pw_conform) { if ($pass == $pw_conform) { if (strlen($pass) >= PW_LENGTH) { return true; } else { $this->the_msg = $this->messages(32); return false; } } else { $this->the_msg = $this->messages(38); return false; } } function check_email($mail_address) { if (preg_match("/^[0-9a-z]+(([\.\-_])[0-9a-z]+)*@[0-9a-z]+(([\.\-])[0-9a-z-]+)*\.[a-z]{2,4}$/i", $mail_address)) { return true; } else { return false; } } function ins_string($value) { if (preg_match("/^(.*)(##)(int|date|eu_date)$/", $value, $parts)) { $value = $parts[1]; $type = $parts[3]; } else { $type = ""; } $value = (!get_magic_quotes_gpc()) ? addslashes($value) : $value; switch ($type) { case "int": $value = ($value != "") ? intval($value) : NULL; break; case "eu_date": $date_parts = preg_split ("/[\-\/\.]/", $value); $time = mktime(0, 0, 0, $date_parts[1], $date_parts[0], $date_parts[2]); $value = strftime("'%Y-%m-%d'", $time); break; case "date": $value = "'".preg_replace("/[\-\/\.]/", "-", $value)."'"; break; default: $value = ($value != "") ? "'" . $value . "'" : "''"; } return $value; } function register_user($first_login, $first_password, $confirm_password, $first_name, $first_lastname, $first_t_doc, $first_n_doc, $first_fec_nac, $first_nac, $first_ingreso, $first_email, $first_last_login) { if ($this->check_new_password($first_password, $confirm_password)) { if (strlen($first_login) >= LOGIN_LENGTH) { if ($this->check_email($first_email)) { $this->user_email = $first_email; $this->user = $first_login; if ($this->check_user("new")) { $this->the_msg = $this->messages(12); return; } else { $sql = sprintf("INSERT INTO %s (id, login, pw, name, lastname, t_doc, n_doc, fec_nac, nac, ingreso, email, last_login, access_level, active) VALUES (NULL, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, 'n')", $this->table_name, $this->ins_string($first_login), $this->ins_string(md5($first_password)), $this->ins_string($first_name), $this->ins_string($first_lastname), $this->ins_string($first_t_doc), $this->ins_string($first_n_doc), $this->ins_string($first_fec_nac), $this->ins_string($first_nac), $this->ins_string($first_ingreso), $this->ins_string($this->user_email), $this->ins_string($first_last_login), DEFAULT_ACCESS_LEVEL); $ins_res = mysql_query($sql) or die(mysql_error()); if ($ins_res) { $this->id = mysql_insert_id(); $this->user_pw = $first_password; $this->user_name = $first_name; if ($this->send_mail($this->user_email, 29, 28)) { $this->the_msg = $this->messages(13); } else { mysql_query(sprintf("DELETE FROM %s WHERE id = %s", $this->table_name, $this->id)); $this->the_msg = $this->messages(14); } } else { $this->the_msg = $this->messages(15); } } } else { $this->the_msg = $this->messages(16); } } else { $this->the_msg = $this->messages(17); } } } function validate_email($validation_key, $key_id) { if ($validation_key != "" && strlen($validation_key) == 32 && $key_id > 0) { $this->id = $key_id; if ($this->check_user("validate")) { $upd_sql = sprintf("UPDATE %s SET email = tmp_mail, tmp_mail = '' WHERE id = %d AND pw = '%s'", $this->table_name, $key_id, $validation_key); if (mysql_query($upd_sql)) { $this->the_msg = $this->messages(18); } else { $this->the_msg = $this->messages(19); } } else { $this->the_msg = $this->messages(34); } } else { $this->the_msg = $this->messages(21); } } function activate_account($activate_key, $key_id) { if ($activate_key != "" && strlen($activate_key) == 32 && $key_id > 0) { $this->id = $key_id; if ($this->check_user("active")) { if ($this->auto_activation) { $upd_sql = sprintf("UPDATE %s SET active = 'y' WHERE id = %s AND pw = '%s'", $this->table_name, $key_id, $activate_key); if (mysql_query($upd_sql)) { if ($this->send_confirmation($key_id)) { $this->the_msg = $this->messages(18); } else { $this->the_msg = $this->messages(14); } } else { $this->the_msg = $this->messages(19); } } else { if ($this->send_mail($this->admin_mail, 40, 39)) { $this->the_msg = $this->messages(36); } else { $this->the_msg = $this->messages(14); } } } else { $this->the_msg = $this->messages(20); } } else { $this->the_msg = $this->messages(21); } } function forgot_password($forgot_email) { if ($this->check_email($forgot_email)) { $this->user_email = $forgot_email; if (!$this->check_user("lost")) { $this->the_msg = $this->messages(22); } else { $forgot_sql = sprintf("SELECT id, pw FROM %s WHERE email = '%s'", $this->table_name, $this->user_email); if ($forgot_result = mysql_query($forgot_sql)) { $this->id = mysql_result($forgot_result, 0, "id"); $this->user_pw = mysql_result($forgot_result, 0, "pw"); if ($this->send_mail($this->user_email, 35, 26)) { $this->the_msg = $this->messages(23); } else { $this->the_msg = $this->messages(14); } } else { $this->the_msg = $this->messages(15); } } } else { $this->the_msg = $this->messages(16); } } function check_activation_password($controle_str, $id) { if ($controle_str != "" && strlen($controle_str) == 32 && $id > 0) { $this->user_pw = $controle_str; $this->id = $id; if ($this->check_user("new_pass")) { // this is a fix for version 1.76 $sql_get_user = sprintf("SELECT login FROM %s WHERE pw = '%s' AND id = %d", $this->table_name, $this->user_pw, $this->id); $get_user = mysql_query($sql_get_user); $this->user = mysql_result($get_user, 0, "login"); // end fix return true; } else { $this->the_msg = $this->messages(21); return false; } } else { $this->the_msg = $this->messages(21); return false; } } function activate_new_password($new_pass, $new_confirm, $old_pass, $user_id) { if ($this->check_new_password($new_pass, $new_confirm)) { $sql_new_pass = sprintf("UPDATE %s SET pw = '%s' WHERE pw = '%s' AND id = %d", $this->table_name, md5($new_pass), $old_pass, $user_id); if (mysql_query($sql_new_pass)) { $this->the_msg = $this->messages(30); return true; } else { $this->the_msg = $this->messages(14); return false; } } else { return false; } } function send_confirmation($id) { $sql = sprintf("SELECT name, email, n_doc, clave FROM %s WHERE id = %d", $this->table_name, $id); $res = mysql_query($sql); $user_email = mysql_result($res, 0, "email"); $this->user_name = mysql_result($res, 0, "name"); $this->user_clave = mysql_result($res, 0, "clave"); $this->user_n_doc = mysql_result($res, 0, "n_doc"); if ($this->user_name == "") $this->user_name = "Usuario"; // change "User" to whatever you want, it's just a default name if ($this->send_mail($user_email, 37, 24, $this->send_copy)) { return true; } else { return false; } } function send_mail($mail_address, $msg = 29, $subj = 28, $send_admin = false) { $header = "From: \"".$this->webmaster_name."\" <".$this->webmaster_mail.">\r\n"; if ($send_admin) $header .= "Bcc: ".ADMIN_MAIL."\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Mailer: Olaf's mail script version 1.11\r\n"; $header .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"; $header .= "Content-Transfer-Encoding: 7bit\r\n"; $subject = $this->messages($subj); $body = $this->messages($msg); if (mail($mail_address, $subject, $body, $header)) { return true; } else { return false; } } function messages($num) { $host = "http://".$_SERVER['HTTP_HOST']; switch ($this->language) { case "de": $msg[10] = "Login und/oder Passwort finden keinen Treffer in der Datenbank."; $msg[11] = "Login und/oder Passwort sind leer!"; $msg[12] = "Leider existiert bereits ein Benutzer mit diesem Login und/oder E-mailadresse."; $msg[13] = "Weitere Anweisungen wurden per E-mail versandt, folgen Sie nun den Instruktionen."; $msg[14] = "Es is ein Fehler entstanden probieren Sie es erneut."; $msg[15] = "Es is ein Fehler entstanden probieren Sie es später nochmal."; $msg[16] = "Die eingegebene E-mailadresse ist nicht gültig."; $msg[17] = "Das Feld login (min. ".LOGIN_LENGTH." Zeichen) muss eingegeben sein."; $msg[18] = "Ihr Benutzerkonto ist aktiv. Sie können sich nun anmelden."; $msg[19] = "Ihr Aktivierungs ist nicht gültig."; $msg[20] = "Da ist kein Konto zu aktivieren."; $msg[21] = "Der benutzte Aktivierung-Code is nicht gültig!"; $msg[22] = "Keine Konto gefunden dass mit der eingegeben E-mailadresse übereinkommt."; $msg[23] = "Kontrollieren Sie Ihre E-Mail um Ihr neues Passwort zu erhalten."; $msg[24] = "Ihr Benutzerkonto wurde aktiviert."; $msg[25] = "Kann Ihr Passwort nicht aktivieren."; $msg[26] = "Sie haben Ihr Passwort vergessen..."; $msg[27] = "Kontrollieren Sie Ihre E-Mailbox und bestätigen Sie Ihre Änderung(en)."; $msg[28] = "Ihre Anfrage bestätigen..."; $msg[29] = "Hallo,\r\n\r\num Ihre Anfrage zu aktivieren klicken Sie bitte auf den folgenden Link:\r\n".$host.$this->login_page."?ident=".$this->id."&activate=".md5($this->user_pw)."&language=".$this->language."\r\n\r\nmit freundlichen Grüssen\r\n".$this->admin_name; $msg[30] = "Ihre Änderung ist durchgeführt."; $msg[31] = "Diese E-mailadresse wird bereits genutzt, bitte wählen Sie eine andere."; $msg[32] = "Das Feld Passwort (min. ".PW_LENGTH." Zeichen) muss eingegeben sein."; $msg[33] = "Hallo,\r\n\r\nIhre neue E-mailadresse muss noch überprüft werden, bitte klicken Sie auf den folgenden Link:\r\n".$host.$this->login_page."?id=".$this->id."&validate=".md5($this->user_pw)."&language=".$this->language."\r\n\r\nmit freundlichen Grüssen\r\n".$this->admin_name; $msg[34] = "Da ist keine E-mailadresse zu überprüfen."; $msg[35] = "Hallo,\r\n\r\nIhr neues Passwort kann nun eingegeben werden, bitte klicken Sie auf den folgenden Link:\r\n".$host.$this->password_page."?id=".$this->id."&activate=".$this->user_pw."&language=".$this->language."\r\n\r\nmit freundlichen Grüssen\r\n".$this->admin_name; $msg[36] = "Ihr Antrag ist verarbeitet und wird nun durch den Administrator kontrolliert. \r\nSie erhalten eine Nachricht wenn dies geschehen ist."; $msg[37] = "Hallo ".$this->user_name.",\r\n\r\nIhr Konto ist nun eigerichtet und Sie können sich nun anmelden.\r\n\r\nKlicken Sie hierfür auf den folgenden Link:\r\n".$host.$this->login_page."\r\n\r\nmit freundlichen Grüssen\r\n".$this->admin_name; $msg[38] = "Das bestätigte Passwort hat keine Übereinstimmung mit dem ersten Passwort, bitte probieren Sie es erneut."; $msg[39] = "Neuer Benutzer..."; $msg[40] = "Es hat sich am ".date("Y-m-d")." ein neuer Benutzer angemeldet.\r\n\r\nKlicken Sie hier um zur Verwaltungsseite zu gelangen:\r\n\r\n".$host.$this->admin_page."?login_id=".$this->id; $msg[41] = "Bestätigen Sie Ihre E-mailadresse..."; break; break; case "nl": $msg[10] = "Gebruikersnaam en/of wachtwoord vinden geen overeenkomst in de database."; $msg[11] = "Gebruikersnaam en/of wachtwoord zijn leeg!"; $msg[12] = "Helaas bestaat er al een gebruiker met deze gebruikersnaam en/of e-mail adres."; $msg[13] = "Er is een e-mail is aan u verzonden, volg de instructies die daarin vermeld staan."; $msg[14] = "Het is een fout ontstaan, probeer het opnieuw."; $msg[15] = "Het is een fout ontstaan, probeer het later nog een keer."; $msg[16] = "De opgegeven e-mail adres is niet geldig."; $msg[17] = "De gebruikersnaam (min. ".LOGIN_LENGTH." teken) moet opgegeven zijn."; $msg[18] = "Het gebruikersaccount is aangemaakt, u kunt u nu aanmelden."; $msg[19] = "Kan uw account niet activeren."; $msg[20] = "Er is geen account te activeren."; $msg[21] = "De gebruikte activeringscode is niet geldig!"; $msg[22] = "Geen account gevonden dat met de opgegeven e-mail adres overeenkomt."; $msg[23] = "Er is een e-mail is aan u verzonden, daarin staat hoe uw een nieuw wachtwoord kunt aanmaken."; $msg[24] = "Uw gebruikersaccount is geactiveerd... "; $msg[25] = "Kan het wachtwoord niet activeren."; $msg[26] = "U bent uw wachtwoord vergeten..."; $msg[27] = "Er is een e-mail is aan u verzonden, volg de instructies die daarin vermeld staan."; $msg[28] = "Bevestig uw aanvraag ..."; $msg[29] = "Hallo,\r\n\r\nBedankt voor uw aanvraag,\r\n\r\nklik op de volgende link om de aanvraag te verwerken:\r\n".$host.$this->login_page."?ident=".$this->id."&activate=".md5($this->user_pw)."&language=".$this->language."\r\n\r\nmet vriendelijke groet\r\n".$this->admin_name; $msg[30] = "Uw wijzigingen zijn doorgevoerd."; $msg[31] = "Dit e-mailadres bestaat al, gebruik en andere."; $msg[32] = "Het veld wachtwoord (min. ".PW_LENGTH." teken) mag niet leeg zijn."; $msg[33] = "Beste gebruiker,\r\n\r\nde nieuwe e-mailadres moet nog gevalideerd worden, klik hiervoor op de volgende link:\r\n".$host.$this->login_page."?id=".$this->id."&validate=".md5($this->user_pw)."&language=".$this->language."\r\n\r\nmet vriendelijke groet\r\n".$this->admin_name; $msg[34] = "Er is geen e-mailadres te valideren."; $msg[35] = "Hallo,\r\n\r\nuw nieuw wachtwoord kan nu ingevoerd worden, klik op deze link om verder te gaan:\r\n".$host.$this->password_page."?id=".$this->id."&activate=".$this->user_pw."&language=".$this->language."\r\n\r\nmet vriendelijke groet\r\n".$this->admin_name; $msg[36] = "U aanvraag is verwerkt en wordt door de beheerder binnenkort activeert. \r\nU krijgt bericht wanneer dit gebeurt is."; $msg[37] = "Hallo ".$this->user_name.",\r\n\r\nHet account is nu gereed en u kunt zich aanmelden.\r\n\r\nKlik hiervoor op de volgende link:\r\n".$host.$this->login_page."\r\n\r\nmet vriendelijke groet\r\n".$this->admin_name; $msg[38] = "Het bevestigings wachtwoord komt niet overeen met het wachtwoord, probeer het opnieuw."; $msg[39] = "Nieuwe gebuiker..."; $msg[40] = "Er heeft zich een nieuwe gebruiker aangemeld op ".date("Y-m-d").":\r\n\r\nKlik hier voor toegang tot de beheer pagina:\r\n\r\n".$host.$this->admin_page."?login_id=".$this->id; $msg[41] = "Bevestiging e-mail adres..."; break; case "fr": $msg[10] = "Le login et/ou mot de passe ne correspondent pas."; $msg[11] = "Le login et/ou mot de passe est vide !"; $msg[12] = "Désolé, un utilisateur avec le même email et/ou login existe déjà."; $msg[13] = "Vérifiez votre email et suivez les instructions."; $msg[14] = "Désolé, une erreur s'est produite. Veuillez réessayer."; $msg[15] = "Désolé, une erreur s'est produite. Veuillez réessayer plus tard."; $msg[16] = "L'adresse email n'est pas valide."; $msg[17] = "Le champ \"Nom d'usager\" doit être composé d'au moins ".LOGIN_LENGTH." caratères."; $msg[18] = "Votre requete est complète. Enregistrez vous pour continuer."; $msg[19] = "Désolé, nous ne pouvons pas activer votre account."; $msg[20] = "Désolé, il n'y à pas d'account à activer."; $msg[21] = "Désolé, votre clef d'authorisation n'est pas valide"; $msg[22] = "Désolé, il n'y à pas d'account actif avec cette adresse email."; $msg[23] = "Veuillez consulter votre email pour recevoir votre nouveau mot de passe."; $msg[24] = "Votre compte est prêt à l'usage"; $msg[25] = "Désolé, nous ne pouvons pas activer votre mot de passe."; $msg[26] = "Vous avez oublié votre mot de passe..."; $msg[27] = "Veuillez consulter votre email pour activer les modifications."; $msg[28] = "Votre requete doit etre exécuter..."; $msg[29] = "Bonjour,\r\n\r\npour activer votre account clickez sur le lien suivant:\r\n".$host.$this->login_page."?ident=".$this->id."&activate=".md5($this->user_pw)."&language=".$this->language."\r\n\r\nCordialement\r\n".$this->admin_name; $msg[30] = "Votre account à été modifié."; $msg[31] = "Désolé, cette adresse email existe déjà, veuillez en utiliser une autre."; $msg[32] = "Le champ password (min. ".PW_LENGTH." char) est requis."; $msg[33] = "Bonjour,\r\n\r\nvotre nouvelle adresse email doit être validée, clickez sur le liens suivant:\r\n".$host.$this->login_page."?id=".$this->id."&validate=".md5($this->user_pw)."&language=".$this->language."\r\n\r\nCordialement\r\n".$this->admin_name; $msg[34] = "Il n'y à pas d'email à valider."; $msg[35] = "Bonjour,\r\n\r\nPour entrer votre nouveaux mot de passe, clickez sur le lien suivant:\r\n".$host.$this->password_page."?id=".$this->id."&activate=".$this->user_pw."&language=".$this->language."\r\n\r\nCordialement\r\n".$this->admin_name; $msg[36] = "Votre demande a été bien traitée et d'ici peu l'administrateur va l 'activer. Nous vous informerons quand ceci est arrivé."; $msg[37] = "Bonjour ".$this->user_name.",\r\n\r\nVotre compte est maintenant actif et il est possible d'y avoir accès.\r\n\r\nCliquez sur le lien suivant afin de rejoindre la page d'accès:\r\n".$host.$this->login_page."\r\n\r\nCordialement\r\n".$this->admin_name; $msg[38] = "Le mot de passe de confirmation de concorde pas avec votre mot de passe. Veuillez réessayer"; $msg[39] = "Nouvel utilisateur..."; $msg[40] = "Nouvel utilisateur s'est enregistré ".date("Y-m-d").":\r\n\r\nCliquez ici pour accéder au page d'administration:\r\n\r\n".$host.$this->admin_page."?login_id=".$this->id; $msg[41] = "Confirmez l'adresse email..."; break; default: $msg[10] = "El usuario y/o la clave no coinciden con la base de datos."; $msg[11] = "Falta el usuario y/o la clave."; $msg[12] = "Ya existe una cuenta con ese usuario y/o dirección de e-mail."; $msg[13] = "El sistema le acaba de enviar un mail. Por favor, revise su cuenta y siga las instrucciones que se detallan."; $msg[14] = "Ha ocurrido un error. Inténtelo nuevamente."; $msg[15] = "Ha ocurrido un error. Inténtelo nuevamente."; $msg[16] = "La dirección de e-mail es invalida."; $msg[17] = "Falta el usuario o es demasiado corto (min. ".LOGIN_LENGTH." caracteres)."; $msg[18] = "Su solicitud ha sido procesada. Conectese para continuar."; $msg[19] = "Su cuenta no puede ser activada."; $msg[20] = "No hay ninguna cuenta para activar."; $msg[21] = "La clave de activación es invalida."; $msg[22] = "No hay ninguna cuenta activa que coincida con esta dirección de e-mail."; $msg[23] = "Por favor, revise su e-mail para obtener una nueva clave."; $msg[24] = "Su cuenta ha sido activada. "; $msg[25] = "Su clave no puede ser activada."; $msg[26] = "Su nueva clave"; $msg[27] = "El sistema le acaba de enviar un mail. Por favor revise su cuenta y active las modificaciones."; $msg[28] = "Su solicitud debe ser procesada."; $msg[29] = "Hola ".$this->user_name.",\r\n\r\nPara activar su cuenta presione aqui:\r\n".$host.$this->login_page."?ident=".$this->id."&activate=".md5($this->user_pw)."&language=".$this->language."\r\n\r\nSaludos\r\n".$this->admin_name; $msg[30] = "Su cuenta ha sido modificada."; $msg[31] = "La dirección de e-mail ya existe, por favor cambiela."; $msg[32] = "Falta la clave o es demasiado corta (min. ".PW_LENGTH." caracteres."; $msg[33] = "Hola ".$this->user_name.",\r\n\r\nLa nueva dirección de e-mail debe ser validada. Para hacerlo presione aqui:\r\n".$host.$this->login_page."?id=".$this->id."&validate=".md5($this->user_pw)."&language=".$this->language."\r\n\r\nSaludos\r\n".$this->admin_name; $msg[34] = "No hay dirección de e-mail para validar."; $msg[35] = "Hola ".$this->user_name.",\r\n\r\nPara ingresar su nueva clave presione aqui:\r\n".$host.$this->password_page."?id=".$this->id."&activate=".$this->user_pw."&language=".$this->language."\r\n\r\nSaludos\r\n".$this->admin_name; $msg[36] = "Su solicitud ha sido procesada y su validación será evaluada por el administrador. \r\nRecibirá un e-mail cuando esto suceda."; $msg[37] = "Hola ".$this->user_name."\r\n\r\nSu cuenta ha sido activada.\r\n\r\nRecuerde que si deseea solicitar la entrega de la revista Exactamente debe hacerlo en la página de actualización de informacion de contacto: \r\n".$host.$this->login_page."\r\n\r\nusuario: ".$this->user_n_doc."\r\nclave: ".$this->user_clave."\r\n\r\nLe sugerimos cambiar esta clave en el primer ingreso\r\n\r\nSaludos\r\n".$this->admin_name; $msg[38] = "La clave y la confirmación no coinciden. Por favor inténtelo nuevamente."; $msg[39] = "Nuevo usuario registrado"; $msg[40] = "Un nuevo usuario se registro el ".date("Y-m-d").":\r\n\r\nIngrese a la pagina de administración:\r\n\r\n".$host.$this->admin_page."?login_id=".$this->id; $msg[41] = "Convalide su dirección de e-mail"; // subject in e-mail } return $msg[$num]; } } ?> ingreso/activate_password.php 0100644 0001136 0001130 00000004666 10507125105 017467 0 ustar sgap_adm webmasters check_activation_password($_GET['activate'], $_GET['id'])) { // the activation/validation method $_SESSION['activation'] = $_GET['activate']; // put the activation string into a session or into a hdden field $_SESSION['id'] = $_GET['id']; // this id is the key where the record have to be updated with new pw } } if (isset($_POST['Submit'])) { if ($act_password->activate_new_password($_POST['password'], $_POST['confirm'], $_SESSION['activation'], $_SESSION['id'])) { // this will change the password unset($_SESSION['activation']); unset($_SESSION['id']); // inserts new password only ones! } $act_password->user = $_POST['user']; // to hold the user name in this screen (new in version > 1.77) } $error = $act_password->the_msg; ?>
user; ?>
ingreso/update_user_profile.php 0100644 0001136 0001130 00000011101 10701167515 017772 0 ustar sgap_adm webmasters access_page($_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING']); // protect this page too. $update_profile->get_profile_data(); if (isset($_POST['user_data'])) { $update_profile->update_user($_POST['password'], $_POST['confirm'], $_POST['user_name'], $_POST['user_last_login'], $_POST['user_email']); // the update method } if (isset($_POST['profile_data'])) { $update_profile->save_profile_date($_POST['id'], $_POST['dir_part'], $_POST['loc_part'], $_POST['zip_part'], $_POST['prov_part'], $_POST['pais_part'], $_POST['tel_part'], $_POST['cel_part'], $_POST['nombre_lab'], $_POST['dir_lab'], $_POST['loc_lab'], $_POST['zip_lab'], $_POST['prov_lab'], $_POST['pais_lab'], $_POST['tel_lab'], $_POST['cel_lab'], $_POST['trab_fcen'], $_POST['revista'], $_POST['lista'], $_POST['letter']); // note the last trailing string, this used to optimize the value as a euro date. } $error = $update_profile->the_msg; // error message //$update_profile = new Users_profile; ?>
ingreso/index.php 0100644 0001136 0001130 00000006605 10507126752 015060 0 ustar sgap_adm webmasters login_reader(); // $my_access->language = "de"; // use this selector to get messages in other languages if (isset($_GET['activate']) && isset($_GET['ident'])) { // this two variables are required for activating/updating the account/password $my_access->auto_activation = false; // use this (true/false) to stop the automatic activation $my_access->activate_account($_GET['activate'], $_GET['ident']); // the activation method } if (isset($_GET['validate']) && isset($_GET['id'])) { // this two variables are required for activating/updating the new e-mail address $my_access->validate_email($_GET['validate'], $_GET['id']); // the validation method } if (isset($_POST['Submit'])) { $my_access->save_login = (isset($_POST['remember'])) ? $_POST['remember'] : "no"; // use a cookie to remember the login $my_access->count_visit = true; // if this is true then the last visitdate is saved in the database $my_access->login_user($_POST['login'], $_POST['password']); // call the login method } $error = $my_access->the_msg; ?>
Por favor ingrese su usuario y clave .
¿Todavía no está registrado? Regístrese aqui.
Volver a la página del Área de Graduados
Now you have access to this testpage.
".$_SERVER['QUERY_STRING']."" : " "; ?>
ingreso/admin_user.php 0100644 0001136 0001130 00000021657 10507124731 016076 0 ustar sgap_adm webmasters table_name, trim($for_user)); } else { $sql = sprintf("SELECT id, login, name, lastname, t_doc, n_doc, fec_nac, nac, email, access_level, active FROM %s WHERE n_doc = %d", $this->table_name, intval($for_user)); } $result = mysql_query($sql); if (mysql_num_rows($result) == 1) { $obj = mysql_fetch_object($result); $this->user_id = $obj->id; $this->user_login = $obj->login; $this->user_name = $obj->name; $this->user_lastname = $obj->lastname; $this->user_t_doc = $obj->t_doc; $this->user_n_doc = $obj->n_doc; $this->user_fec_nac = $obj->fec_nac; $this->user_nac = $obj->nac; $this->old_user_email = $obj->email; $this->user_access_level = $obj->access_level; $this->activation = $obj->active; if ($this->user_login != $_SESSION['user']) { $this->user_found = true; } else { $this->user_found = false; $this->the_msg = "No esta permitido modificar la información propia!"; } mysql_free_result($result); } else { $this->the_msg = "No hay datos para ese usuario!"; } } function update_user_by_admin($new_level, $user_id, $def_pass, $new_email, $active, $confirmation = "no") { $this->user_found = true; $this->user_access_level = $new_level; if ($def_pass != "" && strlen($def_pass) < 6) { $this->the_msg = "La clave es demasiado corta, debe tener 6 caracteres como mínimo."; } else { if ($this->check_email($new_email)) { $sql = "UPDATE %s SET access_level = %d, email = '%s', active = '%s'"; $sql .= ($def_pass != "") ? sprintf(", pw = '%s'", md5($def_pass)) : ""; $sql .= " WHERE id = %d"; $sql_compl = sprintf($sql, $this->table_name, $new_level, $new_email, $active, $user_id); if (mysql_query($sql_compl)) { $this->the_msg = "Se modifico la información para el usuario ".$user_id.""; if ($confirmation == "yes") { if ($this->send_confirmation($user_id)) { $this->the_msg .= "
user_n_doc;
$resultado = mysql_query("SELECT id, login, name, lastname, t_doc, n_doc, dia_nac, mes_nac, ano_nac, nac, email, access_level, active FROM rg_users WHERE n_doc = '$rg_n_doc'");
$fila = mysql_fetch_array($resultado);
?>
Datos ingresados en el formulario de registro. |
Ingreso el login del usuario que hay que modificar:
">