diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index fc54e3d2..c8236997 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -22,8 +22,9 @@
width="40"
height="40" />
- = t('on %date
said',
array("date" => date("Y-M-d H:i:s", $comment->created),
+ "url" => user_profile::url($comment->author_id),
"name" => html::clean($comment->author_name()))); ?>
diff --git a/modules/gallery/controllers/admin_identity.php b/modules/gallery/controllers/admin_identity.php
deleted file mode 100644
index 354e6c0c..00000000
--- a/modules/gallery/controllers/admin_identity.php
+++ /dev/null
@@ -1,76 +0,0 @@
-content = new View("admin_identity.html");
- $view->content->available = identity::providers();
- $view->content->active = module::get_var("gallery", "identity_provider", "user");
- print $view;
- }
-
- public function confirm() {
- access::verify_csrf();
-
- $v = new View("admin_identity_confirm.html");
- $v->new_provider = Input::instance()->post("provider");
-
- print $v;
- }
-
- public function change() {
- access::verify_csrf();
-
- $active_provider = module::get_var("gallery", "identity_provider", "user");
- $providers = identity::providers();
- $new_provider = Input::instance()->post("provider");
-
- if ($new_provider != $active_provider) {
-
- module::deactivate($active_provider);
-
- // Switch authentication
- identity::reset();
- module::set_var("gallery", "identity_provider", $new_provider);
-
- module::install($new_provider);
- module::activate($new_provider);
-
- module::event("identity_provider_changed", $active_provider, $new_provider);
-
- module::uninstall($active_provider);
-
- message::success(t("Changed to %description",
- array("description" => $providers->$new_provider)));
-
- try {
- Session::instance()->destroy();
- } catch (Exception $e) {
- // We don't care if there was a problem destroying the session.
- }
- url::redirect(item::root()->abs_url());
- }
-
- message::info(t("The selected provider \"%description\" is already active.",
- array("description" => $providers->$new_provider)));
- url::redirect("admin/identity");
- }
-}
-
diff --git a/modules/gallery/controllers/admin_modules.php b/modules/gallery/controllers/admin_modules.php
index 46defbef..84fee25d 100644
--- a/modules/gallery/controllers/admin_modules.php
+++ b/modules/gallery/controllers/admin_modules.php
@@ -42,7 +42,7 @@ class Admin_Modules_Controller extends Admin_Controller {
if ($info->active && !$desired && module::is_active($module_name)) {
$messages = array_merge($messages, module::can_deactivate($module_name));
} else if (!$info->active && $desired && !module::is_active($module_name)) {
- $messages = array_merge($messages, module::check_environment($module_name));
+ $messages = array_merge($messages, module::can_activate($module_name));
}
}
@@ -76,21 +76,24 @@ class Admin_Modules_Controller extends Admin_Controller {
continue;
}
- $desired = Input::instance()->post($module_name) == 1;
- if ($info->active && !$desired && module::is_active($module_name)) {
- $changes->deactivate[] = $module_name;
- $deactivated_names[] = t($info->name);
- module::deactivate($module_name);
- } else if (!$info->active && $desired && !module::is_active($module_name)) {
- $changes->activate[] = $module_name;
- $activated_names[] = t($info->name);
-
- if (module::is_installed($module_name)) {
- module::upgrade($module_name);
- } else {
- module::install($module_name);
+ try {
+ $desired = Input::instance()->post($module_name) == 1;
+ if ($info->active && !$desired && module::is_active($module_name)) {
+ module::deactivate($module_name);
+ $changes->deactivate[] = $module_name;
+ $deactivated_names[] = t($info->name);
+ } else if (!$info->active && $desired && !module::is_active($module_name)) {
+ if (module::is_installed($module_name)) {
+ module::upgrade($module_name);
+ } else {
+ module::install($module_name);
+ }
+ module::activate($module_name);
+ $changes->activate[] = $module_name;
+ $activated_names[] = t($info->name);
}
- module::activate($module_name);
+ } catch (Exception $e) {
+ Kohana_Log::add("error", (string)$e);
}
}
diff --git a/modules/gallery/controllers/login.php b/modules/gallery/controllers/login.php
index 464db491..cfe86cfb 100644
--- a/modules/gallery/controllers/login.php
+++ b/modules/gallery/controllers/login.php
@@ -48,7 +48,11 @@ class Login_Controller extends Controller {
if ($valid) {
url::redirect(item::root()->abs_url());
} else {
- print $form;
+ $view = new Theme_View("page.html", "other", "login");
+ $view->page_title = t("Log in to Gallery");
+ $view->content = new View("login_ajax.html");
+ $view->content->form = $form;
+ print $view;
}
}
diff --git a/modules/gallery/controllers/user_profile.php b/modules/gallery/controllers/user_profile.php
new file mode 100644
index 00000000..808531da
--- /dev/null
+++ b/modules/gallery/controllers/user_profile.php
@@ -0,0 +1,80 @@
+id == $id;
+ $display_all = $active_user->admin || ($is_current_active && !$active_user->guest);
+
+ $v = new Theme_View("page.html", "other", "profile");
+ $v->page_title = t("%name Profile", array("name" => $user->display_name()));
+ $v->content = new View("user_profile.html");
+
+ // @todo modify user_home to supply a link to their album,
+ // @todo add list of watches
+ // @todo add all comments
+ // @todo add rest api key
+ $v->content->user = $user;
+ $v->content->height = 250;
+ $v->content->not_current = !$is_current_active;
+ $v->content->editable = identity::is_writable() && $display_all;
+ $v->content->return = SafeString::of(Input::instance()->get("return"));
+
+ $fields = array("name" => t("Name"), "locale" => t("Locale"), "email" => t("Email"),
+ "full_name" => t("Full name"), "url" => "Web site");
+ if (!$display_all) {
+ $fields = array("name" => t("Name"), "full_name" => t("Full name"), "url" => "Web site");
+ }
+ $v->content->fields = array();
+ foreach ($fields as $field => $label) {
+ if (!empty($user->$field)) {
+ $v->content->fields[(string)$label->for_html()] = $user->$field;
+ }
+ }
+
+ print $v;
+ }
+
+ public function contact($id) {
+ $user = identity::lookup_user($id);
+ print user_profile::get_contact_form($user);
+ }
+
+ public function send($id) {
+ $user = identity::lookup_user($id);
+ $form = user_profile::get_contact_form($user);
+ if ($form->validate()) {
+ Sendmail::factory()
+ ->to($user->email)
+ ->subject($form->message->subject->value)
+ ->header("Mime-Version", "1.0")
+ ->header("Content-type", "text/html; charset=iso-8859-1")
+ ->reply_to($form->message->reply_to->value)
+ ->message($form->message->message->value)
+ ->send();
+ message::success(t("Sent message to %user_name", array("user_name" => $user->display_name())));
+ print json_encode(array("result" => "success"));
+ } else {
+ print json_encode(array("result" => "error", "form" => (string)$form));
+ }
+ }
+}
diff --git a/modules/gallery/css/l10n_client.css b/modules/gallery/css/l10n_client.css
index 3771c049..053b4432 100644
--- a/modules/gallery/css/l10n_client.css
+++ b/modules/gallery/css/l10n_client.css
@@ -184,7 +184,9 @@
}
#l10n-client-string-editor .translation {
- overflow:hidden;
+ overflow-y:auto;
+ overflow-x: hidden;
+ height: 20em;
width:49%;
float: right;
}
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index 4d208893..255176c4 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -30,21 +30,23 @@ class gallery_event_Core {
static function user_deleted($user) {
$admin = identity::admin_user();
- db::build()
- ->update("tasks")
- ->set("owner_id", $admin->id)
- ->where("owner_id", "=", $user->id)
- ->execute();
- db::build()
- ->update("items")
- ->set("owner_id", $admin->id)
- ->where("owner_id", "=", $user->id)
- ->execute();
- db::build()
- ->update("logs")
- ->set("user_id", $admin->id)
- ->where("user_id", "=", $user->id)
- ->execute();
+ if (!empty($admin)) { // could be empty if there is not identity provider
+ db::build()
+ ->update("tasks")
+ ->set("owner_id", $admin->id)
+ ->where("owner_id", "=", $user->id)
+ ->execute();
+ db::build()
+ ->update("items")
+ ->set("owner_id", $admin->id)
+ ->where("owner_id", "=", $user->id)
+ ->execute();
+ db::build()
+ ->update("logs")
+ ->set("user_id", $admin->id)
+ ->where("user_id", "=", $user->id)
+ ->execute();
+ }
}
static function identity_provider_changed($old_provider, $new_provider) {
@@ -127,12 +129,11 @@ class gallery_event_Core {
->label(t("Login")));
} else {
$csrf = access::csrf_token();
- $item = $theme->item();
- $menu->append(Menu::factory("dialog")
+ $menu->append(Menu::factory("link")
->id("user_menu_edit_profile")
->css_id("g-user-profile-link")
->view("login_current_user.html")
- ->url(url::site("form/edit/users/{$user->id}"))
+ ->url(user_profile::url($user->id))
->label($user->display_name()));
$menu->append(Menu::factory("link")
->id("user_menu_logout")
@@ -246,11 +247,7 @@ class gallery_event_Core {
->append(Menu::factory("link")
->id("advanced")
->label(t("Advanced"))
- ->url(url::site("admin/advanced_settings")))
- ->append(Menu::factory("link")
- ->id("authentication")
- ->label(t("Authentication"))
- ->url(url::site("admin/identity"))))
+ ->url(url::site("admin/advanced_settings"))))
->append(Menu::factory("link")
->id("modules")
->label(t("Modules"))
diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php
index 8d76e333..5c8c227a 100644
--- a/modules/gallery/helpers/locales.php
+++ b/modules/gallery/helpers/locales.php
@@ -41,7 +41,7 @@ class locales_Core {
$default = module::get_var("gallery", "default_locale");
$codes = explode("|", module::get_var("gallery", "installed_locales", $default));
foreach ($codes as $code) {
- if (isset($available->$code)) {
+ if (isset($available[$code])) {
$installed[$code] = $available[$code];
}
}
@@ -127,7 +127,7 @@ class locales_Core {
}
$locale or $locale = Gallery_I18n::instance()->locale();
- return self::$locales["$locale"];
+ return self::$locales[$locale];
}
static function is_rtl($locale=null) {
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php
index 595f600b..f680ff6a 100644
--- a/modules/gallery/helpers/module.php
+++ b/modules/gallery/helpers/module.php
@@ -120,17 +120,17 @@ class module_Core {
}
/**
- * Check that the module can be installed. (i.e. all the prerequistes exist)
+ * Check that the module can be activated. (i.e. all the prerequistes exist)
* @param string $module_name
* @return array an array of warning or error messages to be displayed
*/
- static function check_environment($module_name) {
+ static function can_activate($module_name) {
module::_add_to_path($module_name);
$messages = array();
$installer_class = "{$module_name}_installer";
- if (method_exists($installer_class, "check_environment")) {
- $messages = call_user_func(array($installer_class, "check_environment"));
+ if (method_exists($installer_class, "can_activate")) {
+ $messages = call_user_func(array($installer_class, "can_activate"));
}
// Remove it from the active path
diff --git a/modules/gallery/helpers/user_profile.php b/modules/gallery/helpers/user_profile.php
new file mode 100644
index 00000000..018e1bd1
--- /dev/null
+++ b/modules/gallery/helpers/user_profile.php
@@ -0,0 +1,55 @@
+id}", "", "post",
+ array("id" => "g-user-profile-contact-form"));
+ $group = $form->group("message")
+ ->label(t("Compose message to %name", array("name" => $user->display_name())));
+ $group->input("reply_to")
+ ->label(t("From:"))
+ ->rules("required|length[1, 256]|valid_email")
+ ->error_messages("required", t("Field is required"))
+ ->error_messages("max_length", t("Field exceeds 256 bytes"))
+ ->error_messages("valid_email", t("Field is not a valid email address"));
+ $group->input("subject")
+ ->label(t("Subject:"))
+ ->rules("required|length[1, 256]")
+ ->error_messages("required", t("Field is required"))
+ ->error_messages("max_length", t("Field exceeds 256 bytes"));
+ $group->textarea("message")
+ ->label(t("Message:"))
+ ->rules("required")
+ ->error_messages("required", t("Field is required"));
+ module::event("user_profile_contact_form", $form);
+ $group->submit("")->value(t("Send"));
+ return $form;
+ }
+}
diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php
index a990e4ca..e3f9dff0 100644
--- a/modules/gallery/libraries/Admin_View.php
+++ b/modules/gallery/libraries/Admin_View.php
@@ -36,6 +36,8 @@ class Admin_View_Core extends Gallery_View {
$this->sidebar = "";
$this->set_global("theme", $this);
$this->set_global("user", identity::active_user());
+ $this->set_global("page_type", "admin");
+ $this->set_global("page_subtype", $name);
}
public function admin_menu() {
@@ -44,6 +46,14 @@ class Admin_View_Core extends Gallery_View {
return $menu->render();
}
+ public function user_menu() {
+ $menu = Menu::factory("root")
+ ->css_id("g-login-menu")
+ ->css_class("g-inline ui-helper-clear-fix");
+ module::event("user_menu", $menu, $this);
+ return $menu->render();
+ }
+
/**
* Print out any site wide status information.
*/
diff --git a/modules/gallery/libraries/IdentityProvider.php b/modules/gallery/libraries/IdentityProvider.php
index 30d4efa4..79151154 100644
--- a/modules/gallery/libraries/IdentityProvider.php
+++ b/modules/gallery/libraries/IdentityProvider.php
@@ -57,6 +57,51 @@ class IdentityProvider_Core {
Kohana_Config::instance()->clear("identity");
}
+ /**
+ * Return a commen confirmation message
+ */
+ static function confirmation_message() {
+ return t("Are you sure you want to change your Identity Provider? " .
+ "Continuing will delete all existing users.");
+ }
+
+ static function change_provider($new_provider) {
+ $current_provider = module::get_var("gallery", "identity_provider");
+ if (!empty($current_provider)) {
+ module::uninstall($current_provider);
+ }
+
+ try {
+ IdentityProvider::reset();
+ $provider = new IdentityProvider($new_provider);
+
+ module::set_var("gallery", "identity_provider", $new_provider);
+
+ if (method_exists("{$new_provider}_installer", "initialize")) {
+ call_user_func("{$new_provider}_installer::initialize");
+ }
+
+ module::event("identity_provider_changed", $current_provider, $new_provider);
+
+ auth::login($provider->admin_user());
+ Session::instance()->regenerate();
+ } catch (Exception $e) {
+ // Make sure new provider is not in the database
+ module::uninstall($new_provider);
+
+ // Lets reset to the current provider so that the gallery installation is still
+ // working.
+ module::set_var("gallery", "identity_provider", null);
+ IdentityProvider::change_provider($current_provider);
+ module::activate($current_provider);
+ message::error(
+ t("Error attempting to enable \"%new_provider\" identity provider, " .
+ "reverted to \"%old_provider\" identity provider",
+ array("new_provider" => $new_provider, "old_provider" => $current_provider)));
+ throw $e;
+ }
+ }
+
/**
* Loads the configured driver and validates it.
*
diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt
index 71ae5a0c..40f37e96 100644
--- a/modules/gallery/tests/controller_auth_data.txt
+++ b/modules/gallery/tests/controller_auth_data.txt
@@ -19,6 +19,9 @@ modules/gallery/controllers/quick.php form_edit
modules/gallery/controllers/simple_uploader.php start DIRTY_AUTH
modules/gallery/controllers/simple_uploader.php finish DIRTY_AUTH
modules/gallery/controllers/upgrader.php index DIRTY_AUTH
+modules/gallery/controllers/user_profile.php show DIRTY_CSRF|DIRTY_AUTH
+modules/gallery/controllers/user_profile.php contact DIRTY_AUTH
+modules/gallery/controllers/user_profile.php send DIRTY_AUTH
modules/gallery/controllers/welcome_message.php index DIRTY_AUTH
modules/rest/controllers/rest.php index DIRTY_CSRF|DIRTY_AUTH
modules/rest/controllers/rest.php __call DIRTY_CSRF|DIRTY_AUTH
diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt
index 5f6e8520..a89725c0 100644
--- a/modules/gallery/tests/xss_data.txt
+++ b/modules/gallery/tests/xss_data.txt
@@ -43,6 +43,7 @@ modules/g2_import/views/admin_g2_import.html.php 30 DIRTY $form
modules/gallery/views/admin_advanced_settings.html.php 21 DIRTY_ATTR text::alternate("g-odd","g-even")
modules/gallery/views/admin_advanced_settings.html.php 22 DIRTY $var->module_name
modules/gallery/views/admin_block_log_entries.html.php 4 DIRTY_ATTR log::severity_class($entry->severity)
+modules/gallery/views/admin_block_log_entries.html.php 5 DIRTY_JS user_profile::url($entryr->id)
modules/gallery/views/admin_block_log_entries.html.php 6 DIRTY gallery::date_time($entry->timestamp)
modules/gallery/views/admin_block_log_entries.html.php 7 DIRTY $entry->message
modules/gallery/views/admin_block_log_entries.html.php 8 DIRTY $entry->html
@@ -66,11 +67,6 @@ modules/gallery/views/admin_graphics_graphicsmagick.html.php 18 DIRTY $tk->e
modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $is_active?" g-selected":""
modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $tk->installed?" g-installed-toolkit":" g-unavailable"
modules/gallery/views/admin_graphics_imagemagick.html.php 18 DIRTY $tk->error
-modules/gallery/views/admin_identity.html.php 43 DIRTY access::csrf_form_field()
-modules/gallery/views/admin_identity.html.php 50 DIRTY_ATTR text::alternate("g-odd","g-even")
-modules/gallery/views/admin_identity.html.php 52 DIRTY form::radio($data,$module_name,$module_name==$active)
-modules/gallery/views/admin_identity_confirm.html.php 3 DIRTY access::csrf_form_field()
-modules/gallery/views/admin_identity_confirm.html.php 4 DIRTY form::hidden("provider",$new_provider)
modules/gallery/views/admin_languages.html.php 43 DIRTY access::csrf_form_field()
modules/gallery/views/admin_languages.html.php 60 DIRTY_ATTR (isset($installed_locales[$code]))?"g-available":""
modules/gallery/views/admin_languages.html.php 60 DIRTY_ATTR ($default_locale==$code)?" g-selected":""
@@ -98,10 +94,12 @@ modules/gallery/views/admin_maintenance.html.php 158 DIRTY $task-
modules/gallery/views/admin_maintenance_show_log.html.php 8 DIRTY_JS url::site("admin/maintenance/save_log/$task->id?csrf=$csrf")
modules/gallery/views/admin_maintenance_show_log.html.php 13 DIRTY $task->name
modules/gallery/views/admin_maintenance_task.html.php 55 DIRTY $task->name
-modules/gallery/views/admin_modules.html.php 48 DIRTY access::csrf_form_field()
-modules/gallery/views/admin_modules.html.php 57 DIRTY_ATTR text::alternate("g-odd","g-even")
-modules/gallery/views/admin_modules.html.php 60 DIRTY form::checkbox($data,'1',module::is_active($module_name))
-modules/gallery/views/admin_modules.html.php 62 DIRTY $module_info->version
+modules/gallery/views/admin_modules.html.php 25 DIRTY_JS t("Continue")
+modules/gallery/views/admin_modules.html.php 35 DIRTY_JS t("Continue")
+modules/gallery/views/admin_modules.html.php 51 DIRTY access::csrf_form_field()
+modules/gallery/views/admin_modules.html.php 60 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/gallery/views/admin_modules.html.php 63 DIRTY form::checkbox($data,'1',module::is_active($module_name))
+modules/gallery/views/admin_modules.html.php 65 DIRTY $module_info->version
modules/gallery/views/admin_modules_confirm.html.php 11 DIRTY_ATTR $class
modules/gallery/views/admin_modules_confirm.html.php 11 DIRTY $message
modules/gallery/views/admin_modules_confirm.html.php 16 DIRTY access::csrf_form_field()
@@ -122,11 +120,11 @@ modules/gallery/views/admin_themes.html.php 62 DIRTY $theme
modules/gallery/views/admin_themes.html.php 76 DIRTY $info->name
modules/gallery/views/admin_themes.html.php 78 DIRTY $info->description
modules/gallery/views/admin_themes_preview.html.php 7 DIRTY_ATTR $url
-modules/gallery/views/form_uploadify.html.php 24 DIRTY_JS url::file("lib/uploadify/uploadify.swf")
-modules/gallery/views/form_uploadify.html.php 25 DIRTY_JS url::site("simple_uploader/add_photo/{$album->id}")
-modules/gallery/views/form_uploadify.html.php 29 DIRTY_JS url::file("lib/uploadify/cancel.png")
-modules/gallery/views/form_uploadify.html.php 30 DIRTY_JS $simultaneous_upload_limit
-modules/gallery/views/form_uploadify.html.php 55 DIRTY_JS t("Completed")
+modules/gallery/views/form_uploadify.html.php 30 DIRTY_JS url::file("lib/uploadify/uploadify.swf")
+modules/gallery/views/form_uploadify.html.php 31 DIRTY_JS url::site("simple_uploader/add_photo/{$album->id}")
+modules/gallery/views/form_uploadify.html.php 35 DIRTY_JS url::file("lib/uploadify/cancel.png")
+modules/gallery/views/form_uploadify.html.php 36 DIRTY_JS $simultaneous_upload_limit
+modules/gallery/views/form_uploadify.html.php 61 DIRTY_JS t("Completed")
modules/gallery/views/in_place_edit.html.php 2 DIRTY form::open($action,array("method"=>"post","id"=>"g-in-place-edit-form","class"=>"g-short-form"),$hidden)
modules/gallery/views/in_place_edit.html.php 5 DIRTY form::input("input",$form["input"]," class=\"textbox\"")
modules/gallery/views/in_place_edit.html.php 12 DIRTY form::close()
@@ -221,6 +219,10 @@ modules/gallery/views/upgrader.html.php 77 DIRTY $modul
modules/gallery/views/upgrader.html.php 99 DIRTY_ATTR $done?"muted":""
modules/gallery/views/upgrader.html.php 102 DIRTY_ATTR $done?"muted":""
modules/gallery/views/user_languages_block.html.php 2 DIRTY form::dropdown("g-select-session-locale",$installed_locales,$selected)
+modules/gallery/views/user_profile.html.php 35 DIRTY_ATTR $height
+modules/gallery/views/user_profile.html.php 44 DIRTY $field
+modules/gallery/views/user_profile.html.php 45 DIRTY $value
+modules/gallery/views/user_profile.html.php 65 DIRTY_JS $return->for_html_attr()
modules/image_block/views/image_block_block.html.php 3 DIRTY_JS $item->url()
modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"g-thumbnail"))
modules/info/views/info_block.html.php 22 DIRTY date("M j, Y H:i:s",$item->captured)
@@ -330,14 +332,15 @@ themes/admin_wind/views/admin.html.php 16 DIRTY_JS $theme
themes/admin_wind/views/admin.html.php 33 DIRTY $theme->admin_head()
themes/admin_wind/views/admin.html.php 37 DIRTY $theme->admin_page_top()
themes/admin_wind/views/admin.html.php 45 DIRTY $theme->admin_header_top()
-themes/admin_wind/views/admin.html.php 60 DIRTY_JS item::root()->url()
-themes/admin_wind/views/admin.html.php 64 DIRTY $theme->admin_menu()
-themes/admin_wind/views/admin.html.php 66 DIRTY $theme->admin_header_bottom()
-themes/admin_wind/views/admin.html.php 73 DIRTY $content
-themes/admin_wind/views/admin.html.php 79 DIRTY $sidebar
-themes/admin_wind/views/admin.html.php 84 DIRTY $theme->admin_footer()
-themes/admin_wind/views/admin.html.php 86 DIRTY $theme->admin_credits()
-themes/admin_wind/views/admin.html.php 90 DIRTY $theme->admin_page_bottom()
+themes/admin_wind/views/admin.html.php 46 DIRTY_JS item::root()->url()
+themes/admin_wind/views/admin.html.php 49 DIRTY $theme->user_menu()
+themes/admin_wind/views/admin.html.php 51 DIRTY $theme->admin_menu()
+themes/admin_wind/views/admin.html.php 53 DIRTY $theme->admin_header_bottom()
+themes/admin_wind/views/admin.html.php 60 DIRTY $content
+themes/admin_wind/views/admin.html.php 66 DIRTY $sidebar
+themes/admin_wind/views/admin.html.php 71 DIRTY $theme->admin_footer()
+themes/admin_wind/views/admin.html.php 73 DIRTY $theme->admin_credits()
+themes/admin_wind/views/admin.html.php 77 DIRTY $theme->admin_page_bottom()
themes/admin_wind/views/block.html.php 3 DIRTY_ATTR $anchor
themes/admin_wind/views/block.html.php 5 DIRTY $id
themes/admin_wind/views/block.html.php 5 DIRTY_ATTR $css_id
diff --git a/modules/gallery/views/admin_block_log_entries.html.php b/modules/gallery/views/admin_block_log_entries.html.php
index 780ff2d0..90ce88a7 100644
--- a/modules/gallery/views/admin_block_log_entries.html.php
+++ b/modules/gallery/views/admin_block_log_entries.html.php
@@ -2,7 +2,7 @@
foreach ($entries as $entry): ?>
- user_id") ?>">= html::clean($entry->user->name) ?>
+ = html::clean($entry->user->name) ?>
= gallery::date_time($entry->timestamp) ?>
= $entry->message ?>
= $entry->html ?>
diff --git a/modules/gallery/views/admin_identity.html.php b/modules/gallery/views/admin_identity.html.php
deleted file mode 100644
index 51eaa58a..00000000
--- a/modules/gallery/views/admin_identity.html.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
= t("Manage identity providers") ?>
-
- = t("Choose a different user/group management provider.") ?>
-
-
-
-
diff --git a/modules/gallery/views/admin_identity_confirm.html.php b/modules/gallery/views/admin_identity_confirm.html.php
deleted file mode 100644
index 54aae9c8..00000000
--- a/modules/gallery/views/admin_identity_confirm.html.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php
index 704e7beb..26b2c87c 100644
--- a/modules/gallery/views/admin_modules.html.php
+++ b/modules/gallery/views/admin_modules.html.php
@@ -22,6 +22,9 @@
buttons: {
= t("Continue")->for_js() ?>: function() {
$("form", this).submit();
+ $(".ui-dialog-buttonpane button:contains(= t("Continue") ?>)")
+ .attr("disabled", "disabled")
+ .addClass("ui-state-disabled");
},
= t("Cancel")->for_js() ?>: function() {
$(this).dialog("destroy").remove();
@@ -29,7 +32,7 @@
}
});
if (!data.allow_continue) {
- $(".ui-dialog-buttonpane button:contains(Continue)")
+ $(".ui-dialog-buttonpane button:contains(= t("Continue") ?>)")
.attr("disabled", "disabled")
.addClass("ui-state-disabled");
}
diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php
index f3b9c883..b3b81ecb 100644
--- a/modules/gallery/views/form_uploadify.html.php
+++ b/modules/gallery/views/form_uploadify.html.php
@@ -2,17 +2,21 @@
@@ -21,6 +25,8 @@
+
+
= t("%name Profile", array("name" => $user->display_name())) ?>
+
+
+ = t("User information") ?>
+
+
+ foreach ($fields as $field => $value): ?>
+
+ = $field ?>
+ = $value ?>
+
+ endforeach ?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/recaptcha/helpers/recaptcha_event.php b/modules/recaptcha/helpers/recaptcha_event.php
index e7ded3ab..a7f64bdd 100644
--- a/modules/recaptcha/helpers/recaptcha_event.php
+++ b/modules/recaptcha/helpers/recaptcha_event.php
@@ -18,6 +18,12 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class recaptcha_event_Core {
+ static function user_profile_contact_form($form) {
+ if (module::get_var("recaptcha", "public_key")) {
+ $form->message->recaptcha("recaptcha")->label("")->id("g-recaptcha");
+ }
+ }
+
static function comment_add_form($form) {
if (module::get_var("recaptcha", "public_key")) {
$form->add_comment->recaptcha("recaptcha")->label("")->id("g-recaptcha");
diff --git a/modules/slideshow/helpers/slideshow_installer.php b/modules/slideshow/helpers/slideshow_installer.php
index 319e2e79..8d612f3e 100644
--- a/modules/slideshow/helpers/slideshow_installer.php
+++ b/modules/slideshow/helpers/slideshow_installer.php
@@ -34,7 +34,7 @@ class slideshow_installer {
site_status::clear("slideshow_needs_rss");
}
- static function check_environment() {
+ static function can_activate() {
$messages = array();
if (!module::is_active("rss")) {
$messages["warn"][] = t("The Slideshow module requires the RSS module.");
diff --git a/modules/user/helpers/user_installer.php b/modules/user/helpers/user_installer.php
index f7e3b60b..f2d131ae 100644
--- a/modules/user/helpers/user_installer.php
+++ b/modules/user/helpers/user_installer.php
@@ -18,7 +18,39 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class user_installer {
+ static function can_activate() {
+ return array("warn" => array(IdentityProvider::confirmation_message()));
+ }
+
static function install() {
+ IdentityProvider::change_provider("user");
+ }
+
+ static function upgrade($version) {
+ if ($version == 1) {
+ module::set_var("user", "mininum_password_length", 5);
+
+ module::set_version("user", $version = 2);
+ }
+ }
+
+ static function uninstall() {
+ // Delete all users and groups so that we give other modules an opportunity to clean up
+ foreach (ORM::factory("user")->find_all() as $user) {
+ $user->delete();
+ }
+
+ foreach (ORM::factory("group")->find_all() as $group) {
+ $group->delete();
+ }
+
+ $db = Database::instance();
+ $db->query("DROP TABLE IF EXISTS {users};");
+ $db->query("DROP TABLE IF EXISTS {groups};");
+ $db->query("DROP TABLE IF EXISTS {groups_users};");
+ }
+
+ static function initialize() {
$db = Database::instance();
$db->query("CREATE TABLE IF NOT EXISTS {users} (
`id` int(9) NOT NULL auto_increment,
@@ -89,19 +121,6 @@ class user_installer {
$admin->add($registered);
$admin->save();
- $current_provider = module::get_var("gallery", "identity_provider");
- if (empty($current_provider)) {
- // If there is no provider defined then we are doing an initial install
- // so we need to set the provider and make the administrator own everything
- // If the installer is called and there is an identity provider, then we
- // are switching identity providers and and the event handlers will do the
- // right things
- module::set_var("gallery", "identity_provider", "user");
-
- // Let the admin own everything
- $db->query("update {items} set owner_id = {$admin->id}");
- }
-
$root = ORM::factory("item", 1);
access::allow($everybody, "view", $root);
access::allow($everybody, "view_full", $root);
@@ -109,32 +128,7 @@ class user_installer {
access::allow($registered, "view", $root);
access::allow($registered, "view_full", $root);
- module::set_var("user", "mininum_password_length", 5);
-
module::set_version("user", 2);
- }
-
- static function upgrade($version) {
- if ($version == 1) {
- module::set_var("user", "mininum_password_length", 5);
-
- module::set_version("user", $version = 2);
- }
- }
-
- static function uninstall() {
- // Delete all users and groups so that we give other modules an opportunity to clean up
- foreach (ORM::factory("user")->find_all() as $user) {
- $user->delete();
- }
-
- foreach (ORM::factory("group")->find_all() as $group) {
- $group->delete();
- }
-
- $db = Database::instance();
- $db->query("DROP TABLE IF EXISTS {users};");
- $db->query("DROP TABLE IF EXISTS {groups};");
- $db->query("DROP TABLE IF EXISTS {groups_users};");
+ module::set_var("user", "mininum_password_length", 5);
}
}
\ No newline at end of file
diff --git a/modules/user/module.info b/modules/user/module.info
index 7178f108..d1e02382 100644
--- a/modules/user/module.info
+++ b/modules/user/module.info
@@ -2,5 +2,3 @@ name = "Users and Groups"
description = "Gallery 3 user and group management"
version = 2
-; Don't show this module on the module administration screen
-no_module_admin = 1
diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php
index 45d04916..270a7207 100644
--- a/modules/user/views/admin_users.html.php
+++ b/modules/user/views/admin_users.html.php
@@ -107,7 +107,7 @@