Changeset 96
- Timestamp:
- Jul 31, 2008, 12:09:43 PM (16 years ago)
- Location:
- devel/www
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/www/aktuality/index.php
r87 r96 26 26 switch($_GET['action']) 27 27 { 28 case 'view': 29 if(!$this->System->Modules['User']->CheckPermission('News', 'Display', 'Item')) $Output .= 'Nemáte oprávnění'; 30 else 31 { 32 if(array_key_exists('id', $_GET)) $Id = $_GET['id'] * 1; 33 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `news`.`id`='.$Id); 34 if($DbResult->num_rows > 0) 35 { 36 $Row = $DbResult->fetch_array(); 37 $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong>'.$Row['title'].' ('.HumanDate($Row['date']).', '.$Row['Name'].$Row['author'].')</strong>'; 38 if($this->System->Modules['User']->User['Id'] == $Row['User']) 39 { 40 $Output .= ' <a href="index.php?action=del&category='.$Category.'&id='.$Row['id'].'">Smazat</a>'; 41 $Output .= ' <a href="index.php?action=edit&category='.$Category.'&id='.$Row['id'].'">Editovat</a>'; 42 } 43 $Output .= '</div>'.$Row['content'].'<br />'; 44 if($Row['enclosure'] != '') 45 { 46 $Output .= '<br />Přílohy: '; 47 $Enclosures = explode(';', $Row['enclosure']); 48 foreach($Enclosures as $Enclosure) 49 { 50 if(file_exists($this->UploadedFilesFolder.$Enclosure)) $Output .= ' <a href="'.$this->UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>'; 51 } 52 } 53 $Output .= '</div>'; 54 } else $Output .= 'Položka nenalezena.'; 55 } 56 break; 28 57 case 'add': 29 58 $Output .= '<strong>Vložení nové aktuality:</strong><br />'; -
devel/www/aktuality/news.php
r87 r96 38 38 while($Row = $DbResult->fetch_array()) 39 39 { 40 $Output .= '<tr><td on mouseover="zobraz('."'new".$Category.$Index."'".')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Row['Name'].$Row['author'].' ('.HumanDate($Row['date']).')</td></tr></table>';40 $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&id='.$Row['id'].'\'" onmouseover="zobraz('."'new".$Category.$Index."'".')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Row['Name'].$Row['author'].' ('.HumanDate($Row['date']).')</td></tr></table>'; 41 41 $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$Row['content']; 42 42 … … 60 60 return($Output); 61 61 } 62 62 63 63 function LoadSettingsFromCookies() 64 64 { … … 85 85 function Show() 86 86 { 87 $Output = '<div class="PanelTitle"><span id="MenuItem">Aktuálně:</span><div id="MenuItem2"><a href="?Action=CustomizeNews">Upravit</a></div></div>';87 $Output = '<div class="PanelTitle"><span class="MenuItem">Aktuálně:</span><div class="MenuItem2"><a href="?Action=CustomizeNews">Upravit</a></div></div>'; 88 88 89 89 $UploadedFilesFolder = 'aktuality/uploads/'; -
devel/www/finance/manage.php
r87 r96 361 361 } 362 362 } 363 363 364 } 364 365 -
devel/www/form_classes.php
r87 r96 71 71 ), 72 72 ), 73 'PasswordRecovery' => array( 74 'Title' => 'Obnova hesla', 75 'Table' => '', 76 'Items' => array( 77 'Name' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''), 78 'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''), 79 ), 80 ), 73 81 'NewNetworkDevice' => array( 74 82 'Title' => 'Vložit nové zařízení', -
devel/www/global.php
r89 r96 9 9 include('database.php'); 10 10 include('error.php'); 11 include_once('code.php'); 11 12 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']); 12 13 $Database->Prefix = $Config['Database']['Prefix']; -
devel/www/index.php
r87 r96 262 262 } 263 263 if($_GET['Action'] == 'UserRegister') 264 { 264 { 265 265 $UserRegister = new Form('UserRegister'); 266 266 $UserRegister->OnSubmit = '?Action=UserRegisterSave'; 267 267 $Output .= $UserRegister->ShowEditForm(); 268 268 } else 269 if($_GET['Action'] == 'PasswordRecovery') 270 { 271 $Form = new Form('PasswordRecovery'); 272 $Form->OnSubmit = '?Action=PasswordRecovery2'; 273 $Output .= $Form->ShowEditForm(); 274 } else 275 if($_GET['Action'] == 'PasswordRecovery2') 276 { 277 $Form = new Form('PasswordRecovery'); 278 $Form->LoadValuesFromForm(); 279 280 $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email'])); 281 } else 282 if($_GET['Action'] == 'PasswordRecoveryConfirm') 283 { 284 $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P'])); 285 } else 269 286 if($_GET['Action'] == 'UserRegisterSave') 270 { 287 { 271 288 $UserRegister = new Form('UserRegister', array()); 272 289 $UserRegister->LoadValuesFromForm(); -
devel/www/style.css
r87 r96 91 91 margin: 0px 0px 0px 0px; 92 92 padding: 0px 0px 0px 0px; 93 border : 0px 0px 0px 0px;93 border-width: 0px 0px 0px 0px; 94 94 vertical-align: middle; 95 95 } -
devel/www/user.php
r87 r96 12 12 define('USER_LOGGED_OUT', 'Byl jste odhlášen.'); 13 13 define('BAD_PASSWORD', 'Špatné heslo.'); 14 define('USER_NOT_FOUND', 'Uživatele nenalezen.'); 14 15 define('USER_TIMEOUT', 300); // in seconds 16 define('USER_PASSWORD_RECOVERY_SUCCESS', 'Přihlašovací údaje byly odeslány na zadanou emailovou adresu.'); 17 define('USER_PASSWORD_RECOVERY_FAIL', 'Podle zadaných údajů nebyl nalezen žádný uživatel.'); 18 define('USER_PASSWORD_RECOVERY_CONFIRMED', 'Nové heslo bylo aktivováno.'); 15 19 16 20 define('USER_EVENT_REGISTER', 1); … … 26 30 var $DefaultRole = 2; 27 31 var $AnonymousUserId = 1; 28 32 29 33 function Check() 30 34 { … … 181 185 } else return(false); 182 186 } 187 188 function PasswordRecoveryRequest($Name, $Email) 189 { 190 global $Config; 191 192 $DbResult = $this->Database->select('User', 'Name, Id, Email, Password', '`Name`="'.$Name.'" AND `Email`="'.$Email.'"'); 193 if($DbResult->num_rows > 0) 194 { 195 $Row = $DbResult->fetch_array(); 196 $NewPassword = substr(sha1(strtoupper($Row['Name'])), 0, 7); 197 198 $Subject = 'Obnova hesla'; 199 $Message = 'Požádali jste o zaslání nového hesla na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."</a>.<br>\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br><br>\n\nVaše nové heslo k účtu ".$Row['Name']." je: ".$NewPassword."\n<br>Pro aktivaci tohoto hesla klikněte na ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=PasswordRecoveryConfirm&User='.$Row['Id'].'&H='.$Row['Password'].'&P='.$NewPassword.'">tento odkaz</a>.'."\n<br> Po přihlášení si prosím změňte heslo na nové.\n\n<br><br>Na tento email neodpovídejte."; 200 $AdditionalHeaders = "To: ".$Row['Name']." <".$Row['Email'].">\n"."From: ".from_utf8($Config['Web']['Title'], 'iso2')." <noreplay@zdechov.net>\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=utf-8"; 201 mail($Row['Email'], $Subject, $Message, $AdditionalHeaders); 202 $Output = USER_PASSWORD_RECOVERY_SUCCESS; 203 } else $Output = USER_PASSWORD_RECOVERY_FAIL; 204 return($Output); 205 } 206 207 function PasswordRecoveryConfirm($Id, $Hash, $NewPassword) 208 { 209 $DbResult = $this->Database->select('User', 'Id, Name, Password', 'Id = '.$Id); 210 if($DbResult->num_rows > 0) 211 { 212 $Row = $DbResult->fetch_array(); 213 $NewPassword2 = substr(sha1(strtoupper($Row['Name'])), 0, 7); 214 if(($NewPassword == $NewPassword2) and ($Hash == $Row['Password'])) 215 { 216 $this->Database->update('User', 'Id='.$Row['Id'], array('Password' => sha1($NewPassword))); 217 $Output = USER_PASSWORD_RECOVERY_CONFIRMED; 218 } else $Output = PASSWORDS_UNMATCHED; 219 } else $Output = USER_NOT_FOUND; 220 return($Output); 221 } 183 222 } 184 223
Note:
See TracChangeset
for help on using the changeset viewer.