Changeset 505 for trunk/includes/global.php
- Timestamp:
- Feb 14, 2013, 8:24:52 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global.php
r504 r505 35 35 LogReferrer(); 36 36 37 $RSSChannels = array( 38 array('Title' => 'Změny systému', 'Channel' => 'news'), 39 array('Title' => 'Poslední překlady', 'Channel' => 'translation'), 40 array('Title' => 'Shoutbox', 'Channel' => 'shoutbox'), 41 ); 42 37 43 function GetMicrotime() 38 44 { … … 74 80 } else 75 81 { 76 $Output .= '<span class="MenuItem2"><form action=" ?action=login" method="post"> Jméno: <input type="text" name="LoginUser" size="8 " /> Heslo: <td><input type="password" name="LoginPass" size="8" /> <input type="submit" value="Přihlásit" /></form> <a href="'.$System->Link('/registrace.php').'">Registrace</a></span>';82 $Output .= '<span class="MenuItem2"><form action="'.$System->Link('/?action=login').'" method="post"> Jméno: <input type="text" name="LoginUser" size="8 " /> Heslo: <td><input type="password" name="LoginPass" size="8" /> <input type="submit" value="Přihlásit" /></form> <a href="'.$System->Link('/registrace.php').'">Registrace</a></span>'; 77 83 } 78 84 $Output .= '</div>'; … … 207 213 function ShowHeader() 208 214 { 209 global $User, $RSSChannels, $ PageFooterRequested, $System;215 global $User, $RSSChannels, $System; 210 216 211 217 $Output = '<?xml version="1.0" encoding="'.$System->Config['Web']['Charset'].'"?> … … 222 228 if(isset($RSSChannels)) 223 229 foreach($RSSChannels as $Channel) 224 $Output .= ' <link rel="alternate" title="'.$Channel['Title'].'" href="'.$Channel['URL'].'" type="application/rss+xml" />'; 230 $Output .= ' <link rel="alternate" title="'.$Channel['Title'].'" href="'. 231 $System->Link('/rss.php?channel='.$Channel['Channel']).'" type="application/rss+xml" />'; 225 232 $Output .= '<title>'.$System->Config['Web']['Title'].'</title> 226 233 </head> 227 234 <body>'; 228 235 229 if(array_key_exists('action', $_GET))230 {231 if($_GET['action'] == 'login')232 {233 if(array_key_exists('LoginUser', $_POST) and array_key_exists('LoginPass', $_POST))234 {235 $User->Login($_POST['LoginUser'], $_POST['LoginPass']);236 if($User->Role == LICENCE_ANONYMOUS)237 {238 $Message = 'Jméno nebo heslo bylo zadáno špatně.';239 $MessageType = MESSAGE_CRITICAL;240 } else241 {242 $Message = 'Přihlášení proběhlo úspěšně. Vítej <strong>'.$User->Name.'</strong>!';243 $MessageType = MESSAGE_INFORMATION;244 }245 } else246 {247 $Message = 'Nebylo zadáno jméno a heslo.';248 $MessageType = MESSAGE_CRITICAL;249 }250 } else251 if($_GET['action'] == 'logout')252 {253 if($User->Role != LICENCE_ANONYMOUS)254 {255 WriteLog('Odhlášení', LOG_TYPE_USER);256 $User->Logout();257 $Message = 'Byl jsi odhlášen.';258 $MessageType = MESSAGE_INFORMATION;259 }260 }261 }262 236 $Output .= ShowTopBar(); 263 264 237 $Output .= '<table class="page"><tr><td class="menu">'; 265 238 $Output .= ShowMainMenu(); … … 268 241 $Output .= ShowSearchBox(); 269 242 $Output .= '</td><td id="border-left"></td><td class="content">'; 270 $PageFooterRequested = true;271 243 if(isset($Message)) $Output .= ShowMessage($Message, $MessageType); 272 244 return($Output); … … 275 247 function ShowFooter() 276 248 { 277 global $System, $ScriptStartTime, $PageFooterRequested, $User; 278 279 if(isset($PageFooterRequested)) 280 { 249 global $System, $ScriptStartTime, $User; 250 281 251 $ScriptGenerateDuration = round(GetMicrotime() - $ScriptStartTime, 2); 282 252 … … 299 269 $User->Store(); 300 270 return($Output); 301 } else return('');302 271 } 303 272 … … 325 294 return($Value.' '.$UnitNames[$UnitIndex]); 326 295 } 327 328 296 329 297 function GetQueryStringArray($QueryString)
Note:
See TracChangeset
for help on using the changeset viewer.