Einzelnen Beitrag anzeigen
  #12 (permalink)
Alt 23.07.2007, 18:45
progandy
Premium Supporter
 
Benutzerbild von progandy
 
Registriert seit: 25.06.2007
Beiträge: 1,000
Bedankte sich: 2
320 Danksagungen in 283 Beiträgen
Standard

Hier ist eine angepasste
joomla\administrator\components\com_astatspro\incl udes\functions.inc.php.
Damit sollte es funktionieren (bei mir ging es)
Die veränderten Funktionen:
PHP-Code:
function chC_login$name$pw$cookie 0$admin_required FALSE )
{
    global 
$_CHC_DB;
        global 
$_CHC_DBCONFIG;
        global 
$database;

        if ( 
$_CHC_DBCONFIG['use_external_users'] == TRUE ) {
        
// Eigene Benutzerdaten
        
$result $_CHC_DB->query(
            
"SELECT "$_CHC_DBCONFIG['col_admin_guest'] ." , "$_CHC_DBCONFIG['col_userpw']."
            FROM `"
CHC_DATABASE .'`.`'$_CHC_DBCONFIG['tables_users'] ."`
            WHERE
                "
$_CHC_DBCONFIG['col_username'] ." = '".$name."'
            AND "
$_CHC_DBCONFIG['col_admin_guest'] ." > '0'"

        
);
        if( 
$_CHC_DB->num_rows$result ) >= ){
                
$row $_CHC_DB->fetch_assoc($result);
                list(
$hash$salt) = explode(':'$row['password']);
        
$cryptpass = ($hash == $pw) ? $pw md5($pw.$salt);
        }

                if( (
$_CHC_DB->num_rows$result ) >= 1) && ($hash == $cryptpass) )
        {
            
$row $_CHC_DB->fetch_assoc$result );
            
$typ $row[$_CHC_DBCONFIG['col_admin_guest']];
            if ( 
$typ '23' ) {
                
$typ 'admin';
            }
            else {
                
$typ 'guest';
            }


            if( 
$admin_required == TRUE && $typ == 'guest' )
            {
                return -
1;
            }



            
$_SESSION['CHC_LOGGED_IN'] = $typ;
            if( 
$cookie == )
            {
                
setcookie'CHC_LOGIN'$name.'~'.md5($pw.$salt), time() + 25920000'/' );
            }
            return 
$_SESSION['CHC_LOGGED_IN'];
        }
                
md5($pw);
        return -
1;
        }
        else {
        
// chCounter verwaltet die Benutzerdaten
                
md5($pw);
        
$result $_CHC_DB->query(
            
"SELECT setting
            FROM `"
CHC_DATABASE .'`.`'CHC_TABLE_CONFIG ."`
            WHERE
                (
                    ( setting = 'admin_name' AND value = '"
.$name."' )
                    OR ( setting = 'admin_passwort' AND value = '"
.$pw."' )
                )
                OR
                (
                    ( setting = 'gast_name' AND value = '"
.$name."' )
                    OR ( setting = 'gast_passwort' AND value = '"
.$pw."' )
                )"
        
);

        if( 
$_CHC_DB->num_rows$result ) == )
        {
            
$row $_CHC_DB->fetch_assoc$result );
            
$typ is_intstrpos$row['setting'], 'admin' ) ) ? 'admin' 'guest';

            if( 
$admin_required == TRUE && $typ == 'guest' )
            {
                return -
1;
            }

            
$_SESSION['CHC_LOGGED_IN'] = $typ;
            if( 
$cookie == )
            {
                
setcookie'CHC_LOGIN'$name.'~'.$pwtime() + 25920000'/' );
            }
            return 
$_SESSION['CHC_LOGGED_IN'];
        }
        return -
1;
    }
}

function 
chC_manage_login$admin_required FALSE )
{
    if( !isset( 
$_SESSION['CHC_LOGGED_IN'] ) )
    {
        
$login 0;
        if( isset( 
$_POST['login_form'] ) ) // Login per Form
        
{
            
$_POST['login_cookie'] = ( isset( $_POST['login_cookie'] ) ) ? 0;
            if( !empty( 
$_POST['login_name'] ) )
            {
                
$login chC_login$_POST['login_name'], ( $_POST['login_pw'] ), $_POST['login_cookie'], $admin_required );
            }
            else
            {
                
$login = -1;
            }
        }
        elseif( isset( 
$_GET['user'] ) && isset( $_GET['pw'] ) ) // Login per URL
        
{
            if( !empty( 
$_GET['user'] ) )
            {
                
$login chC_login$_GET['user'], ( $_GET['pw'] ), isset( $_GET['cookie'] ) ? 0$admin_required );
            }
            else
            {
                
$login = -1;
            }
        }
        elseif( isset( 
$_COOKIE['CHC_LOGIN'] ) )    // automatisches Cookie-Login
        
{
            
$name substr(
                
$_COOKIE['CHC_LOGIN'],
                
0,
                
strrpos$_COOKIE['CHC_LOGIN'], '~' )
            );
            if( !empty( 
$name ) )
            {
                
$pw str_replace$name .'~'''$_COOKIE['CHC_LOGIN'] );
                
$login chC_login$name$pw1$admin_required );
            }
            else
            {
                
$login = -1;
            }
        }
        if( 
$login != )
        {
            
$login = ( $login === FALSE ) ? -$login;
        }
    }
    return isset( 
$login ) ? $login 2// 0: kein einloggversuch. -1: einloggen fehlerhaft; 'admin'|'guest': einloggen erfolgreich; 2: bereits eingeloggt;

Angehängte Dateien
Dateityp: zip functions.inc.zip (9.4 KB, 130x aufgerufen)
progandy ist offline   Mit Zitat antworten
Erhielt Danksagungen von: