Ignore:
Timestamp:
Oct 14, 2008, 6:18:40 PM (16 years ago)
Author:
maron
Message:

Odhlášení, frontend.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3/class/user.php

    r28 r29  
    2323    // Lookup user record
    2424    $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"');
    25     if($Query->num_rows > 0)
     25    if($this->Database->LastDataSet)
    2626    {
    2727      // Refresh time of last access
     
    5656    if(($Data['Email'] == '') || ($Data['Nick'] == '') || ($Data['Password'] == '') || ($Data['Password2'] == '')) $Result = DATA_MISSING;
    5757    else if($Data['Password'] != $Data['Password2']) $Result = PASSWORDS_UNMATCHED;
     58    else if(isset($Data['Rule']) == false) $Result = RULE_UNCHECK;
    5859    else
    5960    {
    6061      // Je uživatel registrován?
    6162      $Query = $this->Database->select('User', '*', 'Name = "'.$Data['Nick'].'"');
    62       if($this->Database->Last_num_rows > 0) $Result = NICK_USED;
     63      if($this->Database->LastDataSet) $Result = NICK_USED;
    6364      else
    6465      {
     
    9798    $SID = session_id();
    9899    $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => $this->AnonymousUserId));
     100    $this->Check();
    99101    return(USER_LOGGED_OUT);
    100102  }
     
    104106    $this->user['Permission'] = array();
    105107    $DbResult = $this->Database->select('Permission','*','ID='.$Permission);
    106     if($DbResult->num_rows > 0)
     108    if($this->Database->LastDataSet)
    107109    while($DbRow = $DbResult->fetch_array())
    108110      $this->user['Permission'] = $DbRow;
    109111  }
    110  
    111   function WriteRegistration()
    112   { // BEGIN function WriteRegistration
    113         echo '<h2>'.REGISTRATION_PAGE_TITLE.'</h2>
    114     <form action="" method="post">
    115     <table cellspacing="0">
    116     <tr><td>'.REGISTRATION_PAGE_NAME.'</td><td><input name="Nick" type="text" /></td></tr>
    117     <tr><td>'.REGISTRATION_PAGE_PASS.'</td><td><input name="Password" type="password" /></td></tr>
    118     <tr><td>'.REGISTRATION_PAGE_PASS2.'</td><td><input name="Password2" type="password" /></td></tr>
    119     <tr><td>'.REGISTRATION_PAGE_EMAIL.'</td><td><input name="Email" type="text" /></td></tr>
    120     <tr><td>'.REGISTRATION_PAGE_FULLNAME.'</td><td><input name="FullName" type="text" /></td></tr>
    121     <tr><td>'.REGISTRATION_PAGE_LANGUAGE.'</td><td><select name="Language">';
    122       $Query = $this->Database->select('language', '*');
    123       while($DbRow = $Query->fetch_array())
    124       { if ($DbRow['Id'] == 2)
    125         echo '<option value="'.$DbRow['Id'].'" selected="true">'.$DbRow['Name'].'</option>';
    126         else
    127         echo '<option value="'.$DbRow['Id'].'">'.$DbRow['Name'].'</option>';
    128       }
    129       echo '</select></td></tr>
    130     <tr><td></td><td align="right"><input name="Register" value="'.REGISTRATION_PAGE_BUTTON.'" type="submit" /></td></tr>
    131      </table>
    132     </form>';
    133   } // END function WriteRegistration
    134  
    135   function WriteLogin()
    136   { // BEGIN function WriteLogin
    137         echo '<h2>'.LOGIN_PAGE_TITLE.'</h2>
    138     <form action="" method="post">
    139     <table cellspacing="0">
    140     <tr><td>'.LOGIN_PAGE_NAME.'</td><td><input name="Nick" type="text" /></td></tr>
    141     <tr><td>'.LOGIN_PAGE_PASS.'</td><td><input name="Password" type="password" /></td></tr>
    142     <tr><td></td><td align="right"><input name="Login" value="'.LOGIN_PAGE_BUTTON.'" type="submit" /></td></tr>
    143      </table>
    144     </form>';
    145   } // END function WriteLogin
    146  
     112   
    147113  function Role()
    148114  { // BEGIN function State
Note: See TracChangeset for help on using the changeset viewer.