Changeset 29 for branches/3/class/user.php
- Timestamp:
- Oct 14, 2008, 6:18:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3/class/user.php
r28 r29 23 23 // Lookup user record 24 24 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"'); 25 if($ Query->num_rows > 0)25 if($this->Database->LastDataSet) 26 26 { 27 27 // Refresh time of last access … … 56 56 if(($Data['Email'] == '') || ($Data['Nick'] == '') || ($Data['Password'] == '') || ($Data['Password2'] == '')) $Result = DATA_MISSING; 57 57 else if($Data['Password'] != $Data['Password2']) $Result = PASSWORDS_UNMATCHED; 58 else if(isset($Data['Rule']) == false) $Result = RULE_UNCHECK; 58 59 else 59 60 { 60 61 // Je uživatel registrován? 61 62 $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; 63 64 else 64 65 { … … 97 98 $SID = session_id(); 98 99 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => $this->AnonymousUserId)); 100 $this->Check(); 99 101 return(USER_LOGGED_OUT); 100 102 } … … 104 106 $this->user['Permission'] = array(); 105 107 $DbResult = $this->Database->select('Permission','*','ID='.$Permission); 106 if($ DbResult->num_rows > 0)108 if($this->Database->LastDataSet) 107 109 while($DbRow = $DbResult->fetch_array()) 108 110 $this->user['Permission'] = $DbRow; 109 111 } 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 147 113 function Role() 148 114 { // BEGIN function State
Note:
See TracChangeset
for help on using the changeset viewer.