Visualizzazione risultati 1 fino 23 di 23

Discussione: Aiuto per login

  1. #1
    Guest

    Predefinito [PHP]Aiuto per login

    Perche ogni volta che entro devo rifare il login, non lo tiene in memoria?
    Vi posto lo script , magari ho sbagliato qualche impostazione::
    Grazie!
    Codice PHP:
    <?php
    /***************************************************************************
    * conf.php
    * -------------------
    * begin : Tuesday', Aug 15', 2002
    * copyright : ('C) 2002 Bugada Andrea
    * email : [email]phpATM@free.fr[/email]
    *
    * $Id: conf.php, v1.30 2005/03/09 11:53:50 bugada Exp $
    *
    *
    ***************************************************************************/

    /***************************************************************************
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License', or
    * ('at your option) any later version.
    *
    ***************************************************************************/

    if ( !defined('IN_PHPATM') )
    {
    die(
    "Hacking attempt");
    }

    //
    // PHP scripts file extension, change it only if your server requires a
    // different name for php scripts. Rememember to rename all .php files
    // with the new extension EXCLUDING 'conf.php'
    //
    $phpExt = 'php';

    //
    // Don't touch this include
    //
    include($include_location.'include/constants.'.$phpExt);

    //
    // URL link to homepage (the link under "home" icon).
    // These value will not influence the script working
    //
    $homeurl = "http://iffty1.altervista.org/";

    //
    // The name of administrator (usually your name)
    //
    $admin_name = 'iffty';

    //
    // Administrator e-mail address
    //
    $admin_email = 'iffty@email.it';

    //
    // If your site has the mail function disabled you can use the SMTP e-mailer.
    // Just set $use_smtp to true, fill $smtp_host with your smtp server (something
    // like smtp.yourisp.net) and, if required, your username and password.
    // Note that if you use 'localhost' as host, password and username normally
    // are not required.
    //
    $use_smtp = false;
    $smtp_host ='';
    $smtp_username = '';
    $smtp_password = '';

    //
    // $domain_name: the domain of your site without trailing 'http://' (eg. [url]www.mysite.net[/url])
    // $script_folder_path: the path where phpATM is located relative to the domain name
    //
    $domain_name = 'www.iffty1.altervista.org';
    $script_folder_path = 'folder1/folder2';
    $installurl = 'http://iffty1.altervista.org/' . $domain_name . 'www.iffty1.altervista.org' . $script_folder_path;
    //
    // You have to change next settings if you wish use non-default folders
    // Highly recommended to change folders name to improve security
    //
    $users_folder_name = 'users';
    $userstat_folder_name = 'userstat';
    $uploads_folder_name = 'files';
    $languages_folder_name = 'languages';
    $stats_folder_name = 'stats';
    $viewers_folder_name = 'viewers';
    $cfg_folder_name = 'cfg';

    //
    // Cookie settings. Normally changing these settings is not required.
    // If you want to limit the cookie validity to a particular
    // path or domain enter it in $cookiepath and $cookiedomain; set $cookiesecure
    // true only if your server is SSL Secure. The default cookie validity is set to 1 year
    // (24 * 365 = 8760 hours), you can decrease it if you want
    //
    $cookiedomain = 'true';
    $cookiepath = '';
    $cookiesecure = false;
    $cookievalidity = 8760; //hours

    //
    // User type grants
    // ================
    //
    // view: user can view the file list
    // modwon: user can modify name and description of own files only
    // NOTE: if modall is true, the value of modown will be ignored (assumed true)
    // delown: user can delete own files only
    // NOTE: if delall is true, the value of delown will be ignored (assumed true)
    // download: user can download files
    // NOTE: if view is false then the value of download will be ignored (assumed false)
    // mail: user can mail files to his own mail address with size limitation (see mailall)
    // NOTE: if view is false then the value of mail will be ignored (assumed false)
    // upload: user can upload files
    // mkdir: user can create directories
    // modall: user can modify name and description of all files and directories
    // delall: user can delete any files or directories
    // mailall: user can send files to his own mail address without size limitation
    // webcopy: user can upload files by http address
    // validate: user can validate new uploaded file
    //
    // Consider following lines as a table and modify true to false and viceversa paying
    // attention to not delete commas or parentesis nor other special chars.
    // Please don't change uppercase values!!
    //
    // STATUS => array(view, modown, delown, download, mail, upload, mkdir, modall, delall, mailall, webcopy, validate)
    // V V V V V V V V V V V V
    $grants = array(
    ANONYMOUS => array(true, FALSE, FALSE, true, FALSE, false, false, FALSE, FALSE, FALSE, false, false),
    UPLOADER => array(true, false, false, false, false, true, false, false, false, false, true, false),
    VIEWER => array(true, false, false, false, false, false, false, false, false, false, false, false),
    NORMAL => array(true, true, true, true, true, true, false, false, false, false, false, false),
    POWER => array(true, true, true, true, true, true, true, false, false, true, true, true ),
    ADMIN => array(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE , TRUE, TRUE, TRUE )
    );

    //
    // The default status of new registered user
    // ADMIN - Administrator, POWER - Power User, NORMAL - Normal User,
    // VIEWER - Viewer (view only), UPLOADER - Uploader (upload only)
    //
    $default_user_status = NORMAL;

    //
    // The text displayed in the browser titlebar
    //
    $page_title = 'IFFTY UPLOAD';

    //
    // The default status of a new uploaded file:
    // 0 - new files do not require admin approval to be listed
    // 1 - admin approval is required before a new file can be listed
    //
    $validation_enabled = 0;

    //
    // You can encrypt files content to increase security and avoid direct linking to files.
    // Remember that viewers will be disabled with encryption on. Change this setting only
    // if your file directory is empty, because with this setting off, already encrypted files
    // will be unreadable and viceversa. Permitted values are 'true' and 'false'.
    // NOTE: if you are planning to enable this setting please first change the encryption key
    // with a password of your choice.
    //
    $encrypt_filecontent = false;
    $encryption_key = 'password';

    //
    // Server timezone offset, relative to GMT (Greenwich Mean Time), in hours
    // Change this setting only if time works incorrect
    //
    $GMToffset = date('Z')/3600;

    //
    // The time when script have to do maintenance functions
    // (delete unauhtorized users, send digest, etc.). For instance, if you want
    // to do maintenance functions after 03:00, set the value to 3.
    //
    $maintenance_time = 2;

    //
    // Enable or disable mail functions. If disabled, the digest,
    // mail confirmation & file mailing function is off
    //
    $mail_functions_enabled = true;

    //
    // The maximum size of file, which normal users can send to their mail (in kilobytes)
    // To disable this function (for normal users only), set size below zero
    //
    $max_filesize_to_mail = 500;

    //
    // Enable or disable account activation via e-mail.
    // These feature helps you check the e-mail address of registered user
    //
    $require_email_confirmation = false;

    //
    // Enable or disable language switching ability
    // Disable it if you have only one language installed.
    //
    $allow_choose_language = true;

    //
    // Max number of files listed in 'last uploads' section
    // Don't exceed, since the page load can be very slow
    //
    $max_last_files = 10;

    //
    // Max number of files listed in 'top downloads' section
    // Don't exceed, since the page load can be very slow
    //
    $max_topdownloaded_files = 10;

    //
    // The mail header for digest (html code allowed)
    // You can configure it in the 'settings panel' (only administrator)
    //
    $mailinfopage='mailinfo.htm';

    //
    // Default language, the language code of one element stored in 'languages' dir
    // Anonymous cant't configure this, so will ever use this language
    //
    $dft_language = 'it';

    //
    // Maximum allowed filesize to upload (Kilobytes)
    // Note: php.ini and server also have an upload size limit
    //
    $max_allowed_filesize = 12048;

    //
    // Maximum daily allowed Mb upload - set to number of Mb allowed daily.
    // Set to -1 if you wish not to have this forced.
    //
    $max_daily_mb = -1;

    //
    // Maximum monthly allowed Mb upload - set to number of Mb allowed monthly
    // Set to -1 if you wish not to have this forced
    //
    $max_monthly_mb = -1;

    //
    // Maximum daily download
    // Set to -1 if you wish not to have this enforced.
    //
    $max_daily_download_mb = -1;

    //
    // Maximum monthly download
    // Set to -1 if you wish not to have this enforced
    //
    $max_monthly_download_mb = -1;

    //
    // Format of date & time (in PHP time format, see php.net)
    //
    $datetimeformat = 'd.m.Y H:i';

    //
    // Max number chars for file and directory names
    //
    $file_name_max_caracters = 150;

    //
    // Max number chars for filename in tables
    //
    $file_out_max_caracters = 40;

    //
    // Max number chars for file comment (description)
    //
    $comment_max_caracters = 300;

    //


    NB: Non l'ho postato tutto perche non ci sta!
    Ultima modifica di AngelinoAnt : 05-01-2006 alle ore 22.00.29

  2. #2
    L'avatar di funcool
    funcool non è connesso Utente storico
    Data registrazione
    05-02-2004
    Residenza
    Qui... Non lì, qui!
    Messaggi
    15,433

    Predefinito

    Se non scrivi il pezzo dove crea il cookie non possiamo dirti dove c'è l'errore.
    Mattia vi manda a FunCool - Matriz - Directory Gogol - Sfondo rosso per la Birmania
    «Tu mi dai fastidio perché ti credi tanto un Dio!» «Bè, dovrò pur prendere un modello a cui ispirarmi, no?» Woody Allen

  3. #3
    L'avatar di radioradianti
    radioradianti non è connesso Utente storico
    Data registrazione
    26-11-2003
    Residenza
    Roma
    Messaggi
    1,000

    Predefinito

    @forum78 : per evitare post chilometrici, utilizza i tag di codice.

    Il tuo messaggio l'ho editato io ora.

    Ciao

    Leandro

    Happy Slack!

    E' on line il numero 12 di Topolinux - Totalmente rinnovato!
    TopoLinux è anche chat! irc.azzurra.org canale #topolinux
    La semplicità di questo dono è inversamente proporzionale alla qualità della nostra amicizia

  4. #4
    Guest

    Predefinito

    Purtroppo, essendo un novizio, non sono capace di usare i tag per far stare tutto !
    Comunque ci copio il resto del teso
    Grazie per le risposte
    N.B.: questo è quello che ho io nella cartella include' il file è il conf.php( non so se sia qui dove crea il coockie)

    Codice PHP:
    $comment_max_caracters = 300;

    //
    // Reserved filename
    //
    $reserved_files = "index\.html|^\.|\.desc$|\.dlcnt$";

    //
    // Regular expression defines which files can't be uploaded
    // If you don't know what are regular expressions, don't touch this.
    // NOTE: due to a bug of Apache/PHP, php file with any extra double chars extension
    // are executed like normal php file. I.e. test.php.xx is executed as test.php
    // This is a big security hole, fixed by the following regular expression
    // If you add any extension please consider this bug and add the control to multiextension too
    //
    //
    $rejectedfiles = "^index\.|\.desc$|\.dlcnt$|\.php$|\.php\..*|\.php3$|\.php3\..*|\.cgi\..*|\.cgi$|\.pl$\.pl\..*";

    //
    // Show hidden files (like .htaccess, etc) and directories (see $hidden_dirs)
    //
    $showhidden = false;

    //
    // Hidden directories (regular expression) that won't be shown nor won't be
    // analized for digest, last uploads and top donwloads. Note that users can't
    // create dirs with an hidden name. Default value hides Fr*ntP*ge directories.
    //
    $hidden_dirs = "^_vti_";

    //
    // Header & Background colors of table, Font colors
    // Only the first skin in the array currently works!
    //
    $skins = array(
    array(
    'bordercolor' => '#000000', // The table border color
    'headercolor' => '#4682B4', // The table header color
    'tablecolor' => '#F5F5F5', // The table background color
    'lightcolor' => '#FFFFFF', // Table date field color
    'headerfontcolor' => '#FFFFFF',
    'normalfontcolor' => '#000000',
    'selectedfontcolor' => '#4682B4',
    'bodytag' => "bgcolor=\"#E5E5E5\" text=\"#000000\" link=\"#000000\" vlink=\"#333333\" alink=\"#000000\""
    )
    );

    //
    // Text font used in every page
    //
    $font = 'Verdana';

    //
    // Mimetypes, feel free to change the list but don't remove 'directory' and 'default'.
    // Make sure that the specified image exists in 'images' folder and follow
    // the existing structure
    //
    $mimetypes = array (
    '.txt' => array('img' => 'txt.gif', 'mime' => 'text/plain'),
    '.html' => array('img' => 'html.gif', 'mime' => 'text/html'),
    '.htm' => array('img' => 'html.gif', 'mime' => 'text/html'),
    '.doc' => array('img' => 'doc.gif', 'mime' => 'application/msword'),
    '.pdf' => array('img' => 'pdf.gif', 'mime' => 'application/pdf'),
    '.xls' => array('img' => 'xls.gif', 'mime' => 'application/msexcel'),
    '.gif' => array('img' => 'gif.gif', 'mime' => 'image/gif'),
    '.jpg' => array('img' => 'jpg.gif', 'mime' => 'image/jpeg'),
    '.jpeg' => array('img' => 'jpg.gif', 'mime' => 'image/jpeg'),
    '.bmp' => array('img' => 'bmp.gif', 'mime' => 'image/bmp'),
    '.png' => array('img' => 'gif.gif', 'mime' => 'image/png'),
    '.zip' => array('img' => 'zip.gif', 'mime' => 'application/zip'),
    '.rar' => array('img' => 'rar.gif', 'mime' => 'application/x-rar-compressed'),
    '.gz' => array('img' => 'zip.gif', 'mime' => 'application/x-compressed'),
    '.tgz' => array('img' => 'zip.gif', 'mime' => 'application/x-compressed'),
    '.z' => array('img' => 'zip.gif', 'mime' => 'application/x-compress'),
    '.exe' => array('img' => 'exe.gif', 'mime' => 'application/x-msdownload'),
    '.mid' => array('img' => 'mid.gif', 'mime' => 'audio/mid'),
    '.midi' => array('img' => 'mid.gif', 'mime' => 'audio/mid'),
    '.wav' => array('img' => 'wav.gif', 'mime' => 'audio/x-wav'),
    '.mp3' => array('img' => 'mp3.gif', 'mime' => 'audio/x-mpeg'),
    '.avi' => array('img' => 'avi.gif', 'mime' => 'video/x-msvideo'),
    '.mpg' => array('img' => 'mpg.gif', 'mime' => 'video/mpeg'),
    '.mpeg' => array('img' => 'mpg.gif', 'mime' => 'video/mpeg'),
    '.mov' => array('img' => 'avi.gif', 'mime' => 'video/quicktime'),
    '.swf' => array('img' => 'flash.gif', 'mime' => 'application/x-shockwave-flash'),
    '.gtar' => array('img' => 'rar.gif', 'mime' => 'application/x-gtar'),
    '.tar' => array('img' => 'rar.gif', 'mime' => 'application/x-tar'),
    '.tiff' => array('img' => 'defaut.gif', 'mime' => 'image/tiff'),
    '.tif' => array('img' => 'defaut.gif', 'mime' => 'image/tiff'),
    '.rtf' => array('img' => 'doc.gif', 'mime' => 'application/rtf'),
    '.eps' => array('img' => 'defaut.gif', 'mime' => 'application/postscript'),
    '.ps' => array('img' => 'defaut.gif', 'mime' => 'application/postscript'),
    '.qt' => array('img' => 'avi.gif' , 'mime' => 'video/quicktime'),
    'directory' => array('img' => 'dossier.gif', 'mime' => ''),
    'default' => array('img' => 'defaut.gif', 'mime' => 'application/octet-stream')
    );

    //
    // Chars removed from filename and directory name for safety purposes
    // Avoid to modify it unless you are sure about what are you doing.
    //
    $invalidchars = array (
    "'",
    "\"",
    "\"",
    '&',
    ',',
    ';',
    '/',
    "\\",
    '`',
    '<',
    '>',
    ':',
    '*',
    '|',
    '?',
    '§',
    '+',
    '^',
    '(',
    ')',
    '=',
    '$',
    '%'
    );

    //
    // Insert here IP addresses that are not allowed to access your site
    // Default values should not exist, but are present to show you how
    // insert them. If you want you can delete them.
    // Warning IP address in this list must be numerical!
    //
    $ip_black_list = array (
    '127.0.0.2',
    '127.0.0.3',
    );

    ?>
    Ultima modifica di radioradianti : 27-12-2005 alle ore 15.22.30

  5. #5
    Ospite Guest

    Predefinito

    Citazione Originalmente inviato da forum78
    Purtroppo, essendo un novizio, non sono capace di usare i tag per far stare tutto !
    Leggi qui:
    http://forum.altervista.org/showthread.php?t=47288
    Ciauz!

  6. #6
    L'avatar di radioradianti
    radioradianti non è connesso Utente storico
    Data registrazione
    26-11-2003
    Residenza
    Roma
    Messaggi
    1,000

    Predefinito

    @forum78 : E' la seconda volta che te lo dico.
    Utilizza i tag di codice così evitiamo post chilometrici grazie
    ti ho di nuovo editato il messaggio.

    Ciao

    Leandro

    Happy Slack!

    E' on line il numero 12 di Topolinux - Totalmente rinnovato!
    TopoLinux è anche chat! irc.azzurra.org canale #topolinux
    La semplicità di questo dono è inversamente proporzionale alla qualità della nostra amicizia

  7. #7
    Guest

    Predefinito

    Citazione Originalmente inviato da radioradianti
    @forum78 : E' la seconda volta che te lo dico.
    Utilizza i tag di codice così evitiamo post chilometrici grazie
    ti ho di nuovo editato il messaggio.

    Ciao

    Leandro

    Happy Slack!
    Hai ragione e ti chiedo scusa, ho letto ora come fare per i tag!
    Spero che qui ci sia inclusa anche la parte che parla dei coockie per mettere a posto il login, oppure diversamente se qualcuno mi puoi dire quale file devo guardare.
    Grazie a tutti sopratutto per la pazienza!


    P.S: forse è questo il passaggio da modificare?
    //
    // Cookie settings. Normally changing these settings is not required.
    // If you want to limit the cookie validity to a particular
    // path or domain enter it in $cookiepath and $cookiedomain; set $cookiesecure
    // true only if your server is SSL Secure. The default cookie validity is set to 1 year
    // (24 * 365 = 8760 hours), you can decrease it if you want
    //
    $cookiedomain = 'true';
    $cookiepath = '';
    $cookiesecure = false;
    $cookievalidity = 8760; //hours
    Ultima modifica di forum78 : 27-12-2005 alle ore 16.49.41

  8. #8
    Guest

    Predefinito

    Nessuno mi puo aiutare?
    Grazie!

  9. #9
    L'avatar di funcool
    funcool non è connesso Utente storico
    Data registrazione
    05-02-2004
    Residenza
    Qui... Non lì, qui!
    Messaggi
    15,433

    Predefinito

    Devi postare il codice dove c'è una cosa tipo setcookie.
    Mattia vi manda a FunCool - Matriz - Directory Gogol - Sfondo rosso per la Birmania
    «Tu mi dai fastidio perché ti credi tanto un Dio!» «Bè, dovrò pur prendere un modello a cui ispirarmi, no?» Woody Allen

  10. #10
    Guest

    Predefinito

    Citazione Originalmente inviato da funcool
    Devi postare il codice dove c'è una cosa tipo setcookie.
    Ti ringrazio per la risposta, ora cerco e poi lo posto
    Se non riesco prima Auguro a tutti un buonissimo anno nuovo!!!!

  11. #11
    Guest

    Predefinito

    forse ho trovato nel file login.php:

    Codice PHP:
    <?php
    /***************************************************************************
    * login.php
    * -------------------
    * begin : Tuesday', Aug 15', 2002
    * copyright : ('C) 2002 Bugada Andrea
    * email : phpATM@free.fr
    *
    * $Id: login.php, v1.23 2002/10/28 23:53:50 bugada Exp $
    *
    *
    ***************************************************************************/

    /***************************************************************************
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License', or
    * ('at your option) any later version.
    *
    ***************************************************************************/

    define('IN_PHPATM', true);
    $include_location = dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME'])."/";
    include(
    $include_location.'include/conf.php');
    include(
    $include_location.'include/common.'.$phpExt);

    function
    print_default()
    {
    global
    $phpExt;
    global
    $mess, $font, $normalfontcolor, $selectedfontcolor, $languages;
    global
    $uploadcentercaption,$require_email_confirmation;
    global
    $tablecolor,$bordercolor,$headercolor,$headerfontcolor;

    echo
    "
    <br>
    <table border=\"0\" width=\"90%\" bgcolor=\"
    $bordercolor\" cellpadding=\"4\" cellspacing=\"1\">
    <tr>
    <th align=\"left\" bgcolor=\"
    $headercolor\" valign=\"middle\"><font size=\"2\" face=\"$font\" color=\"$headerfontcolor\">$mess[98]</font></th>
    </tr>
    <tr>
    <td align=\"left\" bgcolor=\"
    $tablecolor\" valign=\"middle\">
    <form name=\"userlogin\" action=\"login.
    $phpExt?".SID."\" method=\"post\" style=\"margin: 0\">
    <input type=\"hidden\" name=\"action\" value=\"userlogin\">
    <table border=\"0\" width=\"100%\" cellpadding=\"4\">
    <tr>
    <td align=\"left\" width=\"20%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[57]</font></td>
    <td align=\"left\" width=\"80%\">
    <input type=\"text\" name=\"user_name\" class=\"vform\">
    </td>
    </tr>
    <tr>
    <td align=\"left\" width=\"20%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[83]</font></td>
    <td align=\"left\" width=\"80%\" colspan=2 size=25>
    <input type=\"password\" name=\"user_pass\" class=\"vform\" >
    </td>
    </tr>
    <tr>
    <td align=\"left\" width=\"20%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[205]</font></td>
    <td align=\"left\" width=\"70%\">
    <input type=\"checkbox\" name=\"user_always_logged\">
    </td>
    <td align=\"right\" width=\"10%\" colspan=\"2\" size=25>
    <input type=\"submit\" class=\"vform\" name=\"Submit\" value=\"
    $mess[73]\" />
    </td>
    </tr>
    </table>
    </form>
    </td>
    </tr>
    </table>
    <br>
    <table border=\"0\" width=\"90%\" bgcolor=\"
    $bordercolor\" cellpadding=\"4\" cellspacing=\"1\">
    <tr>
    <th align=\"left\" bgcolor=\"
    $headercolor\" valign=\"middle\"><font size=\"2\" face=\"$font\" color=\"$headerfontcolor\">$mess[99]</font></th>
    </tr>
    <tr>
    <td align=\"left\" bgcolor=\"
    $tablecolor\" valign=\"middle\">
    <font size=\"1\" color=\"
    $normalfontcolor\" face=\"$font\">
    &nbsp;&nbsp;<a href=\"register.
    $phpExt?".SID."\" style=\"font-size:10px;\">$mess[58]</a>
    </font></td>
    </tr>
    </table>
    <br>
    <table border=\"0\" width=\"90%\" bgcolor=\"
    $bordercolor\" cellpadding=\"4\" cellspacing=\"1\">
    <tr>
    <th align=\"left\" bgcolor=\"
    $headercolor\" valign=\"middle\"><font size=\"2\" face=\"$font\" color=\"$headerfontcolor\">$mess[100]</font></th>
    </tr>
    <tr>
    <td align=\"left\" bgcolor=\"
    $tablecolor\" valign=\"middle\">
    <form name=\"logonsystem\" action=\"login.
    $phpExt?".SID."\" method=\"post\" style=\"margin: 0\">
    <input type=\"hidden\" name=\"action\" value=\"sendpassword\">
    <table border=\"0\" width=\"100%\" cellpadding=\"4\">
    <tr>
    <td align=\"left\" width=\"35%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[57]</font></td>
    <td align=\"left\" width=\"65%\" colspan=2>
    <input type=\"text\" name=\"user_name\" class=\"vform\" size=25>
    </td>
    </tr>
    <tr>
    <td align=\"left\" width=\"35%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[91]</font></td>
    <td align=\"left\" width=\"55%\">
    <input type=\"text\" name=\"typed_email\" class=\"vform\" size=25>
    </td>
    <td align=\"right\" width=\"10%\" colspan=\"2\">
    <input type=\"submit\" value=\"
    $mess[67]\" class=\"vform\" />
    </td>
    </tr>
    </table>
    </form>
    </td>
    </tr>
    </table>
    </div>"
    ;
    }


    function
    print_user_profile()
    {
    global
    $mess, $font, $normalfontcolor, $selectedfontcolor, $languages;
    global
    $uploadcentercaption,$logged_user_name,$mail_functions_enabled;
    global
    $tablecolor,$bordercolor,$headercolor,$headerfontcolor, $language;
    global
    $user_wish_receive_digest, $user_email, $user_account_creation_time;
    global
    $allow_choose_language, $dft_language, $phpExt;


    $account_date = getdate($user_account_creation_time);
    $month = $account_date['mon'];
    $mday = $account_date['mday'];
    $year = $account_date['year'];
    list(
    $files_uploaded, $files_downloaded, $files_emailed) = load_userstat($logged_user_name);


    echo
    "
    <br>
    <table border=\"0\" width=\"90%\" bgcolor=\"
    $bordercolor\" cellpadding=\"4\" cellspacing=\"1\">
    <tr>
    <th align=\"left\" bgcolor=\"
    $headercolor\" valign=\"middle\"><font size=\"2\" face=\"$font\" color=\"$headerfontcolor\">$mess[135]</font></th>
    </tr>
    <tr>
    <td align=\"left\" bgcolor=\"
    $tablecolor\" valign=\"middle\">
    <table border=\"0\" width=\"100%\" cellpadding=\"4\">
    <tr>
    <td align=\"left\" width=\"30%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[136]</font></td>
    <td align=\"left\" width=\"70%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">
    $mess[$month] $mday, $year
    </font></td>
    </tr>"
    ;

    if (
    $files_uploaded)
    echo
    "
    <tr>
    <td align=\"left\" width=\"30%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[151]:</font></td>
    <td align=\"left\" width=\"70%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">
    $files_uploaded
    </font></td>
    </tr>"
    ;

    if (
    $files_downloaded)
    echo
    "
    <tr>
    <td align=\"left\" width=\"30%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[152]:</font></td>
    <td align=\"left\" width=\"70%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">
    $files_downloaded
    </font></td>
    </tr>"
    ;
    if (
    $files_emailed)
    echo
    "
    <tr>
    <td align=\"left\" width=\"30%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[153]:</font></td>
    <td align=\"left\" width=\"70%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">
    $files_emailed
    </font></td>
    </tr>"
    ;


    echo
    " </table>
    </td>
    </tr>
    </table>

    <br>

    <table border=\"0\" width=\"90%\" bgcolor=\"
    $bordercolor\" cellpadding=\"4\" cellspacing=\"1\">
    <tr>
    <th align=\"left\" bgcolor=\"
    $headercolor\" valign=\"middle\"><font size=\"2\" face=\"$font\" color=\"$headerfontcolor\">$mess[126]</font></th>
    </tr>
    <tr>
    <td align=\"left\" bgcolor=\"
    $tablecolor\" valign=\"middle\">
    <form name=\"userprofile\" action=\"login.
    $phpExt?".SID."\" method=\"post\" style=\"margin: 0\">
    <input type=\"hidden\" name=\"action\" value=\"customizeprofile\">
    <table border=\"0\" width=\"100%\" cellpadding=\"4\">
    <tr>
    <td align=\"left\" width=\"30%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[88]</font></td>
    <td align=\"left\" width=\"70%\" colspan=2>
    <input type=\"text\" name=\"typed_email\" value=\"
    $user_email\" class=\"vform\">
    </td>
    </tr>"
    ;

    if (
    $allow_choose_language)
    {
    echo
    "
    <tr>
    <td align=\"left\" width=\"30%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[84]</font></td>
    <td align=\"left\" width=\"70%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">
    <select name=\"sel_lang\" class=\"vform\" size=\"1\">"
    ;

    while (list(
    $langid, $langdata) = each($languages))
    {
    if (
    $langid == $language)
    echo
    "<option value=\"$langid\" selected>".$langdata['LangName']."</option>";
    else
    echo
    "<option value=\"$langid\">".$langdata['LangName']."</option>";
    }


    echo
    " </select>
    </font></td>"
    ;

    }

    te lo posto in due volte perche non ci sta

  12. #12
    Guest

    Predefinito

    Codice PHP:
    if ($mail_functions_enabled)
    {
    echo
    "
    </tr>
    <tr>
    <td align=\"left\" width=\"30%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[119]</font></td>
    <td align=\"left\" width=\"60%\">"
    ;
    if (
    $user_wish_receive_digest)
    echo
    " <input type=\"checkbox\" name=\"digestcheckbox\" checked>";
    else
    echo
    " <input type=\"checkbox\" name=\"digestcheckbox\">";
    echo
    " </td>
    <td align=\"right\" width=\"10%\">
    <input type=\"submit\" name=\"Submit\" value=\"
    $mess[127]\" class=\"vform\" />
    </td>
    </tr>"
    ;
    }
    else
    {
    echo
    "
    <td align=\"right\" width=\"10%\">
    <input type=\"submit\" name=\"Submit\" value=\"
    $mess[127]\" class=\"vform\" />
    </td>
    </tr>"
    ;
    }
    echo
    "
    </table>
    </form>
    </td>
    </tr>
    </table>
    <br>
    <table border=\"0\" width=\"90%\" bgcolor=\"
    $bordercolor\" cellpadding=\"4\" cellspacing=\"1\">
    <tr>
    <th align=\"left\" bgcolor=\"
    $headercolor\" valign=\"middle\"><font size=\"2\" face=\"$font\" color=\"$headerfontcolor\">$mess[120]</font></th>
    </tr>
    <tr>
    <td align=\"left\" bgcolor=\"
    $tablecolor\" valign=\"middle\">
    <form name=\"changepass\" action=\"login.
    $phpExt?".SID."\" method=\"post\" style=\"margin: 0\">
    <input type=\"hidden\" name=\"action\" value=\"changepass\">
    <table border=\"0\" width=\"100%\" cellpadding=\"4\">
    <tr>
    <td align=\"left\" width=\"15%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[121]</font></td>
    <td align=\"left\" width=\"90%\" colspan=2>
    <input type=\"password\" name=\"old_pass\" class=\"vform\">
    </td>
    </tr>
    <tr>
    <td align=\"left\" width=\"15%\"><font size=\"1\" face=\"
    $font\" color=\"$normalfontcolor\">$mess[83]</font></td>
    <td align=\"left\" width=\"75%\">
    <input type=\"password\" name=\"new_pass\" class=\"vform\">
    </td>
    <td align=\"right\" width=\"10%\" colspan=\"2\">
    <input type=\"submit\" name=\"Submit\" value=\"
    $mess[127]\" class=\"vform\" />
    </td>
    </tr>
    </table>
    </form>
    </td>
    </tr>
    </table>"
    ;
    }

    function
    show_default($message)
    {
    global
    $logged_user_name, $user_status, $mess;

    if (
    $logged_user_name != '' && $user_status != ANONYMOUS)
    {
    if (
    check_is_user_session_active($logged_user_name))
    {
    // If user already entered, show logout screen
    $message = ($message == '') ? $mess[82] : $message;
    place_message($mess[82], $message, basename(__FILE__));
    print_user_profile();
    return;
    }
    }
    // Show default window
    if ($message == "")
    $message = $mess[42];
    place_message($mess[71], $message, basename(__FILE__));
    print_default();
    }

    //----------------------------------------------------------------------------
    // MAIN
    //----------------------------------------------------------------------------

    $user_name = getPostVar('user_name');
    $user_pass = getPostVar('user_pass');
    $user_always_logged = getPostVar('user_always_logged');
    $old_pass = getPostVar('old_pass');
    $new_pass = getPostVar('new_pass');
    $user_name = getPostVar('user_name');
    $typed_email = getPostVar('typed_email');
    $digestcheckbox = getPostVar('digestcheckbox');
    $sel_lang = getPostVar('sel_lang');

    switch(
    $action)
    {


    case
    'selectskin':
    change_skin();
    require(
    $include_location."${languages_folder_name}/${language}.${phpExt}");
    show_default($mess[96]);
    break;


    //----------------------------------------------------------------------------
    // User Login
    //----------------------------------------------------------------------------

    case 'userlogin':



    // User name can contain only latin and number spases,
    // and space, "_", "-" symbols inside the name
    if (eregi("^[a-z0-9][a-z0-9 _-]{0,10}[a-z0-9]$", $user_name))
    {
    $userfilename = "$users_folder_name/$user_name";

    // Check the user name
    if (file_exists($userfilename))
    {
    // Check the password
    if (check_user_password($user_name, $user_pass))
    {
    if (
    $activationcode == USER_ACTIVE)
    {
    $logged_user_name = $user_name;

    // Generate & store new session id
    srand((double)microtime()*1000000);
    $logged_user_id = md5(rand().microtime());
    $enc_logged_user_id = md5($logged_user_id);

    // scrivo i dati nella sessione corrente
    if ($major > 4 || $release > 0)
    {
    $_SESSION['logged_user_name'] = $logged_user_name;
    $_SESSION['logged_user_id'] = $logged_user_id;
    }
    else
    {
    if (
    get_cfg_var('register_globals') == 'On')
    {
    session_register('logged_user_name');
    session_register('logged_user_id');
    }
    else
    {
    $HTTP_SESSION_VARS['logged_user_name'] = $logged_user_name;
    $HTTP_SESSION_VARS['logged_user_id'] = $logged_user_id;
    }
    }

    // scrivo i dati nel cookie, se richiesto
    if (isset($user_always_logged))
    {
    if (
    $user_always_logged == 'on')
    {
    setcookie("logged_user_name", $logged_user_name, time() + $cookievalidity * 3600, $cookiepath, $cookiedomain, $cookiesecure);
    setcookie("logged_user_id", $logged_user_id, time() + $cookievalidity * 3600, $cookiepath, $cookiedomain, $cookiesecure);
    }
    }

  13. #13
    Guest

    Predefinito

    Anzi addirittura in tre volte senno non ci sta:
    Codice PHP:
    // Write new session ID
    save_user_profile($logged_user_name);

    // and go to the propertly page...
    header($header_location.'index.'.$phpExt.'?'.SID);
    exit;
    }
    elseif (
    $activationcode == USER_DISABLED)
    {
    place_message($mess[71], $mess[80]." ".sprintf($mess[101], "<a href=\"login.$phpExt?".SID."\" style=\"font-size:10px;\">", "</a>"), basename(__FILE__));
    break;
    }
    else
    {
    if (
    ereg('^m:', $user_temp_info))
    {
    header($header_location.'confirm.'.$phpExt.'?'.SID); // Deve confermare il cambio di email
    }
    else
    {
    header($header_location.'activate.'.$phpExt.'?'.SID); // Deve confermare la registrazione
    }
    exit;
    }
    }
    }
    }
    $logged_user_name = '';
    $user_status = ANONYMOUS;

    // Show invalid password message
    place_message($mess[71], $mess[80]." ".sprintf($mess[101], "<a href=\"login.$phpExt?".SID."\" style=\"font-size:10px;\">", "</a>"), basename(__FILE__));
    break;


    case
    'logout':

    // Delete session infos
    if ($major > 4 || $release > 0)
    {
    $_SESSION = array();
    }
    else
    {
    $HTTP_SESSION_VARS = array();
    }
    session_destroy();

    // Delete cookie
    setcookie("logged_user_name", "", time()-86400, $cookiepath, $cookiedomain, $cookiesecure); // 1 day ago
    setcookie("logged_user_id", "", time()-86400, $cookiepath, $cookiedomain, $cookiesecure); // 1 day ago

    // Mark that user logged out
    if ($logged_user_name != '')
    {
    load_user_profile($logged_user_name);
    $enc_logged_user_id = 0;
    save_user_profile($logged_user_name);
    }

    $user_status = ANONYMOUS;
    $logged_user_name = '';

    // Show succesfully logout message
    place_message($mess[72], $mess[102], basename(__FILE__));

    break;

    case
    'sendpassword':

    $userfilename = "$users_folder_name/$user_name";
    if (!
    file_exists($userfilename))
    {
    place_message($mess[58], sprintf($mess[122], $user_name).' '.sprintf($mess[101], "<a href=\"login.$phpExt?".SID."\" style=\"font-size:10px;\">", "</a>"), basename(__FILE__));
    break;
    }

    load_user_profile($user_name);
    if (!isset(
    $typed_email))
    $typed_email = "";
    if (
    $user_email != $typed_email)
    {
    place_message($mess[59], $mess[123].' '.sprintf($mess[116], "<a href=\"login.$phpExt?".SID."\" style=\"font-size:10px;\">", "</a>"), basename(__FILE__));
    break;
    }

    // Generate new password
    $user_pass = generate_password();
    $enc_user_pass = md5($user_pass);
    // Send e-mail
    $body = sprintf($chpass_email_body, $user_pass)."\n\n";
    $body .= $confirm_email_end."\n";
    $body .= $admin_name."\n";
    $body .= "Email: $admin_email";

    $from="$admin_name <$admin_email>";
    if (
    $charsetencoding != "")
    $headers="Content-Type: text; charset=$charsetencoding\n";
    else
    $headers="Content-Type: text; charset=iso-8859-1\n";
    $headers.="From: $from\nX-Mailer: System33r";

    if (!
    $use_smtp)
    {
    $result = @mail($user_email,$chpass_email_subject,$body,$headers);
    }
    else
    {
    if (!
    defined('SMTP_INCLUDED'))
    {
    include(
    $include_location.'include/smtp.'.$phpExt);
    }
    $result = smtpmail($user_email,$chpass_email_subject,$body,$headers);
    }

    if (
    $result)
    {
    // Save user profile
    save_user_profile($user_name);
    place_message($mess[59], $mess[124], basename(__FILE__));
    }
    else
    {
    place_message($mess[59], $mess[177].' '.$mess[179], basename(__FILE__));
    }
    break;


    case
    'customizeprofile':

    if (
    $logged_user_name != '')
    {
    if (
    check_is_user_session_active($logged_user_name))
    {
    $user_wish_receive_digest = 0;
    if (isset(
    $digestcheckbox))
    {
    if (
    $digestcheckbox == "on")
    $user_wish_receive_digest = 1;
    }
    $user_temp_info = "";
    if (
    $typed_email != $user_email)
    {
    if (
    eregi( "^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $typed_email))
    {
    if ((
    $mail_functions_enabled) && ($require_email_confirmation))
    {
    srand((double)microtime()*1000000);
    $activationcode = rand() + 100;
    $user_temp_info = "m:".$activationcode.":".$typed_email;
    }
    else
    $user_email = $typed_email;
    }
    else
    {
    show_default($mess[107]);
    break;
    }
    }

    $language = $sel_lang;
    require(
    $include_location."${languages_folder_name}/${language}.${phpExt}");

    save_user_profile($logged_user_name);

    if (
    $user_temp_info == "")
    show_default($mess[128]);
    else
    {
    // Send confirmation e-mail
    $body=sprintf($confirm_email_body, $logged_user_name, $activationcode, "$installurl/confirm.$phpExt");
    $body .= $confirm_email_end."\n";
    $body .= $admin_name."\n";
    $body .= "Email: $admin_email"."\n";

    $from="$admin_name <$admin_email>";
    if (
    $charsetencoding != "")
    $headers="Content-Type: text; charset=$charsetencoding\n";
    else
    $headers="Content-Type: text; charset=iso-8859-1\n";
    $headers.="From: $from\nX-Mailer: System33r";


    if (!
    $use_smtp)
    {
    $result = @mail($typed_email,$confirm_email_subject,$body,$headers);
    }
    else
    {
    if (!
    defined('SMTP_INCLUDED'))
    {
    include(
    $include_location.'include/smtp.'.$phpExt);
    }
    $result = smtpmail($user_email,$chpass_email_subject,$body,$headers);
    }

    if (
    $result)
    {
    show_default($mess[128]." ".$mess[143]);
    }
    else
    {
    show_default($mess[177]." ".$mess[179]);
    }
    }
    }
    }
    break;

    case
    'changepass':

    if (
    $logged_user_name != '')
    {
    if (
    check_is_user_session_active($logged_user_name))
    {
    if (
    md5($old_pass) == $enc_user_pass)
    {
    if (
    $new_pass != "")
    {
    $enc_user_pass = md5($new_pass);
    save_user_profile($logged_user_name);
    show_default($mess[129]);
    }
    else
    show_default($mess[131]);
    }
    else
    show_default($mess[130]);
    }
    }
    break;

    //----------------------------------------------------------------------------
    // DEFAULT
    //----------------------------------------------------------------------------

    default:
    show_default('');
    break;
    }

    show_footer_page();
    ?>
    scusate la confusione che faccio, ma sono alle prime armi !

  14. #14
    Guest

    Predefinito

    Credo che nella pagina di login, ci sia una spunta con scritto Ricordami o qualcosa del genere. Tu spunta quella e via, senza modificare il codice.

  15. #15
    Guest

    Predefinito

    Citazione Originalmente inviato da ilmagazzino
    Credo che nella pagina di login, ci sia una spunta con scritto Ricordami o qualcosa del genere. Tu spunta quella e via, senza modificare il codice.
    Ti ringrazio per la risposta, ma la spunta purtroppo la metto e non mi tiene lo stesso ; cioè quando rientro devo riloggarmi di nuovo!

  16. #16
    Guest

    Predefinito

    Nessuno che sappia indicarmi?
    Grazie!

  17. #17
    Guest

    Predefinito

    Ciao, come mai nessuno risponde?
    Ho sbagliato a copiare il file io oppure non si spiega il perche?
    Grazie!

  18. #18
    Guest

    Predefinito

    Effettui il logout quando finisci?

    Perché se effettui il logout è logico che ti cancella i cookie e non ti tiene loggato :)


    Prova a vedere se nel tuo pc, dopo aver finito di utilizzare lo script, ti restano i cookie creati dallo script al login.

    Bye.

  19. #19
    Guest

    Predefinito

    Citazione Originalmente inviato da AngelinoAnt
    Effettui il logout quando finisci?

    Perché se effettui il logout è logico che ti cancella i cookie e non ti tiene loggato :)


    Prova a vedere se nel tuo pc, dopo aver finito di utilizzare lo script, ti restano i cookie creati dallo script al login.

    Bye.
    Purtroppo non faccio il logout, è proprio che non tiene i cookie, da quello che ho capito non li crea nemmeno

  20. #20
    Guest

    Predefinito

    Da quello che leggo:

    Codice PHP:
    setcookie("logged_user_name", $logged_user_name, time() + $cookievalidity * 3600, $cookiepath, $cookiedomain, $cookiesecure);
    setcookie("logged_user_id", $logged_user_id, time() + $cookievalidity * 3600, $cookiepath, $cookiedomain, $cookiesecure);
    Da qualche parte dovresti poter settare per quanto tempo i cookie son validi ed accettati dallo script, forse hai settato questo valore troppo basso o addirittura pari a 0. :)

    Bye.

  21. #21
    Guest

    Predefinito

    Nel file conf.php, che si trovas nella cartella include trovo questo:

    Codice PHP:

    $domain_name
    = 'www.iffty1.altervista.org';
    $script_folder_path = 'folder1/folder2';
    $installurl = 'http://iffty1.altervista.org/' . $domain_name . 'www.iffty1.altervista.org' . $script_folder_path;
    //
    // You have to change next settings if you wish use non-default folders
    // Highly recommended to change folders name to improve security
    //
    $users_folder_name = 'users';
    $userstat_folder_name = 'userstat';
    $uploads_folder_name = 'files';
    $languages_folder_name = 'languages';
    $stats_folder_name = 'stats';
    $viewers_folder_name = 'viewers';
    $cfg_folder_name = 'cfg';

    //
    // Cookie settings. Normally changing these settings is not required.
    // If you want to limit the cookie validity to a particular
    // path or domain enter it in $cookiepath and $cookiedomain; set $cookiesecure
    // true only if your server is SSL Secure. The default cookie validity is set to 1 year
    // (24 * 365 = 8760 hours), you can decrease it if you want
    //
    $cookiedomain = 'true';
    $cookiepath = '';
    $cookiesecure = false;
    $cookievalidity = 8760; //hours
    Ma credo che vada bene (o no?)

  22. #22
    Guest

    Predefinito

    Magari è un problema del tuo browser, magari hai messo in modo che non accetti i cookie.

  23. #23
    Ospite Guest

    Predefinito

    Forum78 evita di postare messaggi consecutivi, esiste una funzione chiamata edita che ti consente di modificare l'ultimo messaggio (il pulsante lo trovi nella parte bassa di ogni post).

    Zau!

Regole di scrittura

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