Browse Source

add 302 redirect on login for guest, add custom meta titles

main
ghost 3 years ago
parent
commit
beb4537184
  1. 9
      src/application/controller/index.php
  2. 2
      src/application/controller/login.php
  3. 2
      src/application/controller/register.php
  4. 2
      src/application/view/common/header.phtml

9
src/application/controller/index.php

@ -1,5 +1,10 @@
<?php <?php
//require(PROJECT_DIR . '/application/view/index.phtml'); if (!isset($_SESSION['username'])) {
require(PROJECT_DIR . '/application/controller/login.php'); header('Location: ' . PROJECT_HOST . '/login', true, 302);
}
$metaTitle = _('Home | Twisterarmy Cloud');
require(PROJECT_DIR . '/application/view/index.phtml');

2
src/application/controller/login.php

@ -7,6 +7,8 @@ $userPrivateKey = false;
$errorUserName = false; $errorUserName = false;
$errorUserPrivateKey = false; $errorUserPrivateKey = false;
$metaTitle = _('Login | Twisterarmy Cloud');
// Process form request // Process form request
if (isset($_POST) && $_POST) { if (isset($_POST) && $_POST) {

2
src/application/controller/register.php

@ -4,4 +4,6 @@ if (isset($_SESSION['username'])) {
header('Location: ' . PROJECT_HOST, true, 302); header('Location: ' . PROJECT_HOST, true, 302);
} }
$metaTitle = _('Register | Twisterarmy Cloud');
require(PROJECT_DIR . '/application/view/register.phtml'); require(PROJECT_DIR . '/application/view/register.phtml');

2
src/application/view/common/header.phtml

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title><?php echo _('Login twister | Twisterarmy Cloud') ?></title> <title><?php echo $metaTitle ?></title>
<meta name="description" content="Twisterarmy Cloud is the open source web interface to interact twister network without node installation." /> <meta name="description" content="Twisterarmy Cloud is the open source web interface to interact twister network without node installation." />
<link rel="stylesheet" type="text/css" href="css/font.css" /> <link rel="stylesheet" type="text/css" href="css/font.css" />
<link rel="stylesheet" type="text/css" href="css/bi.css" /> <link rel="stylesheet" type="text/css" href="css/bi.css" />

Loading…
Cancel
Save