pragmaMx Support Forum

pragmaMx => Coder und Bastlerecke => Thema gestartet von: Webfan am 28 Mai 2014, 21:33:54

Titel: User einloggen - bitte um Hilfe
Beitrag von: Webfan am 28 Mai 2014, 21:33:54
Hallo,
wieso loggt er den user nicht ein?
redirect wird zwar ausgeführt aber kein login?
  public function login($uid)
   {
      global $user_prefix;
         
         if(!function_exists('pmx_user_setlogin'))
                 require('includes'.DS.'mx_userfunctions.php');
         
             
           $q="SELECT * FROM ".$user_prefix."_users
           WHERE
            uid='".intval($uid)."'
            LIMIT 1
            ";
       $result = sql_query($q);
       while($row = sql_fetch_array($result))
        {
           $userconfig = load_class('Userconfig');
           $this->userdata = $row;
           pmx_user_setlogin($this->userdata, TRUE);  
           mxSessionDelVar('formvalues');
           mxSessionDelVar('ucountbadlogin');
           mxSessionDelVar('newusercheck'); // falls noch von Accounterstellung vorhanden                  
           mxSessionSetVar('lang', $this->userdata['user_lang']);
           mxSetUserSession($this->userdata['uid'], $this->userdata['uname'], $this->userdata['pass'], $this->userdata['storynum'], $this->userdata['umode'], $this->userdata['uorder'], $this->userdata['thold'], $this->userdata['noscore'], $this->userdata['ublockon'], $this->userdata['theme'], $this->userdata['commentmax']);
       
           return mxRedirect($this->nexturl);
        }
       
     return trigger_error('Unexpected login error in '.__CLASS__.' '.__METHOD__.' '.__LINE__  .'<br />'
      .'Please move to <a href="'.PMX_HOME_URL.'/modules.php?name=User_Registration">here...</a>', E_USER_ERROR);          
   }


danke + viele grüße
Titel: Re:User einloggen - bitte um Hilfe
Beitrag von: Webfan am 28 Mai 2014, 21:47:10
die letzte funktion welche noch zur veröffentlichung des modules fehlt, mennö...???

   public function login($uid)
    {
       global $user_prefix, $prefix;
         
          if(!function_exists('pmx_user_setlogin'))
                  require('includes'.DS.'mx_userfunctions.php');
           
             
            $q="SELECT * FROM ".$user_prefix."_users
            WHERE
             uid='".intval($uid)."'
             LIMIT 1
             ";
        $result = sql_query($q);
        while($row = sql_fetch_array($result))
         {

            $this->userdata = $row;
           pmx_user_setlogin($this->userdata, TRUE); 
            mxSessionDelVar('formvalues');
            mxSessionDelVar('ucountbadlogin');
           mxSessionDelVar('newusercheck');   
            mxSessionSetVar('lang', $this->userdata['user_lang']);
           mxSetUserSession($this->userdata['uid'], $this->userdata['uname'], $this->userdata['pass'], $this->userdata['storynum'], $this->userdata['umode'], $this->userdata['uorder'], $this->userdata['thold'], $this->userdata['noscore'], $this->userdata['ublockon'], $this->userdata['theme'], $this->userdata['commentmax']);
            pmx_run_hook('user.login', $this->userdata['uid']);
            return mxRedirect($this->nexturl);
         }
         
      return trigger_error('Unexpected login error in '.__CLASS__.' '.__METHOD__.' '.__LINE__  .'<br />'
       .'Please move to <a href="'.PMX_HOME_URL.'/modules.php?name=User_Registration">here...</a>', E_USER_ERROR);         
    }

:gruebel:
Titel: Re:User einloggen - bitte um Hilfe
Beitrag von: Webfan am 28 Mai 2014, 22:03:00
Fall gelöst:
Ich hatte vergessen bei der Registrierung user_stat=1 zu speichern!