summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/controllers/after_install.php30
-rw-r--r--core/helpers/core_installer.php8
-rw-r--r--core/helpers/core_theme.php4
-rw-r--r--core/views/after_install.html.php28
-rw-r--r--core/views/after_install_loader.html.php6
5 files changed, 72 insertions, 4 deletions
diff --git a/core/controllers/after_install.php b/core/controllers/after_install.php
new file mode 100644
index 00000000..ac5756b9
--- /dev/null
+++ b/core/controllers/after_install.php
@@ -0,0 +1,30 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class After_Install_Controller extends Controller {
+ public function index() {
+ if (!user::active()->admin) {
+ url::redirect("albums/1");
+ }
+
+ $v = new View("after_install.html");
+ $v->user = user::active();
+ print $v;
+ }
+}
diff --git a/core/helpers/core_installer.php b/core/helpers/core_installer.php
index 06cd8d91..5c3b9ff0 100644
--- a/core/helpers/core_installer.php
+++ b/core/helpers/core_installer.php
@@ -82,7 +82,7 @@ class core_installer {
PRIMARY KEY (`id`),
KEY `parent_id` (`parent_id`),
KEY `type` (`type`),
- KEY `random` (`rand_key` DESC))
+ KEY `random` (`rand_key`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
$db->query("CREATE TABLE {logs} (
@@ -122,7 +122,7 @@ class core_installer {
PRIMARY KEY (`id`),
UNIQUE KEY(`name`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
-
+
$db->query("CREATE TABLE {permissions} (
`id` int(9) NOT NULL auto_increment,
`name` varchar(64) default NULL,
@@ -195,9 +195,9 @@ class core_installer {
access::register_permission("edit", "Edit");
$root = ORM::factory("item");
- $root->type = 'album';
+ $root->type = "album";
$root->title = "Gallery";
- $root->description = "Welcome to your Gallery3";
+ $root->description = "";
$root->left = 1;
$root->right = 2;
$root->parent_id = 0;
diff --git a/core/helpers/core_theme.php b/core/helpers/core_theme.php
index db40f368..eed64ded 100644
--- a/core/helpers/core_theme.php
+++ b/core/helpers/core_theme.php
@@ -88,6 +88,10 @@ class core_theme_Core {
if (Session::instance()->get("l10n_mode", false)) {
return L10n_Client_Controller::l10n_form();
}
+
+ if (Input::instance()->get("after_install")) {
+ return new View("after_install_loader.html");
+ }
}
static function admin_page_bottom($theme) {
diff --git a/core/views/after_install.html.php b/core/views/after_install.html.php
new file mode 100644
index 00000000..443141b5
--- /dev/null
+++ b/core/views/after_install.html.php
@@ -0,0 +1,28 @@
+<h1 style="display: none">
+ <?= t("Welcome to Gallery 3!") ?>
+</h1>
+
+<p>
+ <?= t("Congratulations on choosing Gallery to host your photos. We're confident that you're going to have a great experience.") ?>
+</p>
+
+<p>
+ <?= t("You're logged in to the <b>%user_name</b> account. The very first thing you should do is to change your password to something that you'll remember.", array("user_name" => $user->name)) ?>
+</p>
+
+<p>
+ <a href="<?= url::site("form/edit/users/{$user->id}") ?>"
+ title="<?= t("Edit Your Profile") ?>"
+ id="gAfterInstallChangePasswordLink"><?= t("Change Password Now") ?></a>
+ <script>
+ $("#gAfterInstallChangePasswordLink").bind("click", handleDialogEvent);
+ </script>
+</p>
+
+<p>
+ <?= t("Want to learn more about Gallery? The <a href=\"%url\">Gallery website</a> has news and information about Gallery and the Gallery community.", array("url" => "http://gallery.menalto.com")) ?>
+</p>
+
+<p>
+ <?= t("Having problems? We've got lots of information in our <a href=\"%codex_url\">documentation site</a> or you can <a href=\"%forum_url\">ask for help in the forums!</a>", array("codex_url" => "http://codex.gallery2.org/Main_Page", "forum_url" => "http://gallery.menalto.com/forum")) ?>
+</ul>
diff --git a/core/views/after_install_loader.html.php b/core/views/after_install_loader.html.php
new file mode 100644
index 00000000..0e0ea1d0
--- /dev/null
+++ b/core/views/after_install_loader.html.php
@@ -0,0 +1,6 @@
+<span id="gAfterInstall"
+ title="<?= t("Welcome to Gallery 3") ?>"
+ href="<?= url::site("after_install") ?>"/>
+<script type="text/javascript">
+ $(document).ready(function(){openDialog($("#gAfterInstall"));});
+</script>