Changeset 787 for trunk/Modules/User/Registration.php
- Timestamp:
- Feb 7, 2014, 5:14:20 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/Registration.php
r636 r787 64 64 </tr>'; 65 65 $Output .= '</td></tr>'. 66 '<tr><td>Upřednostněná verze klienta: </td><td>'.ClientVersionSelection('').'</td></tr>'; 67 $Output .= '<tr> 66 '<tr><td>Upřednostněná verze klienta: </td><td>'.ClientVersionSelection('').'</td></tr>'; 67 68 $Output .= '<tr><td>'; 69 $Query = 'SELECT * FROM UserTagType'; 70 $DbResult = $this->Database->query($Query); 71 $Output .= 'Vyberte pravidla, kterými se při překladu chcete řídit:</td><td>'; 72 while ($UserTag = $DbResult->fetch_array()) { 73 $checked = false; 74 75 $Output .= CheckBox('Tag'.$UserTag['ID'], $checked, 'CheckBox'); 76 $Output .= ''.$UserTag['Text'].'<br />'; 77 } 78 $Output .= '</td></tr>'; 79 80 $Output .= '<tr> 68 81 <th><input type="submit" value="Registrovat" /></th> 69 82 </tr> … … 112 125 $this->System->ModuleManager->Modules['Log']->WriteLog('Uživatel se zaregistroval: '.$UserName, LOG_TYPE_USER); 113 126 $ShowForm = false; 127 128 //tag 129 $Query = 'SELECT * FROM UserTagType'; 130 $DbResult = $this->Database->query($Query); 131 while ($UserTag = $DbResult->fetch_array()) { 132 if (array_key_exists('Tag'.$UserTag['ID'], $_POST)) { 133 $Query = 'SELECT * FROM `UserTag` '. 134 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 135 $DbResult2 = $this->Database->query($Query); 136 if ($DbResult2->num_rows == 0) { 137 $Query = 'INSERT INTO `UserTag` (`ID` ,`UserTagType`,`User` ) '. 138 'VALUES (NULL, '.$UserTag['ID'].' , '.($this->System->User->Id * 1).')'; 139 $DbResult2 = $this->Database->query($Query); 140 } 141 } else { 142 $Query = 'DELETE FROM `UserTag` '. 143 'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($this->System->User->Id * 1); 144 $DbResult2 = $this->Database->query($Query); 145 } 146 } 147 148 149 114 150 } else $Output = ShowMessage('Uživatel se zadanou přezdívkou již existuje.', MESSAGE_CRITICAL); 115 151 } else $Output = ShowMessage('Hesla se neshodují.', MESSAGE_CRITICAL);
Note:
See TracChangeset
for help on using the changeset viewer.