From 72c7fed975ce797da1f33ea82651c5a91ce3957e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 8 Mar 2009 21:21:09 +0000 Subject: Log the user in as admin after running the web installer, and give them a nice "Welcome to Gallery 3" dialog. The text in there needs a little work but it's a start. In the process, re-build the install.sql using the scaffolding code. --- core/controllers/after_install.php | 30 ++++++++++++++++++++++++++++++ core/helpers/core_installer.php | 8 ++++---- core/helpers/core_theme.php | 4 ++++ core/views/after_install.html.php | 28 ++++++++++++++++++++++++++++ core/views/after_install_loader.html.php | 6 ++++++ 5 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 core/controllers/after_install.php create mode 100644 core/views/after_install.html.php create mode 100644 core/views/after_install_loader.html.php (limited to 'core') 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 @@ +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 @@ +

+ +

+ +

+ +

+ +

+ %user_name account. The very first thing you should do is to change your password to something that you'll remember.", array("user_name" => $user->name)) ?> +

+ +

+ id}") ?>" + title="" + id="gAfterInstallChangePasswordLink"> + +

+ +

+ Gallery website has news and information about Gallery and the Gallery community.", array("url" => "http://gallery.menalto.com")) ?> +

+ +

+ documentation site or you can ask for help in the forums!", array("codex_url" => "http://codex.gallery2.org/Main_Page", "forum_url" => "http://gallery.menalto.com/forum")) ?> + 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 @@ +" + href=""/> + -- cgit v1.2.3