Changeset 549
- Timestamp:
- Jun 18, 2013, 8:30:40 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Dictionary/Dictionary.php
r548 r549 18 18 $this->System->RegisterPage('dictionary.php', 'PageDictionary'); 19 19 $this->System->RegisterMenuItem(array( 20 'Name' => 'Dictionary', 20 21 'Title' => 'Slovníček', 21 22 'Hint' => 'Slovník WoW výrazů', … … 23 24 'Permission' => LICENCE_ANONYMOUS, 24 25 'Icon' => '', 25 ) );26 ), 1); 26 27 } 27 28 } -
trunk/Modules/FrontPage/FrontPage.php
r548 r549 23 23 'Permission' => LICENCE_ANONYMOUS, 24 24 'Icon' => '', 25 ) );25 ), 0); 26 26 } 27 28 function HandleLoginForm() 29 { 30 global $User, $Message, $MessageType; 31 32 if(array_key_exists('action', $_GET)) 33 { 34 if($_GET['action'] == 'login') 35 { 36 if(array_key_exists('LoginUser', $_POST) and array_key_exists('LoginPass', $_POST)) 37 { 38 $User->Login($_POST['LoginUser'], $_POST['LoginPass']); 39 if($User->Role == LICENCE_ANONYMOUS) 40 { 41 $Message = 'Jméno nebo heslo bylo zadáno špatně.'; 42 $MessageType = MESSAGE_CRITICAL; 43 } else 44 { 45 $Message = 'Přihlášení proběhlo úspěšně. Vítej <strong>'.$User->Name.'</strong>!'; 46 $MessageType = MESSAGE_INFORMATION; 47 } 48 } else 49 { 50 $Message = 'Nebylo zadáno jméno a heslo.'; 51 $MessageType = MESSAGE_CRITICAL; 52 } 53 } else 54 if($_GET['action'] == 'logout') 55 { 56 if($User->Role != LICENCE_ANONYMOUS) 57 { 58 WriteLog('Odhlášení', LOG_TYPE_USER); 59 $User->Logout(); 60 $Message = 'Byl jsi odhlášen.'; 61 $MessageType = MESSAGE_INFORMATION; 62 } 63 } 64 } 65 } 66 27 67 } 28 68 … … 31 71 function Show() 32 72 { 33 $Output = '<br />'. 73 global $Message, $MessageType; 74 75 $this->System->ModuleManager->Modules['FrontPage']->HandleLoginForm(); 76 $Output = ''; 77 if(isset($Message)) $Output .= ShowMessage($Message, $MessageType); 78 79 $Output .= '<br />'. 34 80 '<table class="Home"><tr><td colspan="3">'.$this->ShowWelcome(). 35 81 '</td></tr>'. … … 39 85 '</tr></table>'; 40 86 return($Output); 41 } 87 } 42 88 43 89 function ShowShoutbox() -
trunk/Modules/Team/Team.php
r548 r549 23 23 'Permission' => LICENCE_ANONYMOUS, 24 24 'Icon' => '', 25 ) );25 ), 1); 26 26 } 27 27 } -
trunk/Modules/User/User.php
r548 r549 32 32 'Permission' => LICENCE_ANONYMOUS, 33 33 'Icon' => '', 34 ) );34 ), 0); 35 35 } 36 36 } -
trunk/TranslationList.php
r545 r549 158 158 ' AND (`Sub`.`Entry` = `T`.`Entry`) AND (`Sub`.`Complete` = 1) AND '. 159 159 '(`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`))'; 160 else if($Filter['State'] == 2) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`Complete` = 1)'; 161 else if($Filter['State'] == 3) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`Language` != '.$Config['OriginalLanguage'].') AND (`Complete` = 0)'; 162 else if($Filter['State'] == 4) $Filter['SQL'] .= $VersionFilter.' AND (`Language` = '.$Config['OriginalLanguage'].')'; 160 else if($Filter['State'] == 2) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Complete` = 1)'; 161 else if($Filter['State'] == 3) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Language` != '.$Config['OriginalLanguage']. 162 ') AND (`T`.`Complete` = 0)'; 163 else if($Filter['State'] == 4) $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$Config['OriginalLanguage'].')'; 163 164 } 164 165 -
trunk/includes/Database.php
r542 r549 46 46 $this->ShowSQLQuery = false; 47 47 $this->LogSQLQuery = false; 48 $this->LogFile = 'Query.log';48 $this->LogFile = dirname(__FILE__).'/../Query.log'; 49 49 } 50 50 -
trunk/includes/Version.php
r547 r549 1 1 <?php 2 2 3 $Revision = 54 7; // Subversion revision3 $Revision = 549; // Subversion revision 4 4 $DatabaseRevision = 543; // Database structure revision 5 5 $ReleaseTime = '2013-06-18'; -
trunk/includes/global.php
r548 r549 16 16 include_once(dirname(__FILE__).'/../Modules/AoWoW/AoWoW.php'); 17 17 include_once(dirname(__FILE__).'/../Modules/Referrer/Referrer.php'); 18 include_once(dirname(__FILE__).'/../Modules/FrontPage/FrontPage.php');19 18 include_once(dirname(__FILE__).'/../Modules/Team/Team.php'); 20 19 include_once(dirname(__FILE__).'/../Modules/User/User.php'); 21 20 include_once(dirname(__FILE__).'/../Modules/Dictionary/Dictionary.php'); 21 include_once(dirname(__FILE__).'/../Modules/FrontPage/FrontPage.php'); 22 22 23 23 GlobalInit(); … … 645 645 } 646 646 647 function HandleLoginForm()648 {649 global $User, $Message, $MessageType;650 651 if(array_key_exists('action', $_GET))652 {653 if($_GET['action'] == 'login')654 {655 if(array_key_exists('LoginUser', $_POST) and array_key_exists('LoginPass', $_POST))656 {657 $User->Login($_POST['LoginUser'], $_POST['LoginPass']);658 if($User->Role == LICENCE_ANONYMOUS)659 {660 $Message = 'Jméno nebo heslo bylo zadáno špatně.';661 $MessageType = MESSAGE_CRITICAL;662 } else663 {664 $Message = 'Přihlášení proběhlo úspěšně. Vítej <strong>'.$User->Name.'</strong>!';665 $MessageType = MESSAGE_INFORMATION;666 }667 } else668 {669 $Message = 'Nebylo zadáno jméno a heslo.';670 $MessageType = MESSAGE_CRITICAL;671 }672 } else673 if($_GET['action'] == 'logout')674 {675 if($User->Role != LICENCE_ANONYMOUS)676 {677 WriteLog('Odhlášení', LOG_TYPE_USER);678 $User->Logout();679 $Message = 'Byl jsi odhlášen.';680 $MessageType = MESSAGE_INFORMATION;681 }682 }683 }684 }685 686 647 function ProcessURL() 687 648 { -
trunk/includes/system.php
r548 r549 146 146 } 147 147 148 function RegisterMenuItem($MenuItem )148 function RegisterMenuItem($MenuItem, $Pos = NULL) 149 149 { 150 $this->Menu[] = $MenuItem; 150 if(is_null($Pos)) $this->Menu[] = $MenuItem; 151 else { 152 array_splice($this->Menu, $Pos, 0, array($MenuItem)); 153 } 151 154 } 152 155 -
trunk/index.php
r545 r549 2 2 3 3 include_once('includes/global.php'); 4 5 6 HandleLoginForm();7 8 $Output = '';9 if(isset($Message)) $Output .= ShowMessage($Message, $MessageType);10 4 11 5 $System->PathItems = ProcessURL(); -
trunk/save.php
r536 r549 8 8 9 9 unset($Message); 10 HandleLoginForm();10 $System->ModuleManager->Modules['FrontPage']->HandleLoginForm(); 11 11 if(isset($Message)) $Output .= ShowMessage($Message, $MessageType); 12 12 … … 31 31 32 32 // Get data for english original 33 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry'].') AND (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')'); 33 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry']. 34 ') AND (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart']. 35 ') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')'); 34 36 if($DbResult->num_rows > 0) 35 37 { … … 47 49 { 48 50 // Get user translation paired to found english item entry 49 $DbResult2 = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$User->Id.') AND (`Entry` = '.$EnglishFound['Entry'].') AND (`VersionStart` = '.$EnglishFound['VersionStart'].') AND (`VersionEnd` = '.$EnglishFound['VersionEnd'].')'); 51 $DbResult2 = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`User` = '.$User->Id. 52 ') AND (`Entry` = '.$EnglishFound['Entry'].') AND (`VersionStart` = '.$EnglishFound['VersionStart']. 53 ') AND (`VersionEnd` = '.$EnglishFound['VersionEnd'].')'); 50 54 if($DbResult2->num_rows > 0) 51 55 {
Note:
See TracChangeset
for help on using the changeset viewer.