aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-01 14:02:50 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-01 14:02:50 +0000
commitb640dc452ae9d67c02662997f6c5b6e0d900e4b9 (patch)
tree8cddeeb3192292ac0704bf720aa6f312dcbd299f
parenta08509ec171b12f609a8941c86541f3a413ea913 (diff)
downloadelgg-b640dc452ae9d67c02662997f6c5b6e0d900e4b9.tar.gz
elgg-b640dc452ae9d67c02662997f6c5b6e0d900e4b9.tar.bz2
Fixed some session stuff, modified a few views
git-svn-id: https://code.elgg.org/elgg/trunk@303 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/sessions.php3
-rw-r--r--languages/en.php7
-rw-r--r--views/default/navigation/topmenu.php2
-rw-r--r--views/default/page_elements/header.php2
-rw-r--r--views/default/welcome.php13
-rw-r--r--views/default/welcome/logged_in.php22
-rw-r--r--views/default/welcome/logged_out.php23
7 files changed, 65 insertions, 7 deletions
diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php
index 4b067da56..f93f2f294 100644
--- a/engine/lib/sessions.php
+++ b/engine/lib/sessions.php
@@ -126,9 +126,11 @@
$_SESSION['code'] = $_COOKIE['elggperm'];
} else {
$_SESSION['id'] = -1;
+ $_SESSION['guid'] = -1;
}
} else {
$_SESSION['id'] = -1;
+ $_SESSION['guid'] = -1;
}
} else {
if (!empty($_SESSION['code'])) {
@@ -138,6 +140,7 @@
} else {
}
} else {
+ $_SESSION['guid'] = -1;
$_SESSION['id'] = -1;
}
}
diff --git a/languages/en.php b/languages/en.php
index f77c645a5..23f398c93 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -46,6 +46,13 @@
'account' => "Account",
+ /**
+ * Welcome
+ */
+
+ 'welcome' => "Welcome %s",
+ 'welcome_message' => "Welcome to this Elgg installation.",
+
);
add_translation("en",$english);
diff --git a/views/default/navigation/topmenu.php b/views/default/navigation/topmenu.php
index 4f50a409c..df8cf4eb9 100644
--- a/views/default/navigation/topmenu.php
+++ b/views/default/navigation/topmenu.php
@@ -16,7 +16,7 @@
?>
<?php
- if($_SESSION['id'] != -1){
+ if (isloggedin()) {
?>
<div id="topmenu">
<ul>
diff --git a/views/default/page_elements/header.php b/views/default/page_elements/header.php
index 5b90d8bc5..a4de86c21 100644
--- a/views/default/page_elements/header.php
+++ b/views/default/page_elements/header.php
@@ -39,7 +39,7 @@
<div id="container">
<div id="header">
<!-- display the page title -->
- <h1><?php echo $title; ?></h1>
+ <h1><a href="<?php echo $vars['url']; ?>"><?php echo $title; ?></a></h1>
<!-- display top level navigation -->
<?php echo elgg_view('navigation/topmenu'); ?>
</div><!-- close the header div --> \ No newline at end of file
diff --git a/views/default/welcome.php b/views/default/welcome.php
index f6f7109f9..4739fc586 100644
--- a/views/default/welcome.php
+++ b/views/default/welcome.php
@@ -11,9 +11,12 @@
* @link http://elgg.org/
*/
- $user = $vars['name'];
+ $user = $vars['name'];
-?>
-
-<p>Welcome <?php echo $user; ?></p>
-<p><a href="<?php echo $vars['url']; ?>action/logout"><?php echo elgg_echo('logout'); ?></a></p> \ No newline at end of file
+ if (isloggedin()) {
+ echo elgg_view("welcome/logged_in");
+ } else {
+ echo elgg_view("welcome/logged_out");
+ }
+
+?> \ No newline at end of file
diff --git a/views/default/welcome/logged_in.php b/views/default/welcome/logged_in.php
new file mode 100644
index 000000000..e6096142f
--- /dev/null
+++ b/views/default/welcome/logged_in.php
@@ -0,0 +1,22 @@
+<?php
+
+ /**
+ * Elgg sample welcome page (logged in)
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+?>
+
+ <h2><?php echo sprintf(elgg_echo("welcome"),$vars['user']->username); ?></h2>
+ <p>
+ <?php echo elgg_echo("welcome_message"); ?>
+ </p>
+ <p>
+ <a href="<?php echo $vars['url']; ?>action/logout"><?php echo elgg_echo('logout'); ?></a>
+ </p> \ No newline at end of file
diff --git a/views/default/welcome/logged_out.php b/views/default/welcome/logged_out.php
new file mode 100644
index 000000000..47e9ac19f
--- /dev/null
+++ b/views/default/welcome/logged_out.php
@@ -0,0 +1,23 @@
+<?php
+
+ /**
+ * Elgg sample welcome page (logged out)
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+?>
+
+ <p>
+ <?php echo elgg_echo("welcome_message"); ?>
+ </p>
+ <?php
+
+ echo elgg_view("login");
+
+ ?> \ No newline at end of file