Changeset 14


Ignore:
Timestamp:
Jun 19, 2012, 12:09:30 PM (12 years ago)
Author:
maron
Message:

přihlášení

Location:
trunk/class
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/class/Gui.php

    r11 r14  
    4949       
    5050        //generate and shows active page
    51         $this->Pages[$this->ActivePage]->Show();
     51        if (isset($this->Pages[$this->ActivePage])) $this->Pages[$this->ActivePage]->Show();
    5252       
    5353        $this->ShowFooter();
  • trunk/class/Message.php

    r12 r14  
    3333          if (isset($arraytest[$par3])) $this->par3 = $arraytest[$par3];
    3434         
    35           $this->Activate();
    3635  }
    3736
  • trunk/class/Messages.php

    r12 r14  
    3434  public function RegMess($User) {
    3535          $Login = new Message('post','LoginUser',$User,'Login','LoginUser','LoginPass');
    36          
     36          $Login->Activate();
     37          $Regin = new Message('post','RegUser',$User,'Register','Email','RegUser','RegPass','RegPass2');
     38          echo ($Regin->Activate());
    3739  }
    3840
  • trunk/class/User.php

    r11 r14  
    3232  function Login($Name, $Password)
    3333  {
    34           ECHO 'TES';
    3534    $DbResult = $this->Database->query('SELECT `ID` FROM `User` WHERE LOWER(`Name`) = LOWER("'.$Name.'") AND `Pass` = '.$this->CryptPasswordSQL('"'.$Password.'"', '`Salt`'));
    3635    if($DbResult->num_rows > 0)
     
    4241      $this->UpdateState();
    4342    } else $ŧhis->Role = LICENCE_ANONYMOUS;
     43  }
     44 
     45  function Register($Email,$RegUser,$RegPass,$RegPass2)
     46  {
     47         
     48         if ($RegPass != $RegPass2) return -1;
     49         
     50         $Salt = $this->GetPasswordSalt();
     51         
     52         $DbResult = $this->Database->insert('User', array(
     53         'Email' => '"'.$Email.'"',
     54         'Name' => '"'.$RegUser.'"',
     55         'Pass' => $this->CryptPasswordSQL('"'.$RegPass.'"', '"'.$Salt.'"'),
     56         'LastIP' => '"'.$_SERVER['REMOTE_ADDR'].'"',
     57         'Salt' => '"'.$Salt.'"',
     58         )
     59         );
     60         
     61         
     62          return $DbResult;
     63         
    4464  }
    4565 
     
    5777    // Security: Password and Salt hash should not be loaded to variables
    5878    $this->Id = $User['ID'];
    59     $this->Team = $User['Team'];
    6079    $this->Name = $User['Name'];
    61     $this->Role = $User['GM'];
     80    $this->Role = LICENCE_USER;
    6281    $this->Email = $User['Email'];
    6382  }
     
    86105    $this->Name = 'anonymous';
    87106    $this->Role = LICENCE_ANONYMOUS;
    88     $this->Language = 1;
    89     $this->Redirecting = 1;
    90     $this->Team = 0;
    91107    $this->Email = '';
    92108  }
Note: See TracChangeset for help on using the changeset viewer.